From 4d930a25b597b6be663f8bc37cb6f92fef49e4c6 Mon Sep 17 00:00:00 2001 From: Tharusha Silva Date: Fri, 21 Aug 2026 21:27:28 +0530 Subject: [PATCH] feat: add Bruno collections generated from Postman sources Adds BrunoCollections/, a Bruno equivalent of PostmanCollections/ written in the OpenCollection format (opencollection: 1.0.0): 92 collections, 297 folders, 1183 requests and 92 environments, one self-contained collection per API to mirror the one-file-per-API layout of the Postman sources. A workspace.yml links all 92 so they open together from the title-bar workspace switcher. Bruno does not support nesting collections, so the container is a workspace rather than a parent collection. The 1126 portman-generated pm.* test blocks do not run in Bruno and were rewritten against its test()/expect() API, including 804 JSON-schema assertions compiled through the bundled ajv, which resolves under the default `safe` script sandbox. Generation lives in BrunoCollections/_tools and is rerunnable via convert.sh, so this directory can be refreshed as the portman workflow updates PostmanCollections/. Secret variables are declared with no value, keeping credentials out of the committed files. --- BrunoCollections/README.md | 172 +++++ .../Track ad clicks.yml | 91 +++ .../Track ad impressions.yml | 93 +++ .../Track ad views.yml | 93 +++ .../Track conversions.yml | 113 +++ .../Ads events notification/folder.yml | 4 + .../VTEX - Ads API/Ads/Get ads.yml | 146 ++++ .../VTEX - Ads API/Ads/folder.yml | 4 + .../Generate audience upload URL.yml | 88 +++ .../VTEX - Ads API/Audiences/folder.yml | 4 + .../Synchronize inventory information.yml | 95 +++ .../Synchronize product information.yml | 115 +++ .../Catalog synchronization/folder.yml | 4 + .../Notify credit transfer status.yml | 66 ++ .../VTEX - Ads API/Credit transfer/folder.yml | 4 + .../Reports/Get ads performance report.yml | 242 +++++++ .../Get advertiser ads detailed report.yml | 222 ++++++ ...t advertiser campaigns detailed report.yml | 219 ++++++ .../Reports/Get advertisers report.yml | 153 ++++ .../Reports/Get campaign details.yml | 207 ++++++ .../Reports/Get network publishers report.yml | 162 +++++ .../Reports/Get publishers report.yml | 165 +++++ .../VTEX - Ads API/Reports/List campaigns.yml | 209 ++++++ .../VTEX - Ads API/Reports/folder.yml | 4 + .../Generate seller single sign-on URL.yml | 83 +++ .../VTEX - Ads API/Single sign-on/folder.yml | 4 + .../VTEX - Ads API/environments/VTEX.yml | 6 + .../VTEX - Ads API/opencollection.yml | 73 ++ .../Anti-fraud Flow/Get anti-fraud status.yml | 99 +++ .../List anti-fraud provider manifest.yml | 97 +++ .../Anti-fraud Flow/Send anti-fraud data.yml | 235 ++++++ ...nti-fraud pre-analysis data (optional).yml | 234 ++++++ .../Stop anti-fraud analysis (optional).yml | 110 +++ ...ate anti-fraud transactions (optional).yml | 207 ++++++ .../Anti-fraud Flow/folder.yml | 4 + .../OAuth Flow/1. Retrieve token.yml | 91 +++ .../OAuth Flow/2. Redirect.yml | 64 ++ .../OAuth Flow/3. Return to VTEX.yml | 62 ++ .../OAuth Flow/4. Get credentials.yml | 90 +++ .../OAuth Flow/folder.yml | 4 + .../environments/VTEX.yml | 12 + .../opencollection.yml | 43 ++ .../Audience Manager/Fetch audience.yml | 85 +++ .../Audience Manager/folder.yml | 4 + .../Delete price table mapping.yml | 53 ++ .../Get price table mapping.yml | 78 ++ .../Set price table mapping.yml | 60 ++ .../Price Table Mapper/folder.yml | 4 + .../VTEX - Audience API/environments/VTEX.yml | 10 + .../VTEX - Audience API/opencollection.yml | 42 ++ .../Addresses/Create B2B address.yml | 109 +++ .../Addresses/Delete B2B address.yml | 61 ++ .../Addresses/Get B2B address by ID.yml | 121 ++++ .../Addresses/Search B2B addresses.yml | 148 ++++ .../Addresses/Update B2B address.yml | 116 +++ .../Addresses/folder.yml | 4 + .../Locations/Create location.yml | 97 +++ .../Locations/Delete location.yml | 65 ++ .../Locations/Get location.yml | 118 +++ .../Locations/Search locations.yml | 113 +++ .../Locations/Update location.yml | 75 ++ .../Locations/folder.yml | 4 + .../Recipients/Create recipient.yml | 104 +++ .../Recipients/Delete recipient.yml | 61 ++ .../Recipients/Get recipient by ID.yml | 112 +++ .../Recipients/Search recipients.yml | 115 +++ .../Recipients/Update recipient.yml | 82 +++ .../Recipients/folder.yml | 4 + .../environments/VTEX.yml | 14 + .../opencollection.yml | 51 ++ .../Buyer data/Create buyer.yml | 112 +++ .../Buyer data/Delete buyer.yml | 63 ++ .../Buyer data/Get buyer by ID.yml | 120 ++++ .../Buyer data/Get buyer schema.yml | 178 +++++ .../Buyer data/Search buyers.yml | 128 ++++ .../Buyer data/Update buyer.yml | 84 +++ .../Buyer data/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 24 + .../Create new contact information.yml | 109 +++ .../Delete contact information.yml | 64 ++ .../Get contact information by ID.yml | 115 +++ .../Search contact information.yml | 117 +++ .../Update contact information.yml | 86 +++ .../Contact information/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 33 + .../Contracts/Create contract.yml | 153 ++++ .../Contracts/Delete contract by ID.yml | 64 ++ .../Contracts/Get contract by ID.yml | 184 +++++ .../Contracts/Update contract by ID.yml | 128 ++++ .../Contracts/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 26 + .../Validate legacy credentials.yml | 131 ++++ .../Authentication Flow/folder.yml | 4 + .../Client Registration/Register client.yml | 97 +++ .../Client Registration/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 40 ++ .../Recipients/Create new recipient.yml | 109 +++ .../Recipients/Delete recipient.yml | 64 ++ .../Recipients/Get recipient by ID.yml | 115 +++ .../Recipients/Search recipients.yml | 117 +++ .../Recipients/Update recipient.yml | 86 +++ .../Recipients/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 33 + .../Allocations/Change allocation status.yml | 107 +++ .../Allocations/Create allocation.yml | 152 ++++ .../Create batch of allocations.yml | 179 +++++ .../Allocations/Delete allocation.yml | 71 ++ .../Allocations/Get allocation.yml | 128 ++++ .../Allocations/List budget allocations.yml | 142 ++++ .../Allocations/Query allocations.yml | 129 ++++ .../Update allocation linked entity.yml | 78 ++ .../Allocations/Update allocation usage.yml | 81 +++ .../Allocations/Update allocation.yml | 175 +++++ .../VTEX - Budgets API/Allocations/folder.yml | 4 + .../Budgets/Create budget.yml | 213 ++++++ .../Budgets/Delete budget.yml | 65 ++ .../VTEX - Budgets API/Budgets/Get budget.yml | 161 +++++ .../Budgets/List budgets.yml | 141 ++++ .../Budgets/Update budget status.yml | 103 +++ .../Budgets/Update budget.yml | 160 +++++ .../VTEX - Budgets API/Budgets/folder.yml | 4 + .../Reservations/Confirm reservation.yml | 121 ++++ .../Reservations/Create reservation.yml | 122 ++++ .../Reservations/Delete reservation.yml | 121 ++++ .../Reservations/Get reservation.yml | 113 +++ .../Reservations/List reservations.yml | 132 ++++ .../Reservations/folder.yml | 4 + .../Statements/Get allocation statements.yml | 125 ++++ .../Statements/Get budget statements.yml | 121 ++++ .../VTEX - Budgets API/Statements/folder.yml | 4 + .../Transactions/Create transaction.yml | 121 ++++ .../Transactions/Get transaction.yml | 109 +++ .../Transactions/Refund transaction.yml | 114 +++ .../Transactions/folder.yml | 4 + .../VTEX - Budgets API/environments/VTEX.yml | 10 + .../VTEX - Budgets API/opencollection.yml | 83 +++ .../Batch imports/Import prices.yml | 118 +++ .../Batch imports/folder.yml | 4 + .../Batch status/Get batch errors.yml | 85 +++ .../Batch status/Get batch status.yml | 107 +++ .../Batch status/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 49 ++ .../Bulk Import/Check progress.yml | 97 +++ .../Bulk Import/Start import.yml | 65 ++ .../Bulk Import/Upload file.yml | 99 +++ .../Bulk Import/Validate file.yml | 65 ++ .../Bulk Import/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 35 + .../Dimensions/Create dimension.yml | 354 +++++++++ .../Dimensions/Delete dimension.yml | 66 ++ .../Dimensions/Get dimensions information.yml | 235 ++++++ .../Dimensions/Update dimension.yml | 251 +++++++ .../Dimensions/folder.yml | 4 + .../Accept or deny rule.yml | 194 +++++ .../Manual authorization/folder.yml | 4 + .../Rules/Create dimension rule.yml | 160 +++++ .../Rules/Delete dimension rule.yml | 70 ++ .../Rules/Update all dimension rules.yml | 276 +++++++ .../Rules/Update dimension rule.yml | 164 +++++ .../Rules/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 110 +++ ...bsites internet communication protocol.yml | 76 ++ ...specific website comunication protocol.yml | 80 +++ .../Change URI Schema/folder.yml | 8 + .../VTEX - CMS API/environments/VTEX.yml | 10 + .../VTEX - CMS API/opencollection.yml | 17 + .../Get card token import report.yml | 60 ++ .../Get card token import status.yml | 95 +++ .../Card token import/Import card tokens.yml | 100 +++ .../Card token import/folder.yml | 4 + .../Card token/Create card token.yml | 97 +++ .../Card token/Delete card token.yml | 60 ++ .../Card token/Get card token by ID.yml | 126 ++++ .../Card token/Update card token.yml | 84 +++ .../Card token/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 26 + .../Brand/Create brand.yml | 94 +++ .../Brand/Get brand by ID.yml | 92 +++ .../Brand/Get list of brands.yml | 130 ++++ .../Brand/Update brand.yml | 71 ++ .../Brand/folder.yml | 4 + .../Category/Create category.yml | 103 +++ .../Category/Get category by ID.yml | 101 +++ .../Category/Get category tree.yml | 147 ++++ .../Category/Update category tree.yml | 111 +++ .../Category/folder.yml | 4 + .../Product/Create product.yml | 308 ++++++++ .../Product/Get product by ID.yml | 197 +++++ ...l ID, SKU ID, SKU external ID or slug.yml | 198 +++++ .../Get product description by product ID.yml | 91 +++ ...date product description by product ID.yml | 70 ++ .../Product/Update product.yml | 181 +++++ .../Product/folder.yml | 4 + .../SKU/Get list of SKUs.yml | 102 +++ .../SKU/Search for SKU.yml | 115 +++ .../SKU/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 24 + ...luded collection to product assortment.yml | 94 +++ ...luded collection to product assortment.yml | 94 +++ .../Assortment/Create product assortment.yml | 98 +++ .../Assortment/Delete product assortment.yml | 87 +++ .../Get all product assortments.yml | 143 ++++ .../Get product assortment by ID.yml | 96 +++ ...ded collection from product assortment.yml | 89 +++ ...ded collection from product assortment.yml | 89 +++ .../Assortment/Update product assortment.yml | 101 +++ .../VTEX - Catalog API/Assortment/folder.yml | 4 + .../Attachment/Create attachment.yml | 117 +++ .../Attachment/Delete attachment.yml | 56 ++ .../Attachment/Get all attachments.yml | 118 +++ .../Attachment/Get attachment by ID.yml | 102 +++ .../Attachment/Update attachment.yml | 122 ++++ .../VTEX - Catalog API/Attachment/folder.yml | 4 + .../VTEX - Catalog API/Brand/Create brand.yml | 107 +++ .../VTEX - Catalog API/Brand/Delete brand.yml | 56 ++ .../Brand/Get brand and context.yml | 96 +++ .../Brand/Get brand by ID.yml | 91 +++ .../Brand/Get brand list.yml | 105 +++ .../Brand/Get paginated brand list.yml | 121 ++++ .../VTEX - Catalog API/Brand/Update brand.yml | 114 +++ .../VTEX - Catalog API/Brand/folder.yml | 4 + .../Get specifications by category ID.yml | 106 +++ ...Get specifications tree by category ID.yml | 106 +++ .../Category specification/folder.yml | 4 + .../Category/Create category.yml | 131 ++++ .../Category/Get category by ID.yml | 119 +++ .../Category/Get category tree.yml | 189 +++++ .../Category/Update category.yml | 133 ++++ .../VTEX - Catalog API/Category/folder.yml | 4 + ...roducts to collection by imported file.yml | 62 ++ .../Collection/Create collection.yml | 104 +++ .../Collection/Delete collection.yml | 58 ++ .../Get all inactive collections.yml | 83 +++ .../Collection/Get collection by ID.yml | 96 +++ .../Get products from a collection.yml | 172 +++++ .../Import collection file example.yml | 58 ++ ...ducts from collection by imported file.yml | 62 ++ .../Collection/Update collection.yml | 106 +++ .../VTEX - Catalog API/Collection/folder.yml | 4 + .../Get all commercial conditions.yml | 95 +++ .../Get commercial condition.yml | 88 +++ .../Commercial conditions/folder.yml | 4 + .../Gift list/Get gift list.yml | 121 ++++ .../VTEX - Catalog API/Gift list/folder.yml | 4 + ...te SKU attribute translation by SKU ID.yml | 67 ++ ... update SKU file translation by SKU ID.yml | 67 ++ ...te or update SKU translation by SKU ID.yml | 62 ++ ...et SKU attribute translation by SKU ID.yml | 97 +++ .../Get SKU file translation by SKU ID.yml | 99 +++ .../Get SKU translation by SKU ID.yml | 182 +++++ .../Multi-language SKU/folder.yml | 4 + ...eate or update SKU service translation.yml | 62 ++ ...or update SKU service type translation.yml | 61 ++ ...r update SKU service value translation.yml | 61 ++ ...reate or update attachment translation.yml | 61 ++ .../Get SKU service translation.yml | 94 +++ .../Get SKU service type translation.yml | 94 +++ .../Get SKU service value translation.yml | 92 +++ .../Get attachment translation.yml | 93 +++ .../folder.yml | 4 + .../Create or update brand translation.yml | 65 ++ .../Get brand translation.yml | 96 +++ .../Multi-language brand/folder.yml | 4 + .../Create or update category translation.yml | 65 ++ .../Get category translation.yml | 96 +++ .../Multi-language category/folder.yml | 4 + ...reate or update collection translation.yml | 63 ++ .../Get collection translation.yml | 94 +++ .../Multi-language collection/folder.yml | 4 + ...update specification group translation.yml | 61 ++ ...te or update specification translation.yml | 62 ++ ...update specification value translation.yml | 61 ++ .../Get specification group translation.yml | 93 +++ .../Get specification translation.yml | 94 +++ .../Get specification value translation.yml | 93 +++ .../Multi-language specification/folder.yml | 4 + ...pecification translation by product ID.yml | 68 ++ ...date product translation by product ID.yml | 67 ++ ...pecification translation by product ID.yml | 99 +++ .../Get product translation by product ID.yml | 86 +++ .../Multi-language/folder.yml | 4 + ...non-structured specification by SKU ID.yml | 56 ++ .../Delete non-structured specification.yml | 56 ++ ...Get non-structured specification by ID.yml | 91 +++ ...non-structured specification by SKU ID.yml | 91 +++ .../Non-structured specification/folder.yml | 4 + .../Get product indexed information.yml | 91 +++ .../Product indexing/folder.yml | 4 + ...sing specification name and group name.yml | 104 +++ .../Associate product specification.yml | 97 +++ .../Delete a product specification.yml | 60 ++ ...l product specifications by product ID.yml | 56 ++ ...ns and their information by product ID.yml | 99 +++ ...t product specifications by product ID.yml | 96 +++ ...te product specification by product ID.yml | 77 ++ .../Product specification/folder.yml | 4 + ...Create product with category and brand.yml | 132 ++++ .../Product/Get product and SKU IDs.yml | 154 ++++ .../Get product and its general context.yml | 110 +++ .../Product/Get product by ID.yml | 109 +++ .../Product/Get product by reference ID.yml | 108 +++ .../Get product review rate by product ID.yml | 84 +++ .../Get product's SKUs by product ID.yml | 192 +++++ .../Product/Update product.yml | 133 ++++ .../VTEX - Catalog API/Product/folder.yml | 4 + .../SKU EAN/Create SKU EAN.yml | 60 ++ .../SKU EAN/Delete SKU EAN.yml | 60 ++ .../SKU EAN/Delete all SKU EAN values.yml | 56 ++ .../SKU EAN/Get EAN by SKU ID.yml | 86 +++ .../SKU EAN/Get SKU by EAN.yml | 236 ++++++ .../VTEX - Catalog API/SKU EAN/folder.yml | 4 + .../Associate SKU attachment.yml | 90 +++ .../Associate attachments to an SKU.yml | 62 ++ ...ttachment by attachment association ID.yml | 56 ++ .../Dissociate attachments and SKUs.yml | 62 ++ .../Get SKU attachments by SKU ID.yml | 90 +++ .../SKU attachment/folder.yml | 4 + .../SKU attribute/Create SKU attribute.yml | 102 +++ .../SKU attribute/Delete SKU attribute.yml | 60 ++ .../Delete all SKU attributes.yml | 56 ++ .../SKU attribute/Get SKU attribute by ID.yml | 94 +++ .../SKU attribute/Get all SKU attributes.yml | 101 +++ .../SKU attribute/Update SKU attribute.yml | 104 +++ .../SKU attribute/folder.yml | 4 + .../SKU complement/Create SKU complement.yml | 94 +++ ...te SKU complement by SKU complement ID.yml | 56 ++ .../Get SKU complement by SKU ID.yml | 91 +++ ...et SKU complement by SKU complement ID.yml | 91 +++ ... SKU complements by complement type ID.yml | 95 +++ .../Get SKU complements by type.yml | 94 +++ .../SKU complement/folder.yml | 4 + .../Copy files from an SKU to another SKU.yml | 103 +++ .../SKU file/Create SKU file.yml | 108 +++ .../SKU file/Delete SKU image file.yml | 60 ++ .../SKU file/Delete all SKU files.yml | 56 ++ .../SKU file/Disassociate SKU file.yml | 60 ++ .../SKU file/Get SKU files.yml | 121 ++++ .../SKU file/Reorder SKU files.yml | 69 ++ .../SKU file/Update SKU file.yml | 136 ++++ .../VTEX - Catalog API/SKU file/folder.yml | 4 + .../SKU kit/Create SKU kit.yml | 94 +++ ...ete SKU kit by SKU ID or parent SKU ID.yml | 62 ++ .../SKU kit/Delete SKU kit by kit ID.yml | 56 ++ ...Get SKU kit by SKU ID or parent SKU ID.yml | 96 +++ .../SKU kit/Get SKU kit.yml | 90 +++ .../VTEX - Catalog API/SKU kit/folder.yml | 4 + .../Change notification with SKU ID.yml | 81 +++ ...ation with seller ID and seller SKU ID.yml | 73 ++ .../Get details of a seller's SKU.yml | 100 +++ .../Remove a seller's SKU binding.yml | 62 ++ .../VTEX - Catalog API/SKU seller/folder.yml | 4 + .../Associate SKU service attachment.yml | 90 +++ ...y attachment ID or SKU service type ID.yml | 62 ++ ...ciate attachment from SKU service type.yml | 56 ++ .../SKU service attachment/folder.yml | 4 + .../Create SKU service type.yml | 102 +++ .../Delete SKU service type.yml | 56 ++ .../SKU service type/Get SKU service type.yml | 94 +++ .../Update SKU service type.yml | 107 +++ .../SKU service type/folder.yml | 4 + .../Create SKU service value.yml | 94 +++ .../Delete SKU service value.yml | 56 ++ .../Get SKU service value.yml | 90 +++ .../Update SKU service value.yml | 99 +++ .../SKU service value/folder.yml | 4 + .../SKU service/Associate SKU service.yml | 98 +++ .../SKU service/Dissociate SKU service.yml | 56 ++ .../SKU service/Get SKU service.yml | 92 +++ .../SKU service/Update SKU service.yml | 103 +++ .../VTEX - Catalog API/SKU service/folder.yml | 4 + ...sing specification name and group name.yml | 103 +++ .../Associate SKU specification.yml | 97 +++ .../Delete SKU specification.yml | 60 ++ .../Delete all SKU specifications.yml | 56 ++ .../Get SKU specifications.yml | 92 +++ .../Update SKU specification.yml | 102 +++ .../SKU specification/folder.yml | 4 + .../VTEX - Catalog API/SKU/Create SKU.yml | 143 ++++ .../SKU/Get SKU ID by reference ID.yml | 84 +++ .../SKU/Get SKU and context.yml | 90 +++ .../SKU/Get SKU by alternate ID.yml | 193 +++++ .../SKU/Get SKU by reference ID.yml | 110 +++ .../SKU/Get SKU list by product ID.yml | 126 ++++ .../VTEX - Catalog API/SKU/Get SKU.yml | 113 +++ .../SKU/List all SKU IDs.yml | 102 +++ ...rieve SKU ID list by reference ID list.yml | 93 +++ .../VTEX - Catalog API/SKU/Update SKU.yml | 145 ++++ .../VTEX - Catalog API/SKU/folder.yml | 4 + .../Associate product with sales channel.yml | 60 ++ .../Sales channel/Get sales channel by ID.yml | 106 +++ .../Get sales channel by product ID.yml | 101 +++ .../Sales channel/Get sales channel list.yml | 126 ++++ .../List all SKUs in a sales channel.yml | 122 ++++ .../Remove product from sales channel.yml | 60 ++ .../Sales channel/folder.yml | 4 + .../Seller/Create seller.yml | 127 ++++ .../Seller/Get seller by ID (2).yml | 102 +++ .../Seller/Get seller by ID.yml | 102 +++ .../Seller/Get seller list.yml | 115 +++ .../Seller/Update seller.yml | 127 ++++ .../VTEX - Catalog API/Seller/folder.yml | 4 + .../Similar category/Add similar category.yml | 91 +++ .../Delete similar category.yml | 60 ++ .../Get similar categories.yml | 93 +++ .../Similar category/folder.yml | 4 + .../Create specification field value.yml | 97 +++ .../Get specification field value.yml | 92 +++ ...ation values by specification field ID.yml | 127 ++++ .../Update specification field value.yml | 90 +++ .../Specification field value/folder.yml | 4 + .../Create specification field.yml | 103 +++ .../Get specification field.yml | 105 +++ .../Update specification field.yml | 103 +++ .../Specification field/folder.yml | 4 + .../Create specification group.yml | 92 +++ .../Get specification group.yml | 89 +++ .../List specification group by category.yml | 97 +++ .../Update specification group.yml | 99 +++ .../Specification group/folder.yml | 4 + .../Create specification value.yml | 96 +++ .../Get specification value.yml | 91 +++ .../Update specification value.yml | 101 +++ .../Specification value/folder.yml | 4 + .../Specification/Create specification.yml | 116 +++ .../Get specification by specification ID.yml | 101 +++ .../Specification/Update specification.yml | 123 ++++ .../Specification/folder.yml | 4 + .../Add SKU to subcollection.yml | 95 +++ .../Associate brand to subcollection.yml | 95 +++ .../Associate category to subcollection.yml | 95 +++ .../Subcollection/Create subcollection.yml | 98 +++ .../Delete SKU from subcollection.yml | 62 ++ .../Delete brand from subcollection.yml | 62 ++ .../Delete category from subcollection.yml | 62 ++ ...ication value from subcollection by ID.yml | 56 ++ .../Subcollection/Delete subcollection.yml | 58 ++ ...ecification values by subcollection ID.yml | 103 +++ .../Get subcollection by collection ID.yml | 103 +++ .../Get subcollection by subcollection ID.yml | 93 +++ .../Reposition SKU on the subcollection.yml | 66 ++ .../Subcollection/Update subcollection.yml | 103 +++ ...ification value in subcollection by ID.yml | 94 +++ .../Subcollection/folder.yml | 4 + .../Supplier/Create supplier.yml | 104 +++ .../Supplier/Delete supplier.yml | 56 ++ .../Supplier/Update supplier.yml | 109 +++ .../VTEX - Catalog API/Supplier/folder.yml | 4 + .../VTEX - Catalog API/environments/VTEX.yml | 10 + .../VTEX - Catalog API/opencollection.yml | 38 + .../Add client preferences.yml | 194 +++++ .../Cart attachments/Add client profile.yml | 222 ++++++ .../Cart attachments/Add item attachment.yml | 111 +++ .../Add item subscription attachment.yml | 113 +++ .../Cart attachments/Add marketing data.yml | 215 ++++++ .../Add merchant context data.yml | 106 +++ .../Cart attachments/Add payment data.yml | 110 +++ ...ing address and select delivery option.yml | 136 ++++ .../Cart attachments/Attach invoice data.yml | 208 ++++++ .../Get client profile by email.yml | 153 ++++ .../Remove item attachment.yml | 103 +++ .../Remove item subscription attachment.yml | 98 +++ .../Cart attachments/folder.yml | 4 + .../Clear order form messages.yml | 96 +++ .../Create order form configuration.yml | 83 +++ .../Get order form configuration.yml | 117 +++ .../Get window to change seller.yml | 70 ++ .../Update order form configuration.yml | 83 +++ .../Update window to change seller.yml | 66 ++ .../Configuration/folder.yml | 4 + .../Custom data/Add address custom field.yml | 103 +++ .../Custom data/Add item custom field.yml | 103 +++ .../Custom data/Add order custom field.yml | 99 +++ .../Custom data/Batch add custom fields.yml | 122 ++++ .../Custom data/Remove item custom field.yml | 99 +++ .../Remove single custom field value.yml | 101 +++ .../Set multiple custom field values.yml | 105 +++ .../Set single custom field value.yml | 106 +++ .../Custom data/folder.yml | 4 + .../Get address by postal code.yml | 98 +++ .../List pickup points by location.yml | 168 +++++ .../Fulfillment/folder.yml | 4 + .../Place order from an existing cart.yml | 101 +++ .../Order placement/Place order.yml | 191 +++++ .../Order placement/Process order.yml | 67 ++ .../Order placement/folder.yml | 4 + .../Get sellers by region or address.yml | 134 ++++ .../VTEX - Checkout API/Region/folder.yml | 4 + .../Shopping cart/Add cart items.yml | 111 +++ .../Shopping cart/Add coupons to the cart.yml | 103 +++ .../Shopping cart/Cart installments.yml | 160 +++++ .../Shopping cart/Cart simulation.yml | 121 ++++ .../Change price of an SKU in a cart.yml | 111 +++ ...elete manual price of an SKU in a cart.yml | 101 +++ .../Get cart information by ID.yml | 97 +++ .../Get current or create a new cart.yml | 205 ++++++ .../Shopping cart/Handle cart items.yml | 125 ++++ .../Ignore profile data on checkout.yml | 208 ++++++ .../Remove all items from shopping cart.yml | 96 +++ ...e all personal data from shopping cart.yml | 75 ++ .../Shopping cart/Split a cart item.yml | 116 +++ .../Shopping cart/Update cart items.yml | 123 ++++ .../Shopping cart/folder.yml | 4 + .../VTEX - Checkout API/environments/VTEX.yml | 10 + .../VTEX - Checkout API/opencollection.yml | 37 + .../Create a new checkout configuration.yml | 130 ++++ .../Delete checkout configuration.yml | 58 ++ .../Get checkout configuration.yml | 106 +++ .../Update a checkout configuration.yml | 130 ++++ .../Configuration/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 27 + .../Authentication/Start client login.yml | 45 ++ .../Authentication/Validate client login.yml | 102 +++ .../Authentication/folder.yml | 4 + .../Card token vault/Save card token.yml | 136 ++++ .../Card token vault/folder.yml | 4 + .../Add client profile data.yml | 84 +++ .../Checkout operations/Add items to cart.yml | 90 +++ .../Checkout operations/Add payment data.yml | 101 +++ .../Checkout operations/Place order.yml | 88 +++ .../Checkout operations/folder.yml | 4 + .../Payment gateway/Get card.yml | 103 +++ .../Get transaction details.yml | 83 +++ .../Payment gateway/List payments.yml | 94 +++ .../Payment gateway/folder.yml | 4 + .../Profile management/Create profile.yml | 115 +++ .../Profile management/Delete profile.yml | 61 ++ .../Profile management/Get profile cards.yml | 78 ++ .../Profile management/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 24 + .../Create custom field settings.yml | 104 +++ .../Delete custom field setting.yml | 65 ++ .../Get custom field settings.yml | 131 ++++ .../Update custom field settings.yml | 104 +++ .../Custom field settings/folder.yml | 4 + .../Create custom field value.yml | 102 +++ .../Delete custom field value.yml | 69 ++ .../Get custom field value.yml | 122 ++++ .../Search custom field values.yml | 128 ++++ .../Update custom field value.yml | 79 ++ .../Custom field values/folder.yml | 4 + .../environments/VTEX.yml | 14 + .../opencollection.yml | 42 ++ .../Account/Add an account holder.yml | 100 +++ .../Account/Cancel a pre-authorization.yml | 63 ++ .../Change credit limit of an account.yml | 104 +++ .../Change tolerance of an account.yml | 104 +++ .../Account/Close an account.yml | 108 +++ .../Account/Create a pre-authorization.yml | 103 +++ .../Account/Create or update settlement.yml | 102 +++ .../Decrease balance of an account.yml | 95 +++ .../Account/Delete an account holder.yml | 91 +++ .../Account/Get account statements.yml | 130 ++++ .../Account/Open an account.yml | 108 +++ ...rtially or totally refund a settlement.yml | 95 +++ .../Account/Retrieve an account by ID.yml | 100 +++ .../Account/Search all accounts.yml | 197 +++++ .../Account/Update a pre-authorization.yml | 107 +++ .../Account/Update account information.yml | 110 +++ .../Account/folder.yml | 4 + .../Invoices/Cancel invoice.yml | 61 ++ .../Invoices/Change invoice.yml | 74 ++ .../Invoices/Mark an invoice as paid.yml | 107 +++ .../Invoices/Postpone an invoice.yml | 71 ++ .../Invoices/Retrieve invoice by ID.yml | 105 +++ ...invoices by Customer Credit account ID.yml | 128 ++++ .../Invoices/Search all invoices.yml | 222 ++++++ .../Invoices/folder.yml | 4 + .../Create or change store configuration.yml | 150 ++++ .../Retrieve store configuration.yml | 113 +++ .../Store Configuration/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 69 ++ .../Erase customer data.yml | 132 ++++ .../Data Subject Rights/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 30 + .../Default values/Create default values.yml | 125 ++++ .../Default values/Delete default values.yml | 58 ++ .../Default values/Get default values.yml | 128 ++++ .../Default values/Update default values.yml | 103 +++ .../Default values/folder.yml | 4 + .../environments/VTEX.yml | 14 + .../opencollection.yml | 37 + .../Delivery Promise/folder.yml | 8 + ...promises for an external seller's item.yml | 108 +++ .../Update external product availability.yml | 110 +++ .../Delivery promise (2)/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 46 ++ .../Get delivery suggestions.yml | 174 +++++ .../Search delivery suggestions.yml | 175 +++++ .../Delivery suggestions/folder.yml | 4 + .../Search delivery zones.yml | 107 +++ .../Search pickup points.yml | 265 +++++++ .../Logistics shipping/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 29 + .../Addresses/Create address.yml | 108 +++ .../Addresses/Delete address by ID.yml | 65 ++ .../Addresses/Get address by ID.yml | 123 ++++ .../Addresses/Update address by ID.yml | 84 +++ .../Addresses/folder.yml | 8 + .../Contracts/Create contract.yml | 143 ++++ .../Contracts/Delete contract by ID.yml | 70 ++ .../Contracts/Get contract by ID.yml | 148 ++++ .../Contracts/Update contract by ID.yml | 85 +++ .../Contracts/folder.yml | 8 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 48 ++ .../Calculate promotions.yml | 199 ++++++ .../Notify promotion usage.yml | 63 ++ .../External promotions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 76 ++ ...e or update a gift card provider by ID.yml | 107 +++ .../Delete a gift card provider by ID.yml | 56 ++ .../Get a gift card provider by ID.yml | 94 +++ .../Provider/List all gift card providers.yml | 105 +++ .../Provider/folder.yml | 4 + .../Cancel a gift card transaction.yml | 103 +++ ...te a gift card at a gift card provider.yml | 109 +++ .../Create a gift card transaction.yml | 169 +++++ ...t card from a gift card provider by ID.yml | 100 +++ ... a gift card from a gift card provider.yml | 134 ++++ ... a gift card transaction authorization.yml | 96 +++ .../Get a gift card transaction by ID.yml | 107 +++ ...l gift card transactions cancellations.yml | 103 +++ ...all gift card transactions settlements.yml | 103 +++ .../List all gift card transactions.yml | 103 +++ .../Settle a gift card transaction.yml | 105 +++ .../Transaction/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 58 ++ .../Gift Card/Create a gift card.yml | 116 +++ .../Gift Card/Get a gift card by ID.yml | 103 +++ .../Gift Card/List all gift cards.yml | 162 +++++ .../VTEX - Giftcard API/Gift Card/folder.yml | 4 + .../Cancel a gift card transaction.yml | 111 +++ .../Create a gift card transaction.yml | 184 +++++ ... a gift card transaction authorization.yml | 100 +++ .../Get a gift card transaction by ID.yml | 111 +++ ...l gift card transactions cancellations.yml | 107 +++ ...all gift card transactions settlements.yml | 107 +++ .../List all gift card transactions.yml | 111 +++ .../Settle a gift card transaction.yml | 107 +++ .../Transactions/folder.yml | 4 + .../VTEX - Giftcard API/environments/VTEX.yml | 10 + .../VTEX - Giftcard API/opencollection.yml | 75 ++ .../Gift Cards/Create a gift card.yml | 98 +++ .../Gift Cards/Get a gift card by ID.yml | 92 +++ .../Gift Cards/List all gift cards.yml | 131 ++++ .../Gift Cards/folder.yml | 4 + .../Cancel a gift card transaction.yml | 97 +++ .../Create a gift card transaction.yml | 171 +++++ ... a gift card transaction authorization.yml | 86 +++ .../Get a gift card transaction by ID.yml | 96 +++ ...l gift card transactions cancellations.yml | 88 +++ ...all gift card transactions settlements.yml | 93 +++ .../List all gift card transactions.yml | 93 +++ .../Settle a gift card transaction.yml | 93 +++ .../Transactions/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 47 ++ .../Pages/Get CMS page.yml | 191 +++++ .../Get all CMS pages by content type.yml | 178 +++++ .../Pages/Get all content types.yml | 81 +++ .../VTEX - Headless CMS API/Pages/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 24 + ... attributes similar to the search term.yml | 108 +++ ...ested terms similar to the search term.yml | 100 +++ ...Get list of the 10 most searched terms.yml | 121 ++++ .../Autocomplete/folder.yml | 4 + ...oint availability for Delivery Promise.yml | 216 ++++++ .../Delivery Promise/folder.yml | 4 + .../Get product.yml | 325 +++++++++ .../Product details page (PDP)/folder.yml | 4 + ...mpt of correction of a misspelled term.yml | 90 +++ ...t list of banners registered for query.yml | 94 +++ .../List filters for a search.yml | 276 +++++++ .../Product list page/Search products.yml | 408 +++++++++++ .../Product list page/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 26 + ... attributes similar to the search term.yml | 120 ++++ ...ested terms similar to the search term.yml | 104 +++ ...Get list of the 10 most searched terms.yml | 119 +++ .../Autocomplete/folder.yml | 4 + ...oint availability for Delivery Promise.yml | 231 ++++++ .../Delivery Promise/folder.yml | 4 + ...mpt of correction of a misspelled term.yml | 86 +++ ...t list of banners registered for query.yml | 92 +++ .../Get list of products for a query.yml | 146 ++++ ... the possible facets for a given query.yml | 260 +++++++ .../Product list page/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 30 + .../Events/Save events.yml | 62 ++ .../Events/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 172 +++++ ...bsites internet communication protocol.yml | 86 +++ ...specific website comunication protocol.yml | 90 +++ .../Change URI Schema/folder.yml | 8 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 32 + .../API keys/Create new API Key.yml | 91 +++ .../API keys/Get API keys from account.yml | 99 +++ .../API keys/Update API Key.yml | 66 ++ .../API keys/folder.yml | 4 + .../Account/Get information about account.yml | 77 ++ .../Account/folder.yml | 4 + .../Roles/Add roles to user or API Key.yml | 74 ++ .../Roles/Get list of roles.yml | 143 ++++ .../Roles/Get roles by user ID or API Key.yml | 93 +++ .../Remove role from user or API Key.yml | 74 ++ .../Roles/folder.yml | 4 + .../Stores/Get stores.yml | 93 +++ .../Stores/folder.yml | 4 + .../Users/Create user.yml | 89 +++ .../Users/Delete user.yml | 63 ++ .../Users/Get list of users.yml | 119 +++ .../Users/Get user information by user ID.yml | 96 +++ .../Get user information by user email.yml | 90 +++ .../Users/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 31 + .../Confirm batch inventory.yml | 58 ++ .../Create batch inventory job.yml | 71 ++ .../Get batch inventory errors.yml | 114 +++ .../Get batch inventory status.yml | 89 +++ .../Batch operations/folder.yml | 4 + .../Docks/Activate dock.yml | 66 ++ .../Docks/Create or update dock.yml | 120 ++++ .../Docks/Deactivate dock.yml | 66 ++ .../Docks/Delete dock.yml | 91 +++ .../Docks/List all docks.yml | 236 ++++++ .../Docks/List dock by ID.yml | 160 +++++ .../VTEX - Logistics API/Docks/folder.yml | 4 + .../Create or update freight values.yml | 83 +++ .../Freight values/List freight values.yml | 134 ++++ .../Freight values/folder.yml | 4 + .../Holidays/Create or update holiday.yml | 71 ++ .../Holidays/Delete holiday.yml | 64 ++ .../Holidays/List all holidays.yml | 62 ++ .../Holidays/List holiday by ID.yml | 67 ++ .../VTEX - Logistics API/Holidays/folder.yml | 4 + .../List inventory by SKU per warehouse.yml | 123 ++++ .../Inventory/List inventory by SKU.yml | 132 ++++ .../List inventory per dock and warehouse.yml | 127 ++++ .../Inventory/List inventory per dock.yml | 143 ++++ ...inventory with dispatched reservations.yml | 116 +++ .../Inventory/List supply lots.yml | 128 ++++ .../Inventory/Save supply lot.yml | 89 +++ .../Inventory/Transfer supply lot.yml | 81 +++ .../Update inventory by SKU and warehouse.yml | 91 +++ ...ventory lead time by SKU and warehouse.yml | 83 +++ ...nventory quantity by SKU and warehouse.yml | 85 +++ .../VTEX - Logistics API/Inventory/folder.yml | 4 + .../Create or update pickup point.yml | 210 ++++++ .../Pickup points/Delete pickup point.yml | 69 ++ .../List paged pickup points.yml | 106 +++ .../Pickup points/List pickup point by ID.yml | 173 +++++ .../Pickup points/List pickup points.yml | 246 +++++++ .../Pickup points/folder.yml | 4 + .../Polygons/Create or update polygon.yml | 102 +++ .../Polygons/Delete polygon.yml | 94 +++ .../Polygons/List paged polygons.yml | 113 +++ .../Polygons/List polygon by ID.yml | 125 ++++ .../VTEX - Logistics API/Polygons/folder.yml | 4 + .../Acknowledgment reservation.yml | 61 ++ .../Reservations/Cancel reservation.yml | 61 ++ .../Reservations/Confirm reservation.yml | 61 ++ .../Reservations/Create reservation.yml | 199 ++++++ .../Reservations/List reservation by ID.yml | 176 +++++ .../List reservation by warehouse and SKU.yml | 68 ++ .../Reservations/folder.yml | 4 + .../SLA/Calculate SLA.yml | 143 ++++ .../VTEX - Logistics API/SLA/folder.yml | 4 + .../Add blocked delivery windows.yml | 98 +++ ...t capacity reservation usage by window.yml | 97 +++ .../Remove blocked delivery windows.yml | 98 +++ .../Retrieve blocked delivery windows.yml | 101 +++ ...ch capacity reservations in time range.yml | 105 +++ .../Scheduled delivery/folder.yml | 4 + .../Create shipping policy.yml | 141 ++++ .../Delete shipping policy by ID.yml | 66 ++ .../List shipping policies.yml | 101 +++ .../Retrieve shipping policy by ID.yml | 95 +++ .../Update shipping policy by ID.yml | 111 +++ .../Shipping policies/folder.yml | 4 + .../Warehouses/Activate warehouse.yml | 61 ++ .../Warehouses/Create or update warehouse.yml | 75 ++ .../Warehouses/Deactivate warehouse.yml | 61 ++ .../Warehouses/List all warehouses.yml | 124 ++++ .../Warehouses/List warehouse by ID.yml | 109 +++ .../Warehouses/Remove warehouse.yml | 61 ++ .../Warehouses/folder.yml | 4 + .../environments/VTEX.yml | 20 + .../VTEX - Logistics API/opencollection.yml | 32 + .../Offer Management/Activate Feed.yml | 98 +++ .../Offer Management/Close Interaction.yml | 70 ++ .../Offer Management/Create Channel.yml | 99 +++ .../Offer Management/Create Log.yml | 134 ++++ .../Offer Management/Deactivate Feed.yml | 64 ++ .../Get Error Code data by errorCodeId.yml | 79 ++ .../Offer Management/Get Feed by feedId.yml | 92 +++ .../Get Interaction Data by interactionId.yml | 107 +++ .../Get Log Data by logId.yml | 115 +++ .../Offer Management/List Feeds.yml | 106 +++ .../Offer Management/Open Interaction.yml | 112 +++ .../Offer Management/Search Errors.yml | 87 +++ .../Search Interactions and their Logs.yml | 95 +++ .../Offer Management/Update Feed.yml | 69 ++ .../Offer Management/folder.yml | 4 + .../environments/VTEX.yml | 32 + .../opencollection.yml | 102 +++ .../Get SKU suggestion by ID.yml | 80 +++ .../Get all SKU suggestions.yml | 110 +++ .../Get suggestions/folder.yml | 8 + .../Get versions/Get all versions.yml | 71 ++ .../Get versions/Get version by ID.yml | 73 ++ .../Get versions/folder.yml | 8 + .../Delete SKU suggestion.yml | 67 ++ .../Send SKU suggestion.yml | 122 ++++ .../Manage suggestions/folder.yml | 8 + .../Match multiple received SKUs.yml | 162 +++++ .../Match received SKUs individually.yml | 164 +++++ .../Match received SKUs/folder.yml | 8 + ... specifications to marketplace catalog.yml | 76 ++ .../folder.yml | 4 + ...e autoApprove in marketplace's account.yml | 96 +++ ...ivate autoApprove setting for a seller.yml | 68 ++ .../Get account's approval settings.yml | 122 ++++ .../Get account's matcher settings.yml | 111 +++ ...autoApprove status in account settings.yml | 94 +++ .../Get seller's approval settings.yml | 122 ++++ .../Save account's approval settings.yml | 142 ++++ .../Save seller's approval settings.yml | 72 ++ .../SKU approval settings/folder.yml | 4 + .../environments/VTEX.yml | 14 + .../opencollection.yml | 95 +++ .../Affiliates/Delete affiliate by ID.yml | 70 ++ .../Affiliates/Get affiliate by ID.yml | 105 +++ .../Affiliates/List affiliates.yml | 129 ++++ .../Affiliates/Update affiliate by ID.yml | 84 +++ .../Affiliates/folder.yml | 4 + .../Get matched offers list.yml | 172 +++++ .../Get matched offers' data by SKU ID.yml | 147 ++++ ...Get matched offers' data by product ID.yml | 155 ++++ .../Matched Offers/folder.yml | 4 + ...Notify marketplace of inventory update.yml | 76 ++ .../Notify marketplace of price update.yml | 76 ++ .../Notification/folder.yml | 4 + .../Get sales channel mapping data.yml | 105 +++ .../Upsert sales channel mapping.yml | 118 +++ .../Sales Channel Mapping/folder.yml | 4 + .../Get seller commissions by category ID.yml | 111 +++ .../List seller commissions by seller ID.yml | 109 +++ ...move seller commissions by category ID.yml | 78 ++ .../Upsert seller commissions in bulk.yml | 89 +++ .../Seller Commissions/folder.yml | 4 + .../Seller Invite/Accept seller lead.yml | 102 +++ .../Seller Invite/Create seller from lead.yml | 84 +++ .../Seller Invite/Delete seller lead.yml | 68 ++ .../Get seller lead's data by ID.yml | 87 +++ .../Seller Invite/Invite seller lead.yml | 126 ++++ .../Seller Invite/List seller leads.yml | 104 +++ .../Resend seller lead invite.yml | 77 ++ .../Seller Invite/folder.yml | 4 + .../Sellers/Configure seller account.yml | 130 ++++ .../Sellers/Get seller data by ID.yml | 73 ++ .../Sellers/List sellers.yml | 119 +++ .../Sellers/Update seller by seller ID.yml | 83 +++ .../Sellers/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 115 +++ .../Full update connector.yml | 59 ++ .../List all channels.yml | 88 +++ .../List all connectors.yml | 170 +++++ .../Partial update connector.yml | 51 ++ .../Register connector.yml | 155 ++++ .../External Marketplace/Remove connector.yml | 43 ++ .../External Marketplace/Retrieve channel.yml | 61 ++ .../Retrieve connector.yml | 82 +++ .../Send category mapping to VTEX Mapper.yml | 445 ++++++++++++ .../Upsert merchant connection.yml | 50 ++ .../VTEX mapper registration.yml | 72 ++ .../External Marketplace/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 58 ++ ...thorize dispatch for fulfillment order.yml | 109 +++ ...ment simulation - external marketplace.yml | 141 ++++ .../New Order Integration.yml | 201 ++++++ .../Place fulfillment order.yml | 368 ++++++++++ .../Update Order Status.yml | 103 +++ .../External Marketplace/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 58 ++ .../External Seller/Authorize fulfillment.yml | 123 ++++ ...lfillment simulation - external seller.yml | 224 ++++++ .../Marketplace order cancellation.yml | 120 ++++ .../External Seller/Order placement.yml | 315 ++++++++ .../External Seller/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 58 ++ .../Cancel order in marketplace.yml | 104 +++ ...Send agreement for order modifications.yml | 126 ++++ .../External seller/Send invoice.yml | 114 +++ .../Send tracking information.yml | 111 +++ .../Update tracking status.yml | 122 ++++ .../External seller/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 59 ++ .../Validate document by clusters.yml | 129 ++++ .../Clusters/folder.yml | 4 + ...th custom ID or update entire document.yml | 92 +++ .../Documents/Create new document.yml | 113 +++ .../Documents/Create partial document.yml | 104 +++ .../Documents/Delete document.yml | 66 ++ .../Documents/Get document.yml | 109 +++ .../Documents/Update partial document.yml | 85 +++ .../Documents/folder.yml | 4 + .../Indices/Create index.yml | 62 ++ .../Indices/Delete index by name.yml | 63 ++ .../Indices/Get index by name.yml | 94 +++ .../Indices/Get indices.yml | 93 +++ .../Indices/folder.yml | 4 + .../Schemas/Delete schema by name.yml | 62 ++ .../Schemas/Get schema by name.yml | 96 +++ .../Schemas/Get schemas.yml | 97 +++ .../Schemas/Save schema by name.yml | 125 ++++ .../Schemas/folder.yml | 4 + .../Scroll/Scroll documents.yml | 160 +++++ .../Scroll/folder.yml | 4 + .../Search/Search documents.yml | 141 ++++ .../Search/folder.yml | 4 + .../Versions/Get version.yml | 112 +++ .../Versions/List versions.yml | 124 ++++ .../Versions/Update version.yml | 99 +++ .../Versions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 59 ++ .../Addresses/Create new customer address.yml | 110 +++ .../Addresses/Delete address by ID.yml | 62 ++ .../Addresses/Get address by ID.yml | 120 ++++ .../Addresses/Update address by ID.yml | 116 +++ .../Addresses/folder.yml | 4 + .../Attachments/Retrieve attachment.yml | 83 +++ .../Attachments/Save attachment.yml | 80 +++ .../Attachments/folder.yml | 4 + .../Validate document by clusters.yml | 86 +++ .../Clusters/folder.yml | 4 + .../Create new customer profile.yml | 104 +++ .../Delete customer profile.yml | 62 ++ .../Update customer profile.yml | 102 +++ .../Customer profiles/folder.yml | 4 + .../Get data entity structure.yml | 83 +++ .../Data entities/List data entities.yml | 99 +++ .../Data entities/folder.yml | 4 + ...th custom ID or update entire document.yml | 116 +++ .../Documents/Create new document.yml | 141 ++++ .../Documents/Create partial document.yml | 99 +++ .../Documents/Delete document.yml | 66 ++ .../Documents/Get document.yml | 101 +++ .../Documents/Update partial document.yml | 75 ++ .../Documents/folder.yml | 4 + .../Score/Delete score by field.yml | 76 ++ .../Score/Update score by field.yml | 79 ++ .../Score/Update scores.yml | 84 +++ .../Score/folder.yml | 4 + .../Scroll/Scroll documents.yml | 163 +++++ .../Scroll/folder.yml | 4 + .../Search/Search documents.yml | 139 ++++ .../Search/folder.yml | 4 + .../Versions/Get version.yml | 104 +++ .../Versions/List versions.yml | 104 +++ .../Versions/Update version.yml | 97 +++ .../Versions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 24 + .../DKIM configuration/Generate DKIM keys.yml | 91 +++ .../DKIM configuration/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 28 + .../Configure location capacity.yml | 140 ++++ .../Capacity configuration/folder.yml | 4 + .../List location capacities.yml | 111 +++ .../Capacity details/folder.yml | 4 + .../Get locations capacities by account.yml | 90 +++ .../Capacity/folder.yml | 4 + .../Update location status.yml | 114 +++ .../Location status/folder.yml | 4 + .../Locations/List locations.yml | 118 +++ .../Locations/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 42 ++ .../Invoice/Order invoice notification.yml | 129 ++++ .../Invoice/folder.yml | 4 + .../Orders/Cancel order.yml | 106 +++ .../Orders/Get order.yml | 105 +++ .../Orders/List orders.yml | 129 ++++ .../Orders/Start handling order.yml | 69 ++ .../Orders/folder.yml | 4 + .../Payment/Send payment notification.yml | 69 ++ .../Payment/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 43 ++ .../Invoice/Order invoice notification.yml | 129 ++++ .../Invoice/folder.yml | 4 + .../Orders/Cancel order.yml | 106 +++ .../Orders/Get order.yml | 105 +++ .../Orders/List orders.yml | 129 ++++ .../Orders/Start handling order.yml | 69 ++ .../Orders/folder.yml | 4 + .../Payment/Send payment notification.yml | 69 ++ .../Payment/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 26 + .../Get window to change seller.yml | 70 ++ .../Update window to change seller.yml | 48 ++ .../Change seller/folder.yml | 4 + .../Retrieve order conversation.yml | 82 +++ .../VTEX - Orders API/Conversation/folder.yml | 4 + .../Get feed order status.yml | 44 ++ .../Feed v2 (deprecated)/folder.yml | 4 + .../Feed v3/Commit feed items.yml | 47 ++ .../Create or update feed configuration.yml | 69 ++ .../Feed v3/Delete feed configuration.yml | 52 ++ .../Feed v3/Get feed configuration.yml | 96 +++ .../Feed v3/Retrieve feed items.yml | 87 +++ .../Feed v3/Test JSONata expression.yml | 80 +++ .../VTEX - Orders API/Feed v3/folder.yml | 4 + .../Invoice/Order invoice notification.yml | 154 ++++ ...partial invoice (send tracking number).yml | 109 +++ .../VTEX - Orders API/Invoice/folder.yml | 4 + .../Create or update hook configuration.yml | 109 +++ .../Order hook/Delete hook configuration.yml | 42 ++ .../Order hook/Get hook configuration.yml | 72 ++ .../VTEX - Orders API/Order hook/folder.yml | 4 + .../Cancel order modifications.yml | 85 +++ .../Create order modifications.yml | 422 +++++++++++ .../Get Order modifications settings.yml | 123 ++++ .../Get order modifications details.yml | 117 +++ .../Get order modifications history.yml | 103 +++ .../Get order modifications summary.yml | 81 +++ .../Preview order modifications.yml | 222 ++++++ .../Retry order modifications.yml | 177 +++++ .../Update Order modifications settings.yml | 153 ++++ .../Order modifications/folder.yml | 4 + .../Orders/Add log in orders.yml | 63 ++ .../VTEX - Orders API/Orders/Cancel order.yml | 117 +++ .../VTEX - Orders API/Orders/Get order.yml | 98 +++ .../Orders/Get orders by order group ID.yml | 96 +++ .../VTEX - Orders API/Orders/List orders.yml | 213 ++++++ .../Register modifications on order.yml | 146 ++++ .../Orders/Start handling order.yml | 69 ++ .../VTEX - Orders API/Orders/folder.yml | 4 + .../Payment/Retrieve payment transaction.yml | 128 ++++ .../Payment/Send payment notification.yml | 65 ++ .../VTEX - Orders API/Payment/folder.yml | 4 + .../Tracking/Update order tracking status.yml | 122 ++++ .../VTEX - Orders API/Tracking/folder.yml | 4 + .../Retrieve user order details.yml | 139 ++++ .../User orders/Retrieve user's orders.yml | 149 ++++ .../VTEX - Orders API/User orders/folder.yml | 4 + .../VTEX - Orders API/environments/VTEX.yml | 12 + .../VTEX - Orders API/opencollection.yml | 106 +++ .../Scopes/Create organization unit scope.yml | 108 +++ ...lete all scopes from organization unit.yml | 96 +++ .../Scopes/Delete organization unit scope.yml | 96 +++ .../Scopes/Get organization unit scopes.yml | 98 +++ ...ve values from organization unit scope.yml | 107 +++ .../Scopes/Update organization unit scope.yml | 108 +++ .../Scopes/folder.yml | 4 + .../Units/Add user to organization unit.yml | 104 +++ .../Units/Create organization unit.yml | 100 +++ .../Units/Delete organization unit.yml | 70 ++ ...ll organization units with scope value.yml | 101 +++ .../Get all children organization units.yml | 112 +++ .../Units/Get organization unit.yml | 96 +++ .../Units/Get root organization units.yml | 102 +++ .../List users from organization unit.yml | 103 +++ .../Units/Move organization unit.yml | 102 +++ .../Remove users from organization unit.yml | 68 ++ .../Units/Rename organization unit.yml | 100 +++ .../Units/Search organization units.yml | 118 +++ .../Units/folder.yml | 4 + .../Users/Get user scopes.yml | 102 +++ .../Users/Get user's organization unit.yml | 96 +++ .../Users/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 32 + .../Evaluate payment policies.yml | 143 ++++ .../Payment policy evaluation/folder.yml | 4 + .../Create policy rule.yml | 151 ++++ .../Delete policy rule.yml | 65 ++ .../Get policy rule by ID.yml | 120 ++++ .../List policy rules.yml | 118 +++ .../Update policy rule.yml | 155 ++++ .../Payment policy rules/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 42 ++ .../Create authorization token.yml | 93 +++ .../Configuration Flow/Get credentials.yml | 98 +++ .../Provider authentication.yml | 84 +++ .../Configuration Flow/folder.yml | 4 + .../Payment Flow/Cancel payment.yml | 133 ++++ .../Payment Flow/Create payment.yml | 281 ++++++++ .../Payment Flow/Inbound request (BETA).yml | 144 ++++ .../List Payment Provider Manifest.yml | 175 +++++ .../Payment Flow/Refund payment.yml | 150 ++++ .../Payment Flow/Settle payment.yml | 149 ++++ .../Payment Flow/folder.yml | 4 + .../environments/VTEX.yml | 18 + .../opencollection.yml | 69 ++ .../Delete payment rule by ID.yml | 60 ++ .../Configuration/Get affiliation by ID.yml | 146 ++++ .../Configuration/Get card data.yml | 124 ++++ .../Configuration/Get payment rule by ID.yml | 175 +++++ .../Insert a new payment rule.yml | 239 +++++++ .../Configuration/Insert new affiliation.yml | 192 +++++ .../Configuration/List all affiliations.yml | 81 +++ .../List all available payment methods.yml | 87 +++ .../Configuration/List all payment rules.yml | 81 +++ .../Update affiliation by ID.yml | 208 ++++++ .../Update payment rule by ID.yml | 238 ++++++ .../Configuration/folder.yml | 4 + .../Installments/Get installments options.yml | 202 ++++++ .../Installments/folder.yml | 4 + ... with payment ID, date, and value paid.yml | 72 ++ ...d payment notification with payment ID.yml | 65 ++ .../Payment notification/folder.yml | 4 + .../Cancel the transaction.yml | 105 +++ .../Refund the transaction.yml | 132 ++++ .../Settle the transaction.yml | 108 +++ .../Transaction Flow/folder.yml | 4 + .../Authorize new transaction.yml | 112 +++ .../Get payment details.yml | 90 +++ .../Get transaction details.yml | 88 +++ .../Get transaction settlement details.yml | 116 +++ .../Send additional data.yml | 73 ++ .../Send payments information.yml | 176 +++++ .../Start a new transaction.yml | 171 +++++ .../Update additional data (optional).yml | 73 ++ .../Transaction Process/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 61 ++ .../Authentication/Generate JWT token.yml | 65 ++ .../Authentication/folder.yml | 4 + .../Facilities/Get facility by ID.yml | 82 +++ .../Facilities/folder.yml | 4 + .../Orders/Get order by ID.yml | 63 ++ .../Orders/Set order delivery.yml | 86 +++ .../Orders/folder.yml | 4 + .../Shipments/Get shipment by shipment ID.yml | 180 +++++ .../Shipments/List shipments by order ID.yml | 84 +++ .../Shipments/folder.yml | 4 + .../Worksheets/Get worksheet by ID.yml | 59 ++ .../Worksheets/Get worksheets by order ID.yml | 104 +++ .../Worksheets/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 71 ++ .../Update items of the order.yml | 106 +++ .../Update order deadline.yml | 121 ++++ .../environments/VTEX.yml | 10 + .../opencollection.yml | 29 + .../Authentication/Create JWT token.yml | 51 ++ .../Authentication/folder.yml | 4 + .../Carriers/Calculate rates.yml | 173 +++++ .../Carriers/List carriers.yml | 120 ++++ .../Carriers/folder.yml | 4 + .../Service integration/Create service.yml | 209 ++++++ .../Service integration/folder.yml | 8 + .../Cancel ongoing service.yml | 67 ++ .../Shipping updates/Cancel service.yml | 107 +++ .../Shipping updates/Create evidence.yml | 83 +++ .../Shipping updates/Create label.yml | 75 ++ .../Shipping updates/Create notes.yml | 83 +++ .../Create on hold service.yml | 67 ++ .../Shipping updates/Get service.yml | 52 ++ .../Pause and resume service.yml | 109 +++ .../Shipping updates/Update service.yml | 94 +++ .../Shipping updates/folder.yml | 8 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 37 + .../Bin locations/Create bin location.yml | 76 ++ .../Delete all bin locations.yml | 92 +++ .../Bin locations/Delete bin location.yml | 65 ++ .../Bin locations/Get bin location.yml | 70 ++ .../Bin locations/List bin locations.yml | 80 +++ .../Bin locations/Update bin location.yml | 76 ++ .../Bin locations/folder.yml | 4 + .../Order changes/Update order deadline.yml | 119 +++ .../Order changes/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 45 ++ .../Authentication/Create JWT token.yml | 52 ++ .../Authentication/folder.yml | 4 + .../Service integration/Create service.yml | 50 ++ .../Service integration/folder.yml | 8 + .../Shipping updates/Cancel service.yml | 67 ++ .../Shipping updates/Create evidence.yml | 83 +++ .../Shipping updates/Create label.yml | 75 ++ .../Shipping updates/Create notes.yml | 83 +++ .../Create on hold service.yml | 67 ++ .../Shipping updates/Get a service.yml | 52 ++ .../Shipping updates/Update service.yml | 94 +++ .../Shipping updates/folder.yml | 8 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 31 + .../Policy/Create policy.yml | 163 +++++ .../Policy/Delete policy by ID.yml | 64 ++ .../Policy/Evaluate policies.yml | 109 +++ .../Policy/Get policy by ID.yml | 137 ++++ .../Policy/Get policy list.yml | 133 ++++ .../Policy/Update policy.yml | 167 +++++ .../Policy/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 31 + .../Price Tables/Create price table.yml | 57 ++ .../Get all price tables and their rules.yml | 90 +++ .../Get rules for a price table.yml | 75 ++ .../Price Tables/List price tables.yml | 59 ++ .../Update rules for a price table.yml | 86 +++ .../Price Tables/folder.yml | 4 + ...r update base price or fixed price (2).yml | 75 ++ ...te or update base price or fixed price.yml | 80 +++ ...rices on a price table or trade policy.yml | 83 +++ ...rices on a price table or trade policy.yml | 60 ++ ...ce all base and fixed prices of an SKU.yml | 56 ++ ...d price by price table or trade policy.yml | 81 +++ ...t computed prices for all price tables.yml | 95 +++ ...rices on a price table or trade policy.yml | 106 +++ .../Get fixed prices.yml | 111 +++ .../Get price by SKU ID.yml | 148 ++++ .../Prices and Fixed Prices/folder.yml | 4 + .../Get pricing configuration.yml | 74 ++ .../Get pricing v2 status.yml | 55 ++ .../Pricing Configuration/folder.yml | 4 + .../VTEX - Pricing API/environments/VTEX.yml | 8 + .../VTEX - Pricing API/opencollection.yml | 94 +++ .../Configure external price source.yml | 58 ++ .../Pricing Hub Prices/Retrieve prices.yml | 123 ++++ .../Pricing Hub Prices/folder.yml | 4 + .../VTEX - Pricing Hub/environments/VTEX.yml | 8 + .../VTEX - Pricing Hub/opencollection.yml | 52 ++ .../Addresses/Create client address.yml | 134 ++++ .../Addresses/Delete address.yml | 79 ++ .../Addresses/Get address by version.yml | 132 ++++ .../Addresses/Get address.yml | 124 ++++ .../Addresses/Get client addresses.yml | 122 ++++ .../Get unmasked address by version.yml | 129 ++++ .../Addresses/Get unmasked address.yml | 125 ++++ .../Get unmasked client addresses.yml | 119 +++ .../Addresses/Update client address.yml | 135 ++++ .../Addresses/folder.yml | 4 + .../Profiles/Create client profile.yml | 129 ++++ .../Profiles/Delete client profile.yml | 73 ++ .../Profiles/Get profile by version.yml | 122 ++++ .../Profiles/Get profile.yml | 123 ++++ .../Get unmasked profile by version.yml | 123 ++++ .../Profiles/Get unmasked profile.yml | 123 ++++ .../Profiles/Update client profile.yml | 134 ++++ .../VTEX - Profile System/Profiles/folder.yml | 4 + .../Prospects/Create prospect.yml | 383 ++++++++++ .../Prospects/Delete prospect.yml | 70 ++ .../Prospects/Get prospect.yml | 158 ++++ .../Prospects/Get prospects.yml | 155 ++++ .../Prospects/Get unmasked prospect.yml | 159 ++++ .../Prospects/Get unmasked prospects.yml | 152 ++++ .../Prospects/Update prospect.yml | 437 +++++++++++ .../Prospects/folder.yml | 4 + .../Create purchase information.yml | 192 +++++ .../Delete purchase information.yml | 75 ++ .../Get purchase information.yml | 153 ++++ .../Get unmasked purchase information.yml | 149 ++++ .../Update purchase information.yml | 192 +++++ .../Purchase information/folder.yml | 4 + .../Create or delete custom fields.yml | 84 +++ .../Schemas/Get custom fields.yml | 119 +++ .../Schemas/Get full schema.yml | 231 ++++++ .../VTEX - Profile System/Schemas/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../VTEX - Profile System/opencollection.yml | 28 + .../Coupons/Archive a coupon batch.yml | 92 +++ .../Coupons/Create coupon batches.yml | 110 +++ .../Edit coupon batch configuration.yml | 108 +++ .../Coupons/Get archived coupons.yml | 112 +++ .../Coupons/Get coupon batch codes.yml | 98 +++ .../Coupons/Get coupon batch information.yml | 107 +++ .../Coupons/Get coupons.yml | 112 +++ .../Get usage count for a coupon batch.yml | 92 +++ .../Get usage count for a single coupon.yml | 92 +++ .../Coupons/Unarchive a coupon batch.yml | 92 +++ .../Coupons/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 47 ++ .../Calculate discounts and taxes bundles.yml | 78 ++ .../Bundles/folder.yml | 4 + .../Create campaign audience.yml | 676 ++++++++++++++++++ .../Get all campaign audiences.yml | 177 +++++ .../Get campaign audience configuration.yml | 180 +++++ .../Campaign Audiences/folder.yml | 4 + .../Coupons/Archive coupon by coupon code.yml | 84 +++ .../Coupons/Create multiple coupons.yml | 98 +++ .../Coupons/Create or update coupon.yml | 104 +++ .../Coupons/Generate coupons in bulk.yml | 105 +++ .../Coupons/Get all coupons.yml | 100 +++ .../Get archived coupon by coupon code.yml | 92 +++ .../Coupons/Get coupon by coupon code.yml | 92 +++ .../Coupons/Get coupon usage.yml | 97 +++ .../Unarchive coupon by coupon code.yml | 84 +++ .../Coupons/folder.yml | 4 + .../Notifications/folder.yml | 4 + .../Delete price by SKU ID.yml | 54 ++ .../Get all paged prices.yml | 58 ++ .../Get price by SKU ID and trade policy.yml | 77 ++ .../Get price by SKU ID.yml | 71 ++ .../Get price by context.yml | 61 ++ .../Prices (Legacy - v1)/Save price.yml | 64 ++ .../Prices (Legacy - v1)/folder.yml | 4 + .../Archive promotion or tax.yml | 61 ++ .../Create multiple SKU promotion.yml | 78 ++ .../Create or update promotion or tax.yml | 330 +++++++++ .../Get all promotions.yml | 175 +++++ .../Promotions and taxes/Get all taxes.yml | 128 ++++ .../Get promotion or tax by ID.yml | 232 ++++++ .../List archived promotions.yml | 121 ++++ .../List archived taxes.yml | 122 ++++ .../Search promotion by name.yml | 210 ++++++ .../Seller opt-in or opt-out.yml | 102 +++ .../Unarchive promotion or tax.yml | 61 ++ .../Update multiple SKU promotion.yml | 83 +++ .../Promotions and taxes/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 80 +++ .../Finish punchout login flow.yml | 58 ++ .../Start VTEX user punchout flow.yml | 87 +++ ...t pre-authenticated user punchout flow.yml | 99 +++ .../Punchout login/folder.yml | 4 + .../VTEX - Punchout API/environments/VTEX.yml | 8 + .../VTEX - Punchout API/opencollection.yml | 22 + .../Events/Product view.yml | 72 ++ .../Events/Recommendation click.yml | 68 ++ .../Events/Recommendation view.yml | 71 ++ .../Events/folder.yml | 4 + .../Recommendations/Fetch recommendations.yml | 207 ++++++ .../Recommendations/folder.yml | 4 + .../Users/Start session.yml | 111 +++ .../Users/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 30 + .../Miscellaneous/Add Subscription item.yml | 63 ++ .../Get Subscription addresses.yml | 45 ++ .../Get Subscription by recurrenceId.yml | 45 ++ .../Get Subscription settings.yml | 41 ++ .../Miscellaneous/Get Subscriptions.yml | 49 ++ .../Miscellaneous/Get payment accounts.yml | 45 ++ .../Miscellaneous/Get self Subscription.yml | 41 ++ .../Miscellaneous/Reindex Subscription.yml | 59 ++ .../Update Subscription settings.yml | 51 ++ .../Miscellaneous/Update Subscription.yml | 65 ++ .../Update partial Subscription.yml | 56 ++ .../Miscellaneous/folder.yml | 4 + .../environments/VTEX.yml | 14 + .../opencollection.yml | 17 + .../Rating/Get product rating.yml | 83 +++ .../Rating/folder.yml | 4 + .../Review/Create a review.yml | 102 +++ .../Review/Create multiple reviews.yml | 97 +++ .../Review/Delete multiple reviews.yml | 78 ++ .../Review/Delete review.yml | 80 +++ .../Review/Get list of reviews.yml | 160 +++++ .../Get product review by review ID.yml | 92 +++ .../Review/Update a review.yml | 105 +++ .../Review/folder.yml | 4 + .../environments/VTEX.yml | 8 + .../opencollection.yml | 21 + .../SKU Bindings/Activate SKU binding.yml | 62 ++ .../Bind a seller's SKU to another SKU.yml | 73 ++ .../Change notification with SKU ID.yml | 60 ++ ...ation with seller ID and seller SKU ID.yml | 82 +++ .../SKU Bindings/Deactivate SKU binding.yml | 62 ++ .../Get SKU bindings by SKU ID.yml | 96 +++ .../Get SKU bindings information.yml | 119 +++ .../Get all SKU bindings by seller ID.yml | 95 +++ .../Get details of a seller's SKU.yml | 100 +++ .../Get paged SKU bindings by seller ID.yml | 111 +++ .../SKU Bindings/Insert SKU binding.yml | 62 ++ .../Remove a seller's SKU binding.yml | 62 ++ .../SKU Bindings/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 34 + .../Get SSL certificate by ID.yml | 106 +++ .../Install or renew SSL certificate.yml | 114 +++ .../List SSL certificates.yml | 103 +++ .../SSL Certificates/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 38 + .../Product search autocomplete.yml | 101 +++ .../VTEX - Search API/Autocomplete/folder.yml | 4 + .../Get product search of accessories.yml | 35 + .../Get product search of show together.yml | 35 + .../Get product search of similars.yml | 44 ++ .../Get product search of suggestions.yml | 44 ++ ...oduct search of who bought also bought.yml | 70 ++ ... product search of who saw also bought.yml | 70 ++ ...Get product search of who saw also saw.yml | 70 ++ .../VTEX - Search API/CrossSelling/folder.yml | 4 + .../Facets/Get category facets.yml | 109 +++ .../Facets/Search by store facets.yml | 74 ++ .../VTEX - Search API/Facets/folder.yml | 4 + .../Offers/Search SKU offers.yml | 122 ++++ .../Offers/Search product offers.yml | 118 +++ .../VTEX - Search API/Offers/folder.yml | 4 + ...ucts with filter, order and pagination.yml | 166 +++++ .../Search/Search for products.yml | 77 ++ .../Search/Search product by product URL.yml | 70 ++ .../VTEX - Search API/Search/folder.yml | 4 + .../VTEX - Search API/environments/VTEX.yml | 10 + .../VTEX - Search API/opencollection.yml | 26 + .../Segment/Get segment.yml | 85 +++ .../Segment/folder.yml | 4 + .../Session/Create new session.yml | 85 +++ .../Session/Edit session.yml | 93 +++ .../Session/Get session.yml | 125 ++++ .../Session/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 17 + .../Shopee orders/Download shipping label.yml | 116 +++ .../Shopee orders/folder.yml | 4 + .../Cancel marketplace delivery.yml | 105 +++ .../VTEX order callbacks/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 21 + .../Create shopper document.yml | 99 +++ .../Get shopper document by user ID.yml | 105 +++ .../Search shopper document by user ID.yml | 113 +++ .../Shopper documents/folder.yml | 8 + .../Shopper schema/Get shopper schema.yml | 166 +++++ .../Shopper schema/folder.yml | 8 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 29 + .../Assign one storefront role.yml | 92 +++ .../Assign storefront roles.yml | 112 +++ .../Check storefront user resource access.yml | 94 +++ .../Fetch storefront user details.yml | 90 +++ .../Fetch storefront user roles by email.yml | 96 +++ .../Get storefront user roles.yml | 100 +++ .../Remove storefront user.yml | 90 +++ .../Revoke storefront roles.yml | 106 +++ .../Storefront Permissions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 49 ++ .../Create custom storefront resource.yml | 101 +++ .../Delete custom storefront resource.yml | 66 ++ .../List storefront resources.yml | 100 +++ .../Custom Storefront Resources/folder.yml | 4 + .../Create storefront role.yml | 113 +++ .../Delete storefront role.yml | 66 ++ .../Edit storefront role resources.yml | 116 +++ .../Fetch storefront role by ID.yml | 100 +++ .../List storefront roles.yml | 115 +++ .../Custom Storefront Roles/folder.yml | 4 + .../Assign one storefront role.yml | 92 +++ ...s or create user with storefront roles.yml | 112 +++ .../Check storefront user resource access.yml | 94 +++ .../Fetch storefront user details.yml | 90 +++ .../Fetch storefront user roles by ID.yml | 100 +++ .../Fetch storefront user roles by email.yml | 96 +++ .../Remove storefront user.yml | 90 +++ .../Revoke storefront role from user.yml | 106 +++ .../Storefront Roles/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 36 + .../Report/Get report status by ID.yml | 45 ++ .../Report/Request report by update.yml | 53 ++ ...Retrieve Subscription report by Status.yml | 49 ++ .../Retrieve Subscription report by date.yml | 53 ++ ...ieve Subscription report by order date.yml | 53 ++ ...trieve Subscription report by schedule.yml | 53 ++ .../Report/folder.yml | 4 + .../Settings/Edit Subscriptions settings.yml | 108 +++ .../Settings/Get Subscriptions Settings.yml | 89 +++ .../Settings/folder.yml | 4 + .../Add Subscription item by groupId.yml | 65 ++ .../Cancel Subscription by groupId.yml | 45 ++ .../Get Conversation Message by groupId.yml | 45 ++ .../Subscription Group/Get Next purchase.yml | 45 ++ .../Get Simulation by subscription-group.yml | 45 ++ .../Get Subscription by groupId.yml | 45 ++ .../Get addresses by groupId.yml | 45 ++ .../Get frequency options by groupId.yml | 45 ++ .../Get payment System by groupId.yml | 45 ++ .../Get subscription group list.yml | 41 ++ .../Insert Addresses by groupId.yml | 79 ++ .../List 'Will create' by groupId.yml | 45 ++ .../List All subscription groups.yml | 41 ++ ...ist Subscription group's Configuration.yml | 45 ++ .../Retry subscription by groupId.yml | 49 ++ .../Update Subscription by groupId.yml | 149 ++++ .../Subscription Group/folder.yml | 4 + ...Cancel Subscriptions by SubscriptionId.yml | 45 ++ .../Subscriptions/Get Subscription List.yml | 41 ++ ...et frequency options by subscriptionId.yml | 45 ++ .../Insert Addresses for Subscription.yml | 71 ++ .../Retrieve customer's subscriptions.yml | 45 ++ .../Retrieve subscription by ID.yml | 45 ++ ...Update Subscriptions by SubscriptionId.yml | 129 ++++ .../Subscriptions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 28 + .../Cycles/Get cycle details.yml | 133 ++++ .../Cycles/List cycles.yml | 166 +++++ .../Cycles/Retry cycle.yml | 44 ++ .../Cycles/folder.yml | 4 + .../Plans/Get plan details.yml | 95 +++ .../Plans/List plans.yml | 125 ++++ .../Plans/folder.yml | 4 + .../Reports/Generate report.yml | 131 ++++ .../Reports/Get report document details.yml | 96 +++ .../Reports/List report templates.yml | 159 ++++ .../Reports/folder.yml | 4 + .../Settings/Edit subscriptions settings.yml | 111 +++ .../Settings/Get subscriptions settings.yml | 89 +++ .../Settings/folder.yml | 4 + .../Add item to subscription.yml | 144 ++++ ... the current prices for a subscription.yml | 192 +++++ ...for the provided subscription template.yml | 238 ++++++ .../Subscriptions/Create subscription.yml | 173 +++++ .../Edit item from subscription.yml | 149 ++++ .../Get conversation messages.yml | 102 +++ .../Get subscription details by ID.yml | 136 ++++ .../Subscriptions/List subscriptions.yml | 181 +++++ .../Remove item from subscription.yml | 53 ++ .../Update subscription by ID.yml | 166 +++++ .../Subscriptions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 69 ++ .../Cycles/Get cycle details.yml | 146 ++++ .../Cycles/List cycles.yml | 179 +++++ .../Cycles/Retry cycle.yml | 57 ++ .../Cycles/folder.yml | 4 + .../Plans/Get plan details.yml | 107 +++ .../Plans/List plans.yml | 137 ++++ .../Plans/folder.yml | 4 + .../Reports/Generate report.yml | 143 ++++ .../Reports/Get report document details.yml | 108 +++ .../Reports/List report templates.yml | 174 +++++ .../Reports/folder.yml | 4 + .../Settings/Edit subscriptions settings.yml | 123 ++++ .../Settings/Get subscriptions settings.yml | 101 +++ .../Settings/folder.yml | 4 + .../Add item to subscription.yml | 157 ++++ ... the current prices for a subscription.yml | 205 ++++++ ...for the provided subscription template.yml | 283 ++++++++ .../Subscriptions/Create subscription.yml | 217 ++++++ .../Edit item from subscription.yml | 162 +++++ .../Get conversation messages.yml | 115 +++ .../Get subscription details by ID.yml | 149 ++++ .../Subscriptions/List subscriptions.yml | 194 +++++ .../Remove item from subscription.yml | 65 ++ .../Update subscription by ID.yml | 178 +++++ .../Subscriptions/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 32 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 21 + .../undefined/folder.yml | 4 + .../Authentication/Asynchronous login.yml | 84 +++ .../VTEX - Tracking/Authentication/folder.yml | 4 + .../Get delivery service by ID.yml | 77 ++ .../Get delivery service by invoice.yml | 78 ++ .../Get delivery services list by route.yml | 98 +++ .../Get delivery services list.yml | 98 +++ ...delivery service with route scheduling.yml | 345 +++++++++ .../Post delivery service.yml | 192 +++++ .../Delivery services/Remove packing list.yml | 55 ++ .../Delivery services/folder.yml | 4 + .../VTEX - Tracking/environments/VTEX.yml | 6 + .../VTEX - Tracking/opencollection.yml | 49 ++ .../Erase customer data.yml | 113 +++ .../Data Subject Rights/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 28 + .../Data erasure/Create data erasure job.yml | 83 +++ .../Get data erasure job status.yml | 82 +++ .../Data erasure/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../VTEX - User Rights API/opencollection.yml | 36 + .../User Data Rights/Delete user data.yml | 111 +++ .../User Data Rights/folder.yml | 4 + .../environments/VTEX.yml | 6 + .../opencollection.yml | 28 + .../VTEX - VTEX Do API/Note/Create note.yml | 111 +++ .../Note/Get notes by order ID.yml | 91 +++ .../VTEX - VTEX Do API/Note/Retrieve note.yml | 81 +++ .../VTEX - VTEX Do API/Note/folder.yml | 4 + .../Task/Add comment on a task.yml | 82 +++ .../VTEX - VTEX Do API/Task/Create task.yml | 113 +++ .../VTEX - VTEX Do API/Task/List tasks.yml | 158 ++++ .../VTEX - VTEX Do API/Task/Retrieve task.yml | 76 ++ .../VTEX - VTEX Do API/Task/Update task.yml | 82 +++ .../VTEX - VTEX Do API/Task/folder.yml | 4 + .../VTEX - VTEX Do API/environments/VTEX.yml | 10 + .../VTEX - VTEX Do API/opencollection.yml | 48 ++ .../Check authenticated user.yml | 94 +++ .../Enable or disable repeated passwords.yml | 64 ++ ...OAuth access token for VTEX credential.yml | 93 +++ .../Authentication/Expire user password.yml | 65 ++ .../Generate authentication token.yml | 94 +++ .../Authentication/Get user ID by email.yml | 82 +++ .../Authentication/folder.yml | 4 + ...ganization unit authentication setting.yml | 81 +++ ...anization unit authentication settings.yml | 104 +++ ...anization unit authentication settings.yml | 115 +++ ...anization unit authentication settings.yml | 120 ++++ .../folder.yml | 4 + ...elete password migration configuration.yml | 54 ++ .../Enable or disable password migration.yml | 58 ++ ...psert password migration configuration.yml | 70 ++ .../Password migration/folder.yml | 4 + .../Refresh token headless/Refresh token.yml | 84 +++ .../Send access key.yml | 48 ++ .../Start authentication.yml | 102 +++ .../Validate session.yml | 99 +++ .../Refresh token headless/folder.yml | 4 + .../Create storefront user.yml | 122 ++++ .../Get storefront user by identifier.yml | 95 +++ .../Storefront users/folder.yml | 4 + .../Token renewal/Complete token renewal.yml | 90 +++ .../Token renewal/Initiate token renewal.yml | 95 +++ .../Token renewal/folder.yml | 4 + .../VTEX - VTEX ID API/environments/VTEX.yml | 10 + .../VTEX - VTEX ID API/opencollection.yml | 21 + .../Notification/Notify carrier with app.yml | 162 +++++ .../Notification/folder.yml | 4 + .../Tracking/Tracking events with app.yml | 68 ++ .../Tracking/folder.yml | 4 + .../environments/VTEX.yml | 10 + .../opencollection.yml | 52 ++ .../Revoke certificate.yml | 62 ++ .../Sign certificate.yml | 77 ++ .../Certificate management/folder.yml | 4 + .../VTEX - mTLS API/environments/VTEX.yml | 10 + .../VTEX - mTLS API/opencollection.yml | 40 ++ .../VTEX_TEMPLATE/environments/VTEX.yml | 10 + .../VTEX_TEMPLATE/opencollection.yml | 17 + .../VTEX_TEMPLATE/pets/Create a pet.yml | 42 ++ .../pets/Info for a specific pet.yml | 85 +++ .../VTEX_TEMPLATE/pets/List all pets.yml | 89 +++ .../VTEX_TEMPLATE/pets/folder.yml | 4 + BrunoCollections/_tools/.gitignore | 1 + .../_tools/bru-to-opencollection.js | 90 +++ BrunoCollections/_tools/convert.sh | 36 + BrunoCollections/_tools/make-workspace.js | 49 ++ BrunoCollections/_tools/package-lock.json | 208 ++++++ BrunoCollections/_tools/package.json | 11 + BrunoCollections/_tools/postman-to-bruno.py | 496 +++++++++++++ BrunoCollections/workspace.yml | 194 +++++ 1673 files changed, 134928 insertions(+) create mode 100644 BrunoCollections/README.md create mode 100644 BrunoCollections/VTEX - Ads API/Ads events notification/Track ad clicks.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads events notification/Track ad impressions.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads events notification/Track ad views.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads events notification/Track conversions.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads events notification/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads/Get ads.yml create mode 100644 BrunoCollections/VTEX - Ads API/Ads/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Audiences/Generate audience upload URL.yml create mode 100644 BrunoCollections/VTEX - Ads API/Audiences/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize inventory information.yml create mode 100644 BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize product information.yml create mode 100644 BrunoCollections/VTEX - Ads API/Catalog synchronization/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Credit transfer/Notify credit transfer status.yml create mode 100644 BrunoCollections/VTEX - Ads API/Credit transfer/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get ads performance report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get advertiser ads detailed report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get advertiser campaigns detailed report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get advertisers report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get campaign details.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get network publishers report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/Get publishers report.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/List campaigns.yml create mode 100644 BrunoCollections/VTEX - Ads API/Reports/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/Single sign-on/Generate seller single sign-on URL.yml create mode 100644 BrunoCollections/VTEX - Ads API/Single sign-on/folder.yml create mode 100644 BrunoCollections/VTEX - Ads API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Ads API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Get anti-fraud status.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/List anti-fraud provider manifest.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud data.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud pre-analysis data (optional).yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Stop anti-fraud analysis (optional).yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Update anti-fraud transactions (optional).yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/folder.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/1. Retrieve token.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/2. Redirect.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/3. Return to VTEX.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/4. Get credentials.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/folder.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Antifraud Provider API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Audience API/Audience Manager/Fetch audience.yml create mode 100644 BrunoCollections/VTEX - Audience API/Audience Manager/folder.yml create mode 100644 BrunoCollections/VTEX - Audience API/Price Table Mapper/Delete price table mapping.yml create mode 100644 BrunoCollections/VTEX - Audience API/Price Table Mapper/Get price table mapping.yml create mode 100644 BrunoCollections/VTEX - Audience API/Price Table Mapper/Set price table mapping.yml create mode 100644 BrunoCollections/VTEX - Audience API/Price Table Mapper/folder.yml create mode 100644 BrunoCollections/VTEX - Audience API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Audience API/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/Create B2B address.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/Delete B2B address.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/Get B2B address by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/Search B2B addresses.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/Update B2B address.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Addresses/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/Create location.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/Delete location.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/Get location.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/Search locations.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/Update location.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Locations/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/Create recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/Delete recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/Get recipient by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/Search recipients.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/Update recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/Recipients/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Addresses API/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Create buyer.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Delete buyer.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer schema.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Search buyers.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Update buyer.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Buyer Data API/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/Create new contact information.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/Delete contact information.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/Get contact information by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/Search contact information.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/Update contact information.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/Contact information/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Contact Information API/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/Contracts/Create contract.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/Contracts/Delete contract by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/Contracts/Get contract by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/Contracts/Update contract by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/Contracts/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Contracts API/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/Validate legacy credentials.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/Register client.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Password Migration Protocol/opencollection.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/Create new recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/Delete recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/Get recipient by ID.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/Search recipients.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/Update recipient.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/Recipients/folder.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - B2B Recipients API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Change allocation status.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Create allocation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Create batch of allocations.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Delete allocation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Get allocation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/List budget allocations.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Query allocations.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Update allocation linked entity.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Update allocation usage.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/Update allocation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Allocations/folder.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/Create budget.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/Delete budget.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/Get budget.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/List budgets.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/Update budget status.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/Update budget.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Budgets/folder.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/Confirm reservation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/Create reservation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/Delete reservation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/Get reservation.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/List reservations.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Reservations/folder.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Statements/Get allocation statements.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Statements/Get budget statements.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Statements/folder.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Transactions/Create transaction.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Transactions/Get transaction.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Transactions/Refund transaction.yml create mode 100644 BrunoCollections/VTEX - Budgets API/Transactions/folder.yml create mode 100644 BrunoCollections/VTEX - Budgets API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Budgets API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/Batch imports/Import prices.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/Batch imports/folder.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch errors.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch status.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/Batch status/folder.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Bulk Pricing API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Check progress.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Start import.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Upload file.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Validate file.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/Bulk Import/folder.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Buyer Organizations/opencollection.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Dimensions/Create dimension.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Dimensions/Delete dimension.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Dimensions/Get dimensions information.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Dimensions/Update dimension.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Dimensions/folder.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Manual authorization/Accept or deny rule.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Manual authorization/folder.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Rules/Create dimension rule.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Rules/Delete dimension rule.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Rules/Update all dimension rules.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Rules/Update dimension rule.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/Rules/folder.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Buying Policies API/opencollection.yml create mode 100644 BrunoCollections/VTEX - CMS API/Change URI Schema/Update all account's websites internet communication protocol.yml create mode 100644 BrunoCollections/VTEX - CMS API/Change URI Schema/Update specific website comunication protocol.yml create mode 100644 BrunoCollections/VTEX - CMS API/Change URI Schema/folder.yml create mode 100644 BrunoCollections/VTEX - CMS API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - CMS API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import report.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import status.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token import/Import card tokens.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token import/folder.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token/Create card token.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token/Delete card token.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token/Get card token by ID.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token/Update card token.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/Card token/folder.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Card Token Vault API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Create brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get brand by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get list of brands.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Update brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Brand/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Category/Create category.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category tree.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Category/Update category tree.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Category/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Create product.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by external ID, SKU ID, SKU external ID or slug.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product description by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product description by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/Product/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Get list of SKUs.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Search for SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/SKU/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Catalog API Seller Portal/opencollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Add excluded collection to product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Add included collection to product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Create product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Delete product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Get all product assortments.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Get product assortment by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Remove excluded collection from product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Remove included collection from product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/Update product assortment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Assortment/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/Create attachment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/Delete attachment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/Get all attachments.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/Get attachment by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/Update attachment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Attachment/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Create brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Delete brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Get brand and context.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Get brand by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Get brand list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Get paginated brand list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/Update brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Brand/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category specification/Get specifications by category ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category specification/Get specifications tree by category ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category/Create category.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category/Get category by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category/Get category tree.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category/Update category.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Category/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Add products to collection by imported file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Create collection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Delete collection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Get all inactive collections.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Get collection by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Get products from a collection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Import collection file example.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Remove products from collection by imported file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/Update collection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Collection/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Commercial conditions/Get all commercial conditions.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Commercial conditions/Get commercial condition.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Commercial conditions/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Gift list/Get gift list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Gift list/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU attribute translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU file translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU attribute translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU file translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU translation by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language SKU/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service type translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service value translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update attachment translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service type translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service value translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get attachment translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language brand/Create or update brand translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language brand/Get brand translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language brand/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language category/Create or update category translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language category/Get category translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language category/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language collection/Create or update collection translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language collection/Get collection translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language collection/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification group translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification value translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification group translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification value translation.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product specification translation by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product translation by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language/Get product specification translation by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language/Get product translation by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Multi-language/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Non-structured specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product indexing/Get product indexed information.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product indexing/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification using specification name and group name.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Delete a product specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Delete all product specifications by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications and their information by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/Update product specification by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Create product with category and brand.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product and SKU IDs.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product and its general context.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product by reference ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product review rate by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Get product's SKUs by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/Update product.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Product/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/Create SKU EAN.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/Delete SKU EAN.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/Delete all SKU EAN values.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/Get EAN by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/Get SKU by EAN.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU EAN/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/Associate SKU attachment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/Associate attachments to an SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/Delete SKU attachment by attachment association ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/Dissociate attachments and SKUs.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/Get SKU attachments by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attachment/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Create SKU attribute.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Delete SKU attribute.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Delete all SKU attributes.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Get SKU attribute by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Get all SKU attributes.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/Update SKU attribute.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU attribute/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Create SKU complement.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Delete SKU complement by SKU complement ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU complement ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by complement type ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU complement/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Copy files from an SKU to another SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Create SKU file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Delete SKU image file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Delete all SKU files.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Disassociate SKU file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Get SKU files.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Reorder SKU files.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/Update SKU file.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU file/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/Create SKU kit.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by SKU ID or parent SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by kit ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit by SKU ID or parent SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU kit/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with seller ID and seller SKU ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU seller/Get details of a seller's SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU seller/Remove a seller's SKU binding.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU seller/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service attachment/Associate SKU service attachment.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment by attachment ID or SKU service type ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment from SKU service type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service attachment/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service type/Create SKU service type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service type/Delete SKU service type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service type/Get SKU service type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service type/Update SKU service type.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service type/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service value/Create SKU service value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service value/Delete SKU service value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service value/Get SKU service value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service value/Update SKU service value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service value/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service/Associate SKU service.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service/Dissociate SKU service.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service/Get SKU service.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service/Update SKU service.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU service/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification using specification name and group name.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Delete SKU specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Delete all SKU specifications.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Get SKU specifications.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/Update SKU specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Create SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU ID by reference ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU and context.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU by alternate ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU by reference ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU list by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Get SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/List all SKU IDs.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Retrieve SKU ID list by reference ID list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/Update SKU.yml create mode 100644 BrunoCollections/VTEX - Catalog API/SKU/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/Associate product with sales channel.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by product ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/List all SKUs in a sales channel.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/Remove product from sales channel.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Sales channel/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/Create seller.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID (2).yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/Get seller list.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/Update seller.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Seller/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Similar category/Add similar category.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Similar category/Delete similar category.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Similar category/Get similar categories.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Similar category/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field value/Create specification field value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field value/Get specification field value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field value/Get specification values by specification field ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field value/Update specification field value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field value/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field/Create specification field.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field/Get specification field.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field/Update specification field.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification field/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification group/Create specification group.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification group/Get specification group.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification group/List specification group by category.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification group/Update specification group.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification group/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification value/Create specification value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification value/Get specification value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification value/Update specification value.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification value/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification/Create specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification/Get specification by specification ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification/Update specification.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Specification/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Add SKU to subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Associate brand to subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Associate category to subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Create subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Delete SKU from subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Delete brand from subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Delete category from subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Delete specification value from subcollection by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Delete subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Get specification values by subcollection ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by collection ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by subcollection ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Reposition SKU on the subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Update subcollection.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/Use specification value in subcollection by ID.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Subcollection/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Supplier/Create supplier.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Supplier/Delete supplier.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Supplier/Update supplier.yml create mode 100644 BrunoCollections/VTEX - Catalog API/Supplier/folder.yml create mode 100644 BrunoCollections/VTEX - Catalog API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Catalog API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add client preferences.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add client profile.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add item attachment.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add item subscription attachment.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add marketing data.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add merchant context data.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add payment data.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Add shipping address and select delivery option.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Attach invoice data.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Get client profile by email.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item attachment.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item subscription attachment.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Cart attachments/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Clear order form messages.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Create order form configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Get order form configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Get window to change seller.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Update order form configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/Update window to change seller.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Add address custom field.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Add item custom field.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Add order custom field.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Batch add custom fields.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Remove item custom field.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Remove single custom field value.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Set multiple custom field values.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/Set single custom field value.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Custom data/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Fulfillment/Get address by postal code.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Fulfillment/List pickup points by location.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Fulfillment/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Order placement/Place order from an existing cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Order placement/Place order.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Order placement/Process order.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Order placement/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Region/Get sellers by region or address.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Region/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Add cart items.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Add coupons to the cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Cart installments.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Cart simulation.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Change price of an SKU in a cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Delete manual price of an SKU in a cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Get cart information by ID.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Get current or create a new cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Handle cart items.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Ignore profile data on checkout.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all items from shopping cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all personal data from shopping cart.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Split a cart item.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/Update cart items.yml create mode 100644 BrunoCollections/VTEX - Checkout API/Shopping cart/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Checkout API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/Configuration/Create a new checkout configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/Configuration/Delete checkout configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/Configuration/Get checkout configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/Configuration/Update a checkout configuration.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/Configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Checkout Configuration API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Start client login.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Validate client login.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/Save card token.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add client profile data.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add items to cart.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add payment data.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Place order.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get card.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get transaction details.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/List payments.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Create profile.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Delete profile.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Get profile cards.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/folder.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Checkout Custom Card Payment API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field settings/Create custom field settings.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field settings/Delete custom field setting.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field settings/Get custom field settings.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field settings/Update custom field settings.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field settings/folder.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/Create custom field value.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/Delete custom field value.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/Get custom field value.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/Search custom field values.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/Update custom field value.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/Custom field values/folder.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Custom Fields API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Add an account holder.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Cancel a pre-authorization.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Change credit limit of an account.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Change tolerance of an account.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Close an account.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Create a pre-authorization.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Create or update settlement.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Decrease balance of an account.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Delete an account holder.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Get account statements.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Open an account.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Partially or totally refund a settlement.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Retrieve an account by ID.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Search all accounts.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Update a pre-authorization.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/Update account information.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Account/folder.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Cancel invoice.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Change invoice.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Mark an invoice as paid.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Postpone an invoice.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoice by ID.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoices by Customer Credit account ID.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/Search all invoices.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Invoices/folder.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Store Configuration/Create or change store configuration.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Store Configuration/Retrieve store configuration.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/Store Configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Customer Credit API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/Erase customer data.yml create mode 100644 BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/folder.yml create mode 100644 BrunoCollections/VTEX - Data Subject Rights/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Data Subject Rights/opencollection.yml create mode 100644 BrunoCollections/VTEX - Default Values API/Default values/Create default values.yml create mode 100644 BrunoCollections/VTEX - Default Values API/Default values/Delete default values.yml create mode 100644 BrunoCollections/VTEX - Default Values API/Default values/Get default values.yml create mode 100644 BrunoCollections/VTEX - Default Values API/Default values/Update default values.yml create mode 100644 BrunoCollections/VTEX - Default Values API/Default values/folder.yml create mode 100644 BrunoCollections/VTEX - Default Values API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Default Values API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/Delivery Promise/folder.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update delivery promises for an external seller's item.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update external product availability.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/folder.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Notification API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Get delivery suggestions.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Search delivery suggestions.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/folder.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search delivery zones.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search pickup points.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/folder.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Delivery Promise Suggestions API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Addresses/Create address.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Addresses/Delete address by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Addresses/Get address by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Addresses/Update address by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Addresses/folder.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Contracts/Create contract.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Contracts/Delete contract by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Contracts/Get contract by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Contracts/Update contract by ID.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/Contracts/folder.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Document Contracts API/opencollection.yml create mode 100644 BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Calculate promotions.yml create mode 100644 BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Notify promotion usage.yml create mode 100644 BrunoCollections/VTEX - External Promotions Protocol API/External promotions/folder.yml create mode 100644 BrunoCollections/VTEX - External Promotions Protocol API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - External Promotions Protocol API/opencollection.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Provider/Create or update a gift card provider by ID.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Provider/Delete a gift card provider by ID.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Provider/Get a gift card provider by ID.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Provider/List all gift card providers.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Provider/folder.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Cancel a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card at a gift card provider.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider by ID.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction authorization.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction by ID.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions cancellations.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions settlements.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/Settle a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/Transaction/folder.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - GiftCard Hub API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Gift Card/Create a gift card.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Gift Card/Get a gift card by ID.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Gift Card/List all gift cards.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Gift Card/folder.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/Cancel a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/Create a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction authorization.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction by ID.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions cancellations.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions settlements.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/Settle a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/Transactions/folder.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Giftcard API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Create a gift card.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Get a gift card by ID.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/List all gift cards.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/folder.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Cancel a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Create a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction authorization.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction by ID.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions cancellations.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions settlements.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Settle a gift card transaction.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/folder.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Giftcard Provider Protocol/opencollection.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/Pages/Get CMS page.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/Pages/Get all CMS pages by content type.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/Pages/Get all content types.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/Pages/folder.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Headless CMS API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms similar to the search term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of the 10 most searched terms.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/Get pickup point availability for Delivery Promise.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/Get product.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get attempt of correction of a misspelled term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get list of banners registered for query.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/List filters for a search.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Search products.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API - v1/opencollection.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms similar to the search term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of the 10 most searched terms.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Autocomplete/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/Get pickup point availability for Delivery Promise.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Product list page/Get attempt of correction of a misspelled term.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of banners registered for query.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of products for a query.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of the possible facets for a given query.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/Product list page/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/Save events.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/folder.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search Events API - Headless/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Intelligent Search Events API - Headless/opencollection.yml create mode 100644 BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update all account's websites internet communication protocol.yml create mode 100644 BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update specific website comunication protocol.yml create mode 100644 BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/folder.yml create mode 100644 BrunoCollections/VTEX - Legacy CMS Portal API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Legacy CMS Portal API/opencollection.yml create mode 100644 BrunoCollections/VTEX - License Manager API/API keys/Create new API Key.yml create mode 100644 BrunoCollections/VTEX - License Manager API/API keys/Get API keys from account.yml create mode 100644 BrunoCollections/VTEX - License Manager API/API keys/Update API Key.yml create mode 100644 BrunoCollections/VTEX - License Manager API/API keys/folder.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Account/Get information about account.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Account/folder.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Roles/Add roles to user or API Key.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Roles/Get list of roles.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Roles/Get roles by user ID or API Key.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Roles/Remove role from user or API Key.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Roles/folder.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Stores/Get stores.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Stores/folder.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/Create user.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/Delete user.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/Get list of users.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/Get user information by user ID.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/Get user information by user email.yml create mode 100644 BrunoCollections/VTEX - License Manager API/Users/folder.yml create mode 100644 BrunoCollections/VTEX - License Manager API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - License Manager API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Batch operations/Confirm batch inventory.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Batch operations/Create batch inventory job.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory errors.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory status.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Batch operations/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/Activate dock.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/Create or update dock.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/Deactivate dock.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/Delete dock.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/List all docks.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/List dock by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Docks/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Freight values/Create or update freight values.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Freight values/List freight values.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Freight values/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Holidays/Create or update holiday.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Holidays/Delete holiday.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Holidays/List all holidays.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Holidays/List holiday by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Holidays/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU per warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock and warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List inventory with dispatched reservations.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/List supply lots.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/Save supply lot.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/Transfer supply lot.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/Update inventory by SKU and warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/Update inventory lead time by SKU and warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/Update inventory quantity by SKU and warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Inventory/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/Create or update pickup point.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/Delete pickup point.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/List paged pickup points.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/List pickup point by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/List pickup points.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Pickup points/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Polygons/Create or update polygon.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Polygons/Delete polygon.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Polygons/List paged polygons.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Polygons/List polygon by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Polygons/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/Acknowledgment reservation.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/Cancel reservation.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/Confirm reservation.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/Create reservation.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/List reservation by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/List reservation by warehouse and SKU.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Reservations/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/SLA/Calculate SLA.yml create mode 100644 BrunoCollections/VTEX - Logistics API/SLA/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/Add blocked delivery windows.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/Get capacity reservation usage by window.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/Remove blocked delivery windows.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/Retrieve blocked delivery windows.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/Search capacity reservations in time range.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Scheduled delivery/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/Create shipping policy.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/Delete shipping policy by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/List shipping policies.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/Retrieve shipping policy by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/Update shipping policy by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Shipping policies/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/Activate warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/Create or update warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/Deactivate warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/List all warehouses.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/List warehouse by ID.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/Remove warehouse.yml create mode 100644 BrunoCollections/VTEX - Logistics API/Warehouses/folder.yml create mode 100644 BrunoCollections/VTEX - Logistics API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Logistics API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Activate Feed.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Close Interaction.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Channel.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Log.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Deactivate Feed.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Error Code data by errorCodeId.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Feed by feedId.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Interaction Data by interactionId.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Log Data by logId.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/List Feeds.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Open Interaction.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Errors.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Interactions and their Logs.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Update Feed.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Sent Offers/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get SKU suggestion by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get all SKU suggestions.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get all versions.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get version by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Delete SKU suggestion.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Send SKU suggestion.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match multiple received SKUs.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match received SKUs individually.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/Map seller specifications to marketplace catalog.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove in marketplace's account.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove setting for a seller.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's approval settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's matcher settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get autoApprove status in account settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get seller's approval settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save account's approval settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save seller's approval settings.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs - Suggestions/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Affiliates/Delete affiliate by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Affiliates/Get affiliate by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Affiliates/List affiliates.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Affiliates/Update affiliate by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Affiliates/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers list.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by product ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Matched Offers/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of inventory update.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of price update.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Notification/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Get sales channel mapping data.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Upsert sales channel mapping.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Get seller commissions by category ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/List seller commissions by seller ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Remove seller commissions by category ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Upsert seller commissions in bulk.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Accept seller lead.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Create seller from lead.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Delete seller lead.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Get seller lead's data by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Invite seller lead.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/List seller leads.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Resend seller lead invite.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Seller Invite/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sellers/Configure seller account.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sellers/Get seller data by ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sellers/List sellers.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sellers/Update seller by seller ID.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/Sellers/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace APIs/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Full update connector.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all channels.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all connectors.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Partial update connector.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Register connector.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Remove connector.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve channel.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve connector.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Send category mapping to VTEX Mapper.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Upsert merchant connection.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/VTEX mapper registration.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Authorize dispatch for fulfillment order.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Fulfillment simulation - external marketplace.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/New Order Integration.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Place fulfillment order.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Update Order Status.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Authorize fulfillment.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Fulfillment simulation - external seller.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Marketplace order cancellation.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Order placement.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/opencollection.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Cancel order in marketplace.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send agreement for order modifications.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send invoice.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send tracking information.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Update tracking status.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/folder.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/opencollection.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Clusters/Validate document by clusters.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Clusters/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Create document with custom ID or update entire document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Create new document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Create partial document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Delete document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Get document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/Update partial document.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Documents/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Indices/Create index.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Indices/Delete index by name.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Indices/Get index by name.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Indices/Get indices.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Indices/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Schemas/Delete schema by name.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schema by name.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schemas.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Schemas/Save schema by name.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Schemas/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Scroll/Scroll documents.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Scroll/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Search/Search documents.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Search/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Versions/Get version.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Versions/List versions.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Versions/Update version.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/Versions/folder.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Master Data API - v2/opencollection.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Create new customer address.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Delete address by ID.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Get address by ID.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Update address by ID.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Addresses/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Retrieve attachment.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Save attachment.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Attachments/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Clusters/Validate document by clusters.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Clusters/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Create new customer profile.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Delete customer profile.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Update customer profile.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Data entities/Get data entity structure.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Data entities/List data entities.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Data entities/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create document with custom ID or update entire document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create new document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create partial document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Delete document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Get document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/Update partial document.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Documents/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Score/Delete score by field.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Score/Update score by field.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Score/Update scores.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Score/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Scroll/Scroll documents.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Scroll/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Search/Search documents.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Search/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Versions/Get version.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Versions/List versions.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Versions/Update version.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/Versions/folder.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - MasterData API - v10.2/opencollection.yml create mode 100644 BrunoCollections/VTEX - Message Center API/DKIM configuration/Generate DKIM keys.yml create mode 100644 BrunoCollections/VTEX - Message Center API/DKIM configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Message Center API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Message Center API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/Configure location capacity.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity details/List location capacities.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity details/folder.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity/Get locations capacities by account.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Capacity/folder.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Location status/Update location status.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Location status/folder.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Locations/List locations.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/Locations/folder.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Operational Capacity API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Invoice/Order invoice notification.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Invoice/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Orders/Cancel order.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Orders/Get order.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Orders/List orders.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Orders/Start handling order.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Orders/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Payment/Send payment notification.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/Payment/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Orders API (PII version)/opencollection.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Invoice/Order invoice notification.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Invoice/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Orders/Cancel order.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Orders/Get order.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Orders/List orders.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Orders/Start handling order.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Orders/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Payment/Send payment notification.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/Payment/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Orders API PII version/opencollection.yml create mode 100644 BrunoCollections/VTEX - Orders API/Change seller/Get window to change seller.yml create mode 100644 BrunoCollections/VTEX - Orders API/Change seller/Update window to change seller.yml create mode 100644 BrunoCollections/VTEX - Orders API/Change seller/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Conversation/Retrieve order conversation.yml create mode 100644 BrunoCollections/VTEX - Orders API/Conversation/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/Get feed order status.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Commit feed items.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Create or update feed configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Delete feed configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Get feed configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Retrieve feed items.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/Test JSONata expression.yml create mode 100644 BrunoCollections/VTEX - Orders API/Feed v3/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Invoice/Order invoice notification.yml create mode 100644 BrunoCollections/VTEX - Orders API/Invoice/Update order's partial invoice (send tracking number).yml create mode 100644 BrunoCollections/VTEX - Orders API/Invoice/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order hook/Create or update hook configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order hook/Delete hook configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order hook/Get hook configuration.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order hook/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Cancel order modifications.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Create order modifications.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Get Order modifications settings.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications details.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications history.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications summary.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Preview order modifications.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Retry order modifications.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/Update Order modifications settings.yml create mode 100644 BrunoCollections/VTEX - Orders API/Order modifications/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Add log in orders.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Cancel order.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Get order.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Get orders by order group ID.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/List orders.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Register modifications on order.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/Start handling order.yml create mode 100644 BrunoCollections/VTEX - Orders API/Orders/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Payment/Retrieve payment transaction.yml create mode 100644 BrunoCollections/VTEX - Orders API/Payment/Send payment notification.yml create mode 100644 BrunoCollections/VTEX - Orders API/Payment/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/Tracking/Update order tracking status.yml create mode 100644 BrunoCollections/VTEX - Orders API/Tracking/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/User orders/Retrieve user order details.yml create mode 100644 BrunoCollections/VTEX - Orders API/User orders/Retrieve user's orders.yml create mode 100644 BrunoCollections/VTEX - Orders API/User orders/folder.yml create mode 100644 BrunoCollections/VTEX - Orders API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Orders API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Create organization unit scope.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Delete all scopes from organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Delete organization unit scope.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Get organization unit scopes.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Remove values from organization unit scope.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/Update organization unit scope.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Scopes/folder.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Add user to organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Create organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Delete organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Find all organization units with scope value.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Get all children organization units.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Get organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Get root organization units.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/List users from organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Move organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Remove users from organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Rename organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/Search organization units.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Units/folder.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Users/Get user scopes.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Users/Get user's organization unit.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/Users/folder.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Organization Units API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/Evaluate payment policies.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/folder.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Create policy rule.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Delete policy rule.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Get policy rule by ID.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/List policy rules.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Update policy rule.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/Payment policy rules/folder.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Payment Policies API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Create authorization token.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Get credentials.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Provider authentication.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/folder.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Cancel payment.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Create payment.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Inbound request (BETA).yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/List Payment Provider Manifest.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Refund payment.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Settle payment.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/folder.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Payment Provider Protocol/opencollection.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Delete payment rule by ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Get affiliation by ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Get card data.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Get payment rule by ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert a new payment rule.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert new affiliation.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/List all affiliations.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/List all available payment methods.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/List all payment rules.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Update affiliation by ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/Update payment rule by ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Installments/Get installments options.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Installments/folder.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID, date, and value paid.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Payment notification/folder.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Cancel the transaction.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Refund the transaction.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Settle the transaction.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/folder.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Authorize new transaction.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get payment details.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction details.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction settlement details.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send additional data.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send payments information.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Start a new transaction.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Update additional data (optional).yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/Transaction Process/folder.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Payments Gateway API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Authentication/Generate JWT token.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Facilities/Get facility by ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Facilities/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Orders/Get order by ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Orders/Set order delivery.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Orders/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Shipments/Get shipment by shipment ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Shipments/List shipments by order ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Shipments/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheet by ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheets by order ID.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/Worksheets/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Changes API/Update items of the order.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Changes API/Update order deadline.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Changes API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Changes API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/Create JWT token.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/Calculate rates.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/List carriers.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/Create service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel ongoing service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create evidence.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create label.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create notes.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create on hold service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Get service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Pause and resume service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Update service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Create bin location.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete all bin locations.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete bin location.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Get bin location.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/List bin locations.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Update bin location.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/Update order deadline.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Order Changes API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/Create JWT token.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/Create service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Cancel service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create evidence.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create label.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create notes.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create on hold service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Get a service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Update service.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/folder.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pick and Pack Protocol API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Create policy.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Delete policy by ID.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Evaluate policies.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Get policy by ID.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Get policy list.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/Update policy.yml create mode 100644 BrunoCollections/VTEX - Policies System API/Policy/folder.yml create mode 100644 BrunoCollections/VTEX - Policies System API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Policies System API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/Create price table.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/Get all price tables and their rules.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/Get rules for a price table.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/List price tables.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/Update rules for a price table.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Price Tables/folder.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price (2).yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update fixed prices on a price table or trade policy.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete fixed prices on a price table or trade policy.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete price all base and fixed prices of an SKU.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed price by price table or trade policy.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed prices for all price tables.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices on a price table or trade policy.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get price by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/folder.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing configuration.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing v2 status.yml create mode 100644 BrunoCollections/VTEX - Pricing API/Pricing Configuration/folder.yml create mode 100644 BrunoCollections/VTEX - Pricing API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pricing API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Configure external price source.yml create mode 100644 BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Retrieve prices.yml create mode 100644 BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/folder.yml create mode 100644 BrunoCollections/VTEX - Pricing Hub/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Pricing Hub/opencollection.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Create client address.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Delete address.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get address by version.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get address.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get client addresses.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address by version.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Get unmasked client addresses.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/Update client address.yml create mode 100644 BrunoCollections/VTEX - Profile System/Addresses/folder.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Create client profile.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Delete client profile.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Get profile by version.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Get profile.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile by version.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/Update client profile.yml create mode 100644 BrunoCollections/VTEX - Profile System/Profiles/folder.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Create prospect.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Delete prospect.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Get prospect.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Get prospects.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospect.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospects.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/Update prospect.yml create mode 100644 BrunoCollections/VTEX - Profile System/Prospects/folder.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/Create purchase information.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/Delete purchase information.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/Get purchase information.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/Get unmasked purchase information.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/Update purchase information.yml create mode 100644 BrunoCollections/VTEX - Profile System/Purchase information/folder.yml create mode 100644 BrunoCollections/VTEX - Profile System/Schemas/Create or delete custom fields.yml create mode 100644 BrunoCollections/VTEX - Profile System/Schemas/Get custom fields.yml create mode 100644 BrunoCollections/VTEX - Profile System/Schemas/Get full schema.yml create mode 100644 BrunoCollections/VTEX - Profile System/Schemas/folder.yml create mode 100644 BrunoCollections/VTEX - Profile System/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Profile System/opencollection.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Archive a coupon batch.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Create coupon batches.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Edit coupon batch configuration.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get archived coupons.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch codes.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch information.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupons.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a coupon batch.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a single coupon.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Unarchive a coupon batch.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API - v2/opencollection.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Bundles/Calculate discounts and taxes bundles.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Bundles/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Create campaign audience.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get all campaign audiences.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get campaign audience configuration.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Archive coupon by coupon code.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create multiple coupons.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create or update coupon.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Generate coupons in bulk.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get all coupons.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get archived coupon by coupon code.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon by coupon code.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon usage.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Unarchive coupon by coupon code.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Coupons/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Notifications/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Delete price by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get all paged prices.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID and trade policy.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by context.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Save price.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Archive promotion or tax.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create multiple SKU promotion.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create or update promotion or tax.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all promotions.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all taxes.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get promotion or tax by ID.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived promotions.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived taxes.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Search promotion by name.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Seller opt-in or opt-out.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Unarchive promotion or tax.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Update multiple SKU promotion.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/folder.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Promotions & Taxes API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Punchout API/Punchout login/Finish punchout login flow.yml create mode 100644 BrunoCollections/VTEX - Punchout API/Punchout login/Start VTEX user punchout flow.yml create mode 100644 BrunoCollections/VTEX - Punchout API/Punchout login/Start pre-authenticated user punchout flow.yml create mode 100644 BrunoCollections/VTEX - Punchout API/Punchout login/folder.yml create mode 100644 BrunoCollections/VTEX - Punchout API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Punchout API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Events/Product view.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation click.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation view.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Events/folder.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Recommendations/Fetch recommendations.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Recommendations/folder.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Users/Start session.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/Users/folder.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Recommendations BFF API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Add Subscription item.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription addresses.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription by recurrenceId.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription settings.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscriptions.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get payment accounts.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get self Subscription.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Reindex Subscription.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription settings.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update partial Subscription.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/folder.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Recurrence (v1 - deprecated)/opencollection.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Rating/Get product rating.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Rating/folder.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Create a review.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Create multiple reviews.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete multiple reviews.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete review.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Get list of reviews.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Get product review by review ID.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/Update a review.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/Review/folder.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Reviews and Ratings API/opencollection.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Activate SKU binding.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Bind a seller's SKU to another SKU.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with SKU ID.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with seller ID and seller SKU ID.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Deactivate SKU binding.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings by SKU ID.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings information.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get all SKU bindings by seller ID.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get details of a seller's SKU.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get paged SKU bindings by seller ID.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Insert SKU binding.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Remove a seller's SKU binding.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/folder.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - SKU Bindings API/opencollection.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Get SSL certificate by ID.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Install or renew SSL certificate.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/List SSL certificates.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/folder.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - SSL Certificates API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Search API/Autocomplete/Product search autocomplete.yml create mode 100644 BrunoCollections/VTEX - Search API/Autocomplete/folder.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of accessories.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of show together.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of similars.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of suggestions.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who bought also bought.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also bought.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also saw.yml create mode 100644 BrunoCollections/VTEX - Search API/CrossSelling/folder.yml create mode 100644 BrunoCollections/VTEX - Search API/Facets/Get category facets.yml create mode 100644 BrunoCollections/VTEX - Search API/Facets/Search by store facets.yml create mode 100644 BrunoCollections/VTEX - Search API/Facets/folder.yml create mode 100644 BrunoCollections/VTEX - Search API/Offers/Search SKU offers.yml create mode 100644 BrunoCollections/VTEX - Search API/Offers/Search product offers.yml create mode 100644 BrunoCollections/VTEX - Search API/Offers/folder.yml create mode 100644 BrunoCollections/VTEX - Search API/Search/Search for products with filter, order and pagination.yml create mode 100644 BrunoCollections/VTEX - Search API/Search/Search for products.yml create mode 100644 BrunoCollections/VTEX - Search API/Search/Search product by product URL.yml create mode 100644 BrunoCollections/VTEX - Search API/Search/folder.yml create mode 100644 BrunoCollections/VTEX - Search API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Search API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Segment/Get segment.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Segment/folder.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Session/Create new session.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Session/Edit session.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Session/Get session.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/Session/folder.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Session Manager API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/Shopee orders/Download shipping label.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/Shopee orders/folder.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/Cancel marketplace delivery.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/folder.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Shopee Integration API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper documents/Create shopper document.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper documents/Get shopper document by user ID.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper documents/Search shopper document by user ID.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper documents/folder.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper schema/Get shopper schema.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/Shopper schema/folder.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Shopper Data API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign one storefront role.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign storefront roles.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Check storefront user resource access.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user details.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user roles by email.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Get storefront user roles.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Remove storefront user.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Revoke storefront roles.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/folder.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Storefront Permissions API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Create custom storefront resource.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Delete custom storefront resource.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/List storefront resources.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/folder.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Create storefront role.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Delete storefront role.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Edit storefront role resources.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Fetch storefront role by ID.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/List storefront roles.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/folder.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign one storefront role.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign storefront roles or create user with storefront roles.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Check storefront user resource access.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user details.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by ID.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by email.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Remove storefront user.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Revoke storefront role from user.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/folder.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Storefront Roles API/opencollection.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Get report status by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Request report by update.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by Status.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by date.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by order date.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by schedule.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Report/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Edit Subscriptions settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Get Subscriptions Settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Settings/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Add Subscription item by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Cancel Subscription by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Conversation Message by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Next purchase.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Simulation by subscription-group.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Subscription by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get addresses by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get frequency options by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get payment System by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get subscription group list.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Insert Addresses by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List 'Will create' by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List All subscription groups.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List Subscription group's Configuration.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Retry subscription by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Update Subscription by groupId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Cancel Subscriptions by SubscriptionId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get Subscription List.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get frequency options by subscriptionId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Insert Addresses for Subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve customer's subscriptions.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve subscription by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Update Subscriptions by SubscriptionId.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v2)/opencollection.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Get cycle details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/List cycles.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Retry cycle.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Plans/Get plan details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Plans/List plans.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Plans/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Generate report.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Get report document details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Reports/List report templates.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Reports/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Edit subscriptions settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Get subscriptions settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Settings/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Add item to subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for a subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for the provided subscription template.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Create subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Edit item from subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get conversation messages.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get subscription details by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/List subscriptions.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Remove item from subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Update subscription by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API (v3)/opencollection.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Cycles/Get cycle details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Cycles/List cycles.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Cycles/Retry cycle.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Cycles/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Plans/Get plan details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Plans/List plans.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Plans/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Reports/Generate report.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Reports/Get report document details.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Reports/List report templates.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Reports/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Settings/Edit subscriptions settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Settings/Get subscriptions settings.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Settings/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Add item to subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for a subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for the provided subscription template.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Create subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Edit item from subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get conversation messages.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get subscription details by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/List subscriptions.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Remove item from subscription.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Update subscription by ID.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/folder.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Subscriptions API v3/opencollection.yml create mode 100644 BrunoCollections/VTEX - Template openAPI/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Template openAPI/opencollection.yml create mode 100644 BrunoCollections/VTEX - Template openAPI/undefined/folder.yml create mode 100644 BrunoCollections/VTEX - Tracking/Authentication/Asynchronous login.yml create mode 100644 BrunoCollections/VTEX - Tracking/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by ID.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by invoice.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list by route.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service with route scheduling.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/Remove packing list.yml create mode 100644 BrunoCollections/VTEX - Tracking/Delivery services/folder.yml create mode 100644 BrunoCollections/VTEX - Tracking/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - Tracking/opencollection.yml create mode 100644 BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/Erase customer data.yml create mode 100644 BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/folder.yml create mode 100644 BrunoCollections/VTEX - User Data Rights API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - User Data Rights API/opencollection.yml create mode 100644 BrunoCollections/VTEX - User Rights API/Data erasure/Create data erasure job.yml create mode 100644 BrunoCollections/VTEX - User Rights API/Data erasure/Get data erasure job status.yml create mode 100644 BrunoCollections/VTEX - User Rights API/Data erasure/folder.yml create mode 100644 BrunoCollections/VTEX - User Rights API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - User Rights API/opencollection.yml create mode 100644 BrunoCollections/VTEX - User Rights Data API/User Data Rights/Delete user data.yml create mode 100644 BrunoCollections/VTEX - User Rights Data API/User Data Rights/folder.yml create mode 100644 BrunoCollections/VTEX - User Rights Data API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - User Rights Data API/opencollection.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Note/Create note.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Note/Get notes by order ID.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Note/Retrieve note.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Note/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/Add comment on a task.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/Create task.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/List tasks.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/Retrieve task.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/Update task.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/Task/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - VTEX Do API/opencollection.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Check authenticated user.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Enable or disable repeated passwords.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Exchange OAuth access token for VTEX credential.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Expire user password.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Generate authentication token.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/Get user ID by email.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Authentication/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Delete organization unit authentication setting.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Get organization unit authentication settings.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Set organization unit authentication settings.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Update organization unit authentication settings.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Organization account authentication/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Password migration/Delete password migration configuration.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Password migration/Enable or disable password migration.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Password migration/Upsert password migration configuration.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Password migration/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Refresh token.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Send access key.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Start authentication.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Validate session.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Refresh token headless/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Storefront users/Create storefront user.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Storefront users/Get storefront user by identifier.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Storefront users/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Token renewal/Complete token renewal.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Token renewal/Initiate token renewal.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/Token renewal/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - VTEX ID API/opencollection.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/Notification/Notify carrier with app.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/Notification/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/Tracking events with app.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/folder.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - VTEX Shipping Network API/opencollection.yml create mode 100644 BrunoCollections/VTEX - mTLS API/Certificate management/Revoke certificate.yml create mode 100644 BrunoCollections/VTEX - mTLS API/Certificate management/Sign certificate.yml create mode 100644 BrunoCollections/VTEX - mTLS API/Certificate management/folder.yml create mode 100644 BrunoCollections/VTEX - mTLS API/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX - mTLS API/opencollection.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/environments/VTEX.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/opencollection.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/pets/Create a pet.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/pets/Info for a specific pet.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/pets/List all pets.yml create mode 100644 BrunoCollections/VTEX_TEMPLATE/pets/folder.yml create mode 100644 BrunoCollections/_tools/.gitignore create mode 100755 BrunoCollections/_tools/bru-to-opencollection.js create mode 100755 BrunoCollections/_tools/convert.sh create mode 100644 BrunoCollections/_tools/make-workspace.js create mode 100644 BrunoCollections/_tools/package-lock.json create mode 100644 BrunoCollections/_tools/package.json create mode 100755 BrunoCollections/_tools/postman-to-bruno.py create mode 100644 BrunoCollections/workspace.yml diff --git a/BrunoCollections/README.md b/BrunoCollections/README.md new file mode 100644 index 0000000000..12bbc7e4c6 --- /dev/null +++ b/BrunoCollections/README.md @@ -0,0 +1,172 @@ +# Bruno Collections + +[Bruno](https://www.usebruno.com/) versions of the collections in [`PostmanCollections/`](../PostmanCollections), +generated from them by the pipeline in [`_tools/`](_tools). + +Collections are written in the **OpenCollection** format (`opencollection: 1.0.0`) — the YAML +format Bruno now uses by default. Each API is a **separate, self-contained collection**, +mirroring the one-file-per-API layout of `PostmanCollections/`: + +``` +BrunoCollections/ +├── workspace.yml # links all 92 collections; open this to load them at once +└── VTEX - Audience API/ + ├── opencollection.yml # collection manifest, collection-level auth + docs + ├── environments/ + │ └── VTEX.yml # accountName, environment, baseUrl, secrets + └── Audience Manager/ # one folder per Postman folder + ├── folder.yml + └── Fetch audience.yml # one .yml file per request +``` + +A request file looks like this: + +```yaml +info: + name: Fetch audience + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/audience-manager/pvt/audience" + headers: + - name: Content-Type + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("... - Status code is 2xx", function () { ... }); + +settings: + encodeUrl: true + +docs: |- + ... +``` + +## Opening a collection + +**All at once — recommended.** The 92 collections are linked by +[`workspace.yml`](workspace.yml), which Bruno loads through the **workspace switcher in the +title bar** — not through the sidebar's collection menu: + +1. Click the workspace name in the Bruno **title bar** (top of the window, showing + *My Workspace* by default). +2. Under the **Workspaces** heading, choose **Open workspace**. +3. Select the `BrunoCollections/` directory itself. + +All 92 collections appear in the sidebar together. + +**A single API.** Use the sidebar's **Open Collection**, navigate *into* `BrunoCollections/`, and +pick the folder you want (for example `BrunoCollections/VTEX - Audience API`). That picker allows +multiple selections, so you can ⌘-click several API folders. + +> **Open Collection** must be pointed at an API folder, never at `BrunoCollections/`. Each API is +> a separate collection and the container is a *workspace*, not a collection, so it holds no +> `opencollection.yml` of its own — selecting it fails with *"The collection is not valid (neither +> bruno.json nor opencollection.yml found)"*. That directory is only openable via **Open +> workspace** above. A third action, **Import Collection**, is different again: it expects a +> Postman/OpenAPI file or a ZIP, and these collections are opened, not imported. + +From the CLI: + +```bash +cd "BrunoCollections/VTEX - Audience API" +bru run . -r --env VTEX +``` + +## Configuring an environment + +Every collection ships a `VTEX` environment holding the variables the requests interpolate: + +| Variable | Purpose | +| --- | --- | +| `accountName` | Your VTEX account name (defaults to `apiexamples`) | +| `environment` | `vtexcommercestable` | +| `baseUrl` | `https://{{accountName}}.{{environment}}.com.br` | +| `apiKey` | Secret — your [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) | + +Select the `VTEX` environment, set `accountName`, and fill in the secret values. + +> **Note:** the source OpenAPI schemas declare only the `X-VTEX-API-AppKey` security scheme, +> so that is all the Postman collections carry and all that was converted. Most VTEX endpoints +> also require an `X-VTEX-API-AppToken` header — add it as a collection-level header, plus an +> `apiToken` secret variable, if you intend to actually call the APIs. + +Secret variables are declared as `secret: true` with no value, so Bruno keeps their values out +of the collection files and out of git. + +## What was converted + +| | | +| --- | --- | +| Collections | 92 | +| Folders | 297 | +| Requests | 1183 | +| Environments | 92 | + +Carried over: HTTP method and URL, path and query parameters (disabled ones marked +`disabled: true`), headers, collection- and request-level auth (`apikey` / `bearer`, with +requests otherwise set to `auth: inherit`), request bodies (JSON, XML, text, form-url-encoded, +multipart, file), and per-request docs. + +**Tests.** The `pm.*` assertions Postman collections carry (generated by +[portman](https://github.com/apideck-libraries/portman)) do not run in Bruno, so all 1126 +test blocks were rewritten against Bruno's `test()` / `expect()` API — status-code, +`Content-Type`, JSON-body, empty-body, header-presence and JSON-schema assertions. The 804 +JSON-schema checks compile through `ajv`, which Bruno bundles and which resolves even under +the default `safe` script sandbox: + +```js +test("... - Schema is valid", function () { + const schema = { /* ... */ }; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; +}); +``` + +**Docs.** Each request's `docs` block holds its description, a table of parameter/header +descriptions (the format has no per-parameter comments), and the first `2xx` response example. +Examples larger than 4 KB are referenced rather than inlined, to keep the files readable — the +full set stays available in `PostmanCollections/`. + +### Known gaps + +- Bruno has no equivalent of Postman's saved response examples, so the non-`2xx` examples and + the additional `2xx` ones are not represented here. +- Two requests (`Create/Update multiple SKU promotion`) carry a `file` body with no path, + because the Postman source has none. Pick a file in Bruno before sending them. + +## Regenerating + +`PostmanCollections/` is refreshed automatically by the +[`portman` workflow](../.github/workflows/portman.yml) whenever an OpenAPI schema changes, so +this directory drifts as those files are updated. To rebuild it from the current sources: + +```bash +./BrunoCollections/_tools/convert.sh +``` + +The pipeline runs in two stages: + +1. [`_tools/postman-to-bruno.py`](_tools/postman-to-bruno.py) turns the Postman v2.1 JSON into + Bruno `.bru` files in a scratch directory — this is where the URL building, test translation + and docs assembly happen. +2. [`_tools/bru-to-opencollection.js`](_tools/bru-to-opencollection.js) rewrites those into the + OpenCollection `.yml` files that ship here, using + [`@usebruno/filestore`](https://www.npmjs.com/package/@usebruno/filestore) — the same package + the Bruno app and the `bru` CLI use to write these files, so the output tracks the format + rather than a hand-rolled approximation of it. + +3. [`_tools/make-workspace.js`](_tools/make-workspace.js) writes the `workspace.yml` that links + the generated collections, matching the file Bruno itself writes when it edits a workspace. + +The `.bru` tree is an intermediate and is discarded. `convert.sh` installs the Node dependencies +on first run (`_tools/node_modules/`, git-ignored) and needs `python3` and `node`. It rewrites +the collection directories from scratch, so local edits to the generated files are discarded; +`README.md` and `_tools/` are left alone. diff --git a/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad clicks.yml b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad clicks.yml new file mode 100644 index 0000000000..31ad17d2a7 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad clicks.yml @@ -0,0 +1,91 @@ +info: + name: Track ad clicks + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/v1/beacon/click/:ad_id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pos + value: "1" + type: query + disabled: true + - name: ad_id + value: 4a94bc6e-7db1-425f-8430-cb4d17488b3b + type: path + body: + type: json + data: |- + { + "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/v1/beacon/click/:ad_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/v1/beacon/click/:ad_id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/v1/beacon/click/:ad_id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/v1/beacon/click/:ad_id - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Track when a user clicks on an ad. The event URL must not be constructed manually — always use the URL provided from `POST` [Get ads](https://developers.vtex.com/docs/api-reference/vtex-ads-api#post-/v1/rma/-publisher_id-). + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ad_id` | path | (Required) Unique identifier of the ad. | + | `pos` | query | Position of the ad. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "click will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad impressions.yml b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad impressions.yml new file mode 100644 index 0000000000..852e1fa50e --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad impressions.yml @@ -0,0 +1,93 @@ +info: + name: Track ad impressions + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/v1/beacon/impression/:ad_id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pos + value: "1" + type: query + disabled: true + - name: ad_id + value: 4a94bc6e-7db1-425f-8430-cb4d17488b3b + type: path + body: + type: json + data: |- + { + "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/v1/beacon/impression/:ad_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/v1/beacon/impression/:ad_id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/v1/beacon/impression/:ad_id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/v1/beacon/impression/:ad_id - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Track when an ad is rendered on a page. An impression does not determine whether the ad became visible to the user. Visibility is tracked by the separate `view` event. Do not construct the event URL manually. Always use the URL provided from `POST` [Get ads](https://developers.vtex.com/docs/api-reference/vtex-ads-api#post-/v1/rma/-publisher_id-). + + >ℹ️ Fire this event whenever a page loads that contains rendered ads. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ad_id` | path | (Required) Unique identifier of the ad. | + | `pos` | query | Position of the ad. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "impression will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad views.yml b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad views.yml new file mode 100644 index 0000000000..44330b9f5d --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads events notification/Track ad views.yml @@ -0,0 +1,93 @@ +info: + name: Track ad views + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/v1/beacon/view/:ad_id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pos + value: "1" + type: query + disabled: true + - name: ad_id + value: 4a94bc6e-7db1-425f-8430-cb4d17488b3b + type: path + body: + type: json + data: |- + { + "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/v1/beacon/view/:ad_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/v1/beacon/view/:ad_id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/v1/beacon/view/:ad_id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/v1/beacon/view/:ad_id - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Track when an ad becomes visible to the user. Do not construct the event URL manually. Always use the URL provided from `POST` [Get ads](https://developers.vtex.com/docs/api-reference/vtex-ads-api#post-/v1/rma/-publisher_id-). + + >ℹ️ Fire this event when the ad occupies at least 50% of the viewport for at least 1 second. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ad_id` | path | (Required) Unique identifier of the ad. | + | `pos` | query | Position of the ad. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "view will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Ads events notification/Track conversions.yml b/BrunoCollections/VTEX - Ads API/Ads events notification/Track conversions.yml new file mode 100644 index 0000000000..bd709f0b3e --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads events notification/Track conversions.yml @@ -0,0 +1,113 @@ +info: + name: Track conversions + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/v1/beacon/conversion" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "publisher_id": "xxx", + "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc", + "session_id": "5898b8d1-c250-4bb5-931b-8b9d0ee7b499", + "order_id": "123", + "email_hashed": "xyz", + "items": [ + { + "sku": "12221", + "quantity": 1, + "price": 2000, + "promotional_price": 1899, + "seller_id": "1234", + "product_id": "4567" + }, + { + "sku": "12222", + "quantity": 2, + "price": 1500, + "promotional_price": 1200, + "seller_id": "1234", + "product_id": "4568" + } + ], + "created_at": "2026-01-01T09:20:00Z", + "channel": "ecommerce", + "is_company": false, + "gender": "M", + "uf": "SP", + "city": "São Paulo", + "phone_hashed": "abc123", + "social_id_hashed": "def456", + "first_name_hashed": "ghi789", + "last_name_hashed": "jkl012" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/v1/beacon/conversion - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/v1/beacon/conversion - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/v1/beacon/conversion - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/v1/beacon/conversion - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Track completed sales for conversion attribution. Send this event for every completed sale, regardless of whether an ad led to the purchase. Notifying all sales enables attribution within time windows after ad-impacted navigation and metrics such as assisted sales. Send one or more orders in a batch request. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "conversion will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Ads events notification/folder.yml b/BrunoCollections/VTEX - Ads API/Ads events notification/folder.yml new file mode 100644 index 0000000000..74de8ebb30 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads events notification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Ads events notification + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Ads API/Ads/Get ads.yml b/BrunoCollections/VTEX - Ads API/Ads/Get ads.yml new file mode 100644 index 0000000000..9cd542698b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads/Get ads.yml @@ -0,0 +1,146 @@ +info: + name: Get ads + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/v1/rma/:publisher_id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: publisher_id + value: 0d675bf6-03f6-4b81-9617-e79dffddc3ab + type: path + body: + type: json + data: |- + { + "session_id": "f361661f5986477990092a34562f18347", + "user_id": "6a746448cf5942bcaa3da426844ad115", + "context": "search", + "channel": "site", + "term": "desodorante", + "placements": { + "searchTopBanner": { + "quantity": 1, + "size": "desktop", + "types": [ + "banner" + ], + "assets_type": [ + "image" + ] + }, + "searchShelf": { + "quantity": 3, + "types": [ + "product" + ] + } + }, + "tags": [ + "Mega Maio" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/v1/rma/:publisher_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/v1/rma/:publisher_id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/v1/rma/:publisher_id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/v1/rma/:publisher_id - Schema is valid", function () { + const schema = {"type":"object","additionalProperties":{"type":"array","description":"List of ads for a specific placement.","items":{"type":"object","description":"Ad object.","properties":{"ad_id":{"type":"string","description":"Unique identifier of the ad."},"media_url":{"type":"string","description":"URL of the image or video to be displayed. Present for banner, sponsored_brand, and digital_signage ad types."},"type":{"type":"string","description":"Type of ad.","enum":["banner","product","sponsored_brand","digital_signage"]},"seller_id":{"type":["string","null"],"description":"Identifier of the seller."},"click_url":{"type":"string","description":"URL of the click event beacon for the ad."},"impression_url":{"type":"string","description":"URL of the impression event beacon for the ad."},"view_url":{"type":"string","description":"URL of the view event beacon for the ad."},"product_sku":{"type":"string","description":"Product identifier. Present when ad type is 'product'."},"products":{"type":"array","description":"Array of products associated with the sponsored brand. Present when ad type is 'sponsored_brand'.","items":{"type":"object","description":"Product associated with the sponsored brand.","properties":{"product_sku":{"type":"string","description":"SKU of the associated product."},"media_url":{"type":"string","description":"URL of the product image."}}}},"duration":{"type":"number","description":"Duration of the ad display in seconds. Present when ad type is 'digital_signage'.","format":"double"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve Product and Banner ad formats based on context and placements. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Request best practices + + - **HTTP persistence:** Prefer persistent connections (`Connection: keep-alive`). + - **Timeout:** Apply a 500-600 ms timeout to the ad query. + + ## Context-specific fields + + The `context` value determines which additional fields are required in the request body. The example below uses the `search` context — adapt it to your context using the table below. Include only the fields listed for your context (in addition to the common required fields `session_id`, `context`, `channel`, and `placements`). + + | `context` | Additional required fields | Notes | + | --- | --- | --- | + | `home` | None | Use generic placements (top banner, home shelf). | + | `category` | `category_name` | Provide the full breadcrumb path (for example, `Daily Care > Deodorant > Spray`). | + | `search` | `term` | Send the search query. Optionally pass `tags` to scope eligible ads. | + | `product_page` | `product_sku` | SKU of the product currently being viewed. | + | `brand_page` | `brand_name` | Name of the brand. Pair with `sponsored_brand` placements when applicable. | + | `digital_signage` | `device_id`, `store_name` | Use `digital_signage` placements and the `app` channel. | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `publisher_id` | path | (Required) Publisher identifier provided by your account manager | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "placementName1": [ + { + "ad_id": "6d2d8837-bf5a-4ba4-90d2-5546cb18d5ce", + "media_url": "https://cdn.newtail.com.br/retail_media/ads/2023/05/03/f97a938660e56fe38a9c9ade21c27df8-1280x256-red.png", + "type": "banner", + "click_url": "https://events.newtail-media.newtail.com.br/v1/beacon/click/6d2d8837-bf5a-4ba4-90d2-5546cb18d5ce?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=banner", + "impression_url": "https://events.newtail-media.newtail.com.br/v1/beacon/impression/6d2d8837-bf5a-4ba4-90d2-5546cb18d5ce?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=banner", + "view_url": "https://events.newtail-media.newtail.com.br/v1/beacon/view/6d2d8837-bf5a-4ba4-90d2-5546cb18d5ce?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=banner" + } + ], + "placementName2": [ + { + "ad_id": "846fbf5e-6980-4a5e-a4a1-9b2a2dcbafb7", + "product_sku": "10001236", + "type": "product", + "click_url": "https://events.newtail-media.newtail.com.br/v1/beacon/click/846fbf5e-6980-4a5e-a4a1-9b2a2dcbafb7?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=product", + "impression_url": "https://events.newtail-media.newtail.com.br/v1/beacon/impression/846fbf5e-6980-4a5e-a4a1-9b2a2dcbafb7?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=product", + "view_url": "https://events.newtail-media.newtail.com.br/v1/beacon/view/846fbf5e-6980-4a5e-a4a1-9b2a2dcbafb7?publisher_id=0d675bf6-03f6-4b81-9617-e79dffddc3ab&ad_type=product" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Ads/folder.yml b/BrunoCollections/VTEX - Ads API/Ads/folder.yml new file mode 100644 index 0000000000..c409bdd501 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Ads/folder.yml @@ -0,0 +1,4 @@ +info: + name: Ads + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Ads API/Audiences/Generate audience upload URL.yml b/BrunoCollections/VTEX - Ads API/Audiences/Generate audience upload URL.yml new file mode 100644 index 0000000000..a6e4b1f7fb --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Audiences/Generate audience upload URL.yml @@ -0,0 +1,88 @@ +info: + name: Generate audience upload URL + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/audience/upload-url" + headers: + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/audience/upload-url - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/audience/upload-url - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/audience/upload-url - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/audience/upload-url - Schema is valid", function () { + const schema = {"type":"object","properties":{"url":{"type":"string","description":"Amazon S3 endpoint the publisher must send the multipart upload request to."},"fields":{"type":"object","description":"Signed Amazon S3 form fields that must be included in the upload request, before the `file` field.","additionalProperties":{"type":"string","description":"Value of a signed Amazon S3 form field (for example, policy, signature, or credential)."}},"key":{"type":"string","description":"Object key the file will be stored under. Generated by the backend from the authenticated publisher."},"bucket":{"type":"string","description":"Name of the Amazon S3 bucket that receives the upload."},"expires_in":{"type":"integer","description":"Number of seconds the pre-signed `POST` remains valid.","default":900},"max_bytes":{"type":"integer","description":"Maximum file size, in bytes, accepted by Amazon S3. Larger files are rejected.","default":2147483648},"upload":{"type":"object","description":"Hints describing how to perform the follow-up upload request.","properties":{"method":{"type":"string","description":"HTTP method to use for the upload request."},"enctype":{"type":"string","description":"Encoding type to use for the upload request."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a short-lived pre-signed Amazon S3 `POST` that lets a publisher upload an audience file without long-lived credentials. The response carries the destination `url` and the signed `fields` that must accompany the upload. + + The backend builds the object `key` from the authenticated publisher, so a publisher cannot write to another publisher's path. The pre-signed `POST` is valid for `expires_in` seconds (900 by default) and Amazon S3 rejects files larger than `max_bytes` (2 GiB by default). + + >ℹ️ The file upload itself is a separate multipart `POST` request sent directly to Amazon S3 with the returned `url` and `fields`. It is not part of this API. See [Integrating audiences](https://developers.vtex.com/docs/guides/integrating-audiences) for the full flow, file format, and PII hashing rules. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "url": "https://newtail-data-clean-room.s3.amazonaws.com/", + "fields": { + "key": "0d675bf6-03f6-4b81-9617-e79dffddc3ab/audiences/2026/06/03/14/1717340000.parquet.snappy", + "Content-Type": "application/octet-stream", + "Policy": "eyJleHBpcmF0aW9uIjoiMjAyNi0wNi0wM1QxNDoxNTowMFoiLCJjb25kaXRpb25zIjpbXX0=", + "X-Amz-Signature": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2" + }, + "key": "0d675bf6-03f6-4b81-9617-e79dffddc3ab/audiences/2026/06/03/14/1717340000.parquet.snappy", + "bucket": "newtail-data-clean-room", + "expires_in": 900, + "max_bytes": 2147483648, + "upload": { + "method": "POST", + "enctype": "multipart/form-data" + } + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Audiences/folder.yml b/BrunoCollections/VTEX - Ads API/Audiences/folder.yml new file mode 100644 index 0000000000..09c6704040 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Audiences/folder.yml @@ -0,0 +1,4 @@ +info: + name: Audiences + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize inventory information.yml b/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize inventory information.yml new file mode 100644 index 0000000000..71ee03a1b9 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize inventory information.yml @@ -0,0 +1,95 @@ +info: + name: Synchronize inventory information + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/product/bulk/inventories" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "product_sku": "120210", + "store_id": "1", + "price": 18.2, + "promotional_price": 16.32, + "is_available": true + }, + { + "product_sku": "120212", + "price": 18.2, + "promotional_price": 0, + "is_available": true + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/product/bulk/inventories - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/product/bulk/inventories - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/product/bulk/inventories - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/product/bulk/inventories - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Update inventory information, which defines the price, promotional price, and product availability. + + >⚠️ For each batch insert/update, a maximum of 500 objects per request and three simultaneous requests are allowed. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "inventory will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize product information.yml b/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize product information.yml new file mode 100644 index 0000000000..9c937d3b0b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Catalog synchronization/Synchronize product information.yml @@ -0,0 +1,115 @@ +info: + name: Synchronize product information + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/product/bulk/products" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "product_sku": "sample-120210", + "name": "TechBrand Laptop Model X-15 4GB 256GB SSD 15.6\" Display Windows 11 - Gray", + "url": "https://www.example.com/product/4100903080", + "image_url": "https://images.example.com/products/01/00/img/4100903/1/4100903143_1GG.jpg", + "categories": [ + "Computers", + "Laptops" + ], + "brand": "TechBrand", + "gtins": [ + "7898915633481" + ], + "metadata": { + "key": "value1" + } + }, + { + "product_sku": "sample-120211", + "name": "TechBrand Laptop Model X-15 4GB 256GB SSD 15.6\" Display Windows 11 - Gray", + "url": "https://www.example.com/product/4100903080", + "categories": [ + "Computers", + "Laptops" + ], + "brand": "TechBrand", + "gtins": [ + "7898915633481" + ], + "tags": [ + "Mega Maio" + ] + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/product/bulk/products - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/product/bulk/products - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/product/bulk/products - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/product/bulk/products - Schema is valid", function () { + const schema = {"type":"object","properties":{"messages":{"type":"array","description":"List of messages from the server.","items":{"type":"string","description":"Message from the server."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the basic product data in the VTEX Ads catalog. + + >⚠️ For each batch insert/update, a maximum of 500 objects per request and 3 simultaneous requests are allowed. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "messages": [ + "products will be processed soon" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Catalog synchronization/folder.yml b/BrunoCollections/VTEX - Ads API/Catalog synchronization/folder.yml new file mode 100644 index 0000000000..556fe355ad --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Catalog synchronization/folder.yml @@ -0,0 +1,4 @@ +info: + name: Catalog synchronization + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Ads API/Credit transfer/Notify credit transfer status.yml b/BrunoCollections/VTEX - Ads API/Credit transfer/Notify credit transfer status.yml new file mode 100644 index 0000000000..918e56c29b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Credit transfer/Notify credit transfer status.yml @@ -0,0 +1,66 @@ +info: + name: Notify credit transfer status + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/webhook/marketplace/transfers/:publisher_id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: publisher_id + value: 0d675bf6-03f6-4b81-9617-e79dffddc3ab + type: path + body: + type: json + data: |- + { + "transaction_id": "TRANSACTION_ID", + "status": "success" + } + auth: + type: apikey + key: X-Api-Key + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/webhook/marketplace/transfers/:publisher_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/webhook/marketplace/transfers/:publisher_id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Notifies VTEX Ads about the final status of a credit transfer that was previously requested by VTEX Ads to the marketplace's `POST /checking_account/transfer` endpoint. The marketplace must call this webhook with the resolved status of each transfer transaction. + + >⚠️ In case of a webhook call failure, the marketplace must retry until a `204 No Content` response is received. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `publisher_id` | path | (Required) Publisher identifier provided by your account manager. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Ads API/Credit transfer/folder.yml b/BrunoCollections/VTEX - Ads API/Credit transfer/folder.yml new file mode 100644 index 0000000000..8800316ae7 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Credit transfer/folder.yml @@ -0,0 +1,4 @@ +info: + name: Credit transfer + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get ads performance report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get ads performance report.yml new file mode 100644 index 0000000000..2590e5812b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get ads performance report.yml @@ -0,0 +1,242 @@ +info: + name: Get ads performance report + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/ad/results/v2?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: campaign_name + value: Holiday Sale + type: query + disabled: true + - name: campaign_id + value: campaign-id + type: query + disabled: true + - name: advertiser_id + value: advertiser-id + type: query + disabled: true + - name: product_sku + value: SKU-123 + type: query + disabled: true + - name: ad_status + value: enabled + type: query + disabled: true + - name: ad_type + value: banner + type: query + disabled: true + - name: targeting_type + value: category + type: query + disabled: true + - name: show_inactive + value: "false" + type: query + disabled: true + - name: account_info + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "false" + type: query + disabled: true + - name: order_by + value: income + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/ad/results/v2 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/ad/results/v2 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/ad/results/v2 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/ad/results/v2 - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of ads."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of ad objects.","items":{"type":"object","description":"Ad object.","properties":{"id":{"type":"string","description":"Unique ad identifier."},"campaign_id":{"type":"string","description":"Associated campaign identifier."},"url":{"type":"string","description":"Ad destination URL."},"settings":{"type":"object","description":"Ad-specific settings object. The fields are dynamic and may vary depending on the ad type.","properties":{"cpc":{"type":"number","description":"Cost per click value.","format":"double"},"cpm":{"type":"number","description":"Cost per mille value.","format":"double"},"type":{"type":"string","description":"Ad type."},"categories":{"type":"array","description":"Targeted categories array.","items":{"type":"string","description":"Category name."}},"keywords":{"type":"array","description":"Targeted keywords array.","items":{"type":"string","description":"Keyword."}}}},"disabled_at":{"type":["string","null"],"description":"Ad disabled date in ISO 8601 format."},"created_at":{"type":"string","description":"Ad creation date in ISO 8601 format."},"updated_at":{"type":"string","description":"Ad last update date in ISO 8601 format."},"deleted_at":{"type":["string","null"],"description":"Ad deletion date in ISO 8601 format."},"status":{"type":"string","description":"Ad status."},"aid":{"type":"integer","description":"Ad internal ID."},"asset_type":{"type":"string","description":"Asset type (for example, `image`, `video`)."},"active":{"type":"boolean","description":"Whether the ad is active."},"product_id":{"type":["string","null"],"description":"Associated product identifier (when applicable)."},"product_sku":{"type":["string","null"],"description":"Associated product SKU (when applicable)."},"name":{"type":["string","null"],"description":"Product name (when applicable)."},"image_url":{"type":["string","null"],"description":"Product image URL (when applicable)."},"categories":{"type":"array","description":"Ad categories array (when applicable).","items":{"type":"string","description":"Category name."}},"campaign_name":{"type":"string","description":"Associated campaign name."},"ad_type":{"type":"string","description":"Advertisement type."},"campaign_status":{"type":"string","description":"Associated campaign status."},"campaign_settings":{"type":"object","description":"Associated campaign settings. The fields are dynamic and may vary depending on the campaign type.","properties":{"daily_budget":{"type":"number","description":"Daily budget amount.","format":"double"},"cpm":{"type":"number","description":"Cost per mille value.","format":"double"},"budget_type":{"type":"string","description":"Budget distribution type."}}},"publisher_id":{"type":"string","description":"Publisher identifier."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"advertiser_name":{"type":"string","description":"Advertiser name."},"advertiser_account_id":{"type":"string","description":"Advertiser account identifier."},"publisher_name":{"type":"string","description":"Publisher name."},"publisher_account_id":{"type":"string","description":"Publisher account identifier."},"ad_id":{"type":"string","description":"Unique identifier of the ad."},"conversions_quantity":{"type":"string","description":"Total quantity of conversions."},"is_running":{"type":"boolean","description":"Whether the ad is currently running."},"advertiser_tags":{"type":["array","null"],"description":"Tags associated with the advertiser.","items":{"type":"string","description":"Advertiser tag."}},"pending":{"type":"array","description":"Pending operations awaiting review for this campaign/ad. Empty when there is nothing pending.","items":{"type":"object","description":"Pending operation entry, grouping a `label` with its `quantity`.","properties":{"label":{"type":"string","description":"Type of pending operation. Currently, only `ads` is returned, indicating ads awaiting review.","enum":["ads"]},"quantity":{"type":"integer","description":"Number of pending items of the given `label`."}}}},"metrics":{"type":"object","description":"Ad performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"clicks":{"type":"string","description":"Total number of clicks."},"conversions":{"type":"string","description":"Total number of conversions."},"total_conversions_items_quantity":{"type":"string","description":"Total quantity of items across all ad-driven conversions. Sums the quantities of every item in each conversion event (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 2)."},"impressions":{"type":"string","description":"Total number of impressions."},"views":{"type":"string","description":"Total number of views."},"conversions_click":{"type":"string","description":"Number of conversions attributed to clicks."},"conversions_view":{"type":"string","description":"Number of conversions attributed to views."},"conversion_rate":{"type":"string","description":"Consolidated conversion rate percentage, calculated as total conversions divided by the sum of clicks and views (`total_conversions / (total_clicks + total_views)`). This is the default conversion rate and considers both click- and view-attributed conversions."},"conversion_rate_click":{"type":"string","description":"Conversion rate percentage considering click-attributed conversions only, calculated as `conversions_click / total_clicks`."},"conversion_rate_view":{"type":"string","description":"Conversion rate percentage considering view-attributed conversions only, calculated as `conversions_view / total_views`."},"ctr":{"type":"string","description":"Click-through rate percentage."},"roas":{"type":"string","description":"Consolidated return on ad spend, combining click- and view-attributed revenue across all ad formats."},"roas_click":{"type":"string","description":"Return on ad spend calculated using click-attributed revenue only."},"roas_view":{"type":"string","description":"Return on ad spend calculated using view-attributed revenue only."},"roas_halo":{"type":"string","description":"Halo return on ad spend: incremental revenue from non-advertised products purchased in the same order as advertised products (the halo effect), divided by ad spend."},"roas_overall":{"type":"string","description":"Total return on ad spend, combining direct revenue from the advertised product with halo revenue from other products in the same order, divided by the ad investment. Measures the campaign's total impact on the whole order."},"adcost":{"type":"string","description":"Ad cost percentage."},"income":{"type":"string","description":"Total income generated."},"total_spent":{"type":"string","description":"Total amount spent."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"halo_revenue":{"type":"string","description":"Incremental revenue from non-advertised products that were purchased in the same order as an advertised product, attributed to the ad's spillover (halo) effect."},"halo_orders":{"type":"string","description":"Number of orders with at least one halo item."},"halo_items":{"type":"string","description":"Quantity of halo items sold."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fetches all available ads, applying filters as needed. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ Paused ads are excluded from the default response. To include paused ads, set `show_inactive=true`. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `campaign_name` | query | Filters ads by campaign name. | + | `campaign_id` | query | Filters ads by campaign ID. | + | `advertiser_id` | query | Filters ads by advertiser ID. | + | `product_sku` | query | Filters ads by product SKU. | + | `ad_status` | query | Filters ads by status. | + | `ad_type` | query | Filters by ad type. | + | `targeting_type` | query | Filters by targeting type. | + | `show_inactive` | query | If `true`, includes paused ads. | + | `account_info` | query | If `true`, includes detailed account information in the result. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns the total number of available records. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "ad-id", + "campaign_id": "campaign-id", + "url": "ad-url", + "settings": { + "cpc": 1.5, + "type": "banner", + "categories": [], + "keywords": [ + "keyword", + "other keyword" + ] + }, + "disabled_at": null, + "created_at": "2025-01-27T23:18:16.330Z", + "updated_at": "2025-01-27T23:18:16.330Z", + "deleted_at": null, + "status": "enabled", + "aid": 1234, + "asset_type": "image", + "active": true, + "product_id": null, + "product_sku": null, + "name": null, + "image_url": null, + "categories": [ + "National Beers", + "National Beers > Drinks" + ], + "campaign_name": "Campaign Name", + "ad_type": "banner", + "campaign_status": "running", + "campaign_settings": { + "daily_budget": 185000, + "cpm": 10000, + "budget_type": "evenly" + }, + "publisher_id": "publisher-id", + "advertiser_id": "advertiser-id", + "advertiser_name": "Advertiser Name", + "advertiser_account_id": "advertiser-account-id", + "publisher_name": "Publisher Name", + "publisher_account_id": "publisher-account-id", + "ad_id": "ad-id", + "conversions_quantity": "1", + "is_running": true, + "advertiser_tags": null, + "pending": [], + "metrics": { + "clicks": "53", + "conversions": "1", + "total_conversions_items_quantity": "1", + "impressions": "2900", + "views": "2689", + "conversions_click": "1", + "conversions_view": "0", + "conversion_rate": "0.04", + "conversion_rate_click": "1.89", + "conversion_rate_view": "0.00", + "ctr": "1.83", + "roas": "0.18", + "roas_click": "0.12", + "roas_view": "0.06", + "roas_halo": "0.07", + "roas_overall": "0.25", + "adcost": "540.94", + "income": "5361.00", + "total_spent": "29000.0000", + "ecpm": "1.85", + "cpa": "29000.00", + "avg_cpc": "547.17", + "avg_cpm": "10000.00", + "halo_revenue": "2100.00", + "halo_orders": "1", + "halo_items": "2" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get advertiser ads detailed report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get advertiser ads detailed report.yml new file mode 100644 index 0000000000..bca4fd4078 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get advertiser ads detailed report.yml @@ -0,0 +1,222 @@ +info: + name: Get advertiser ads detailed report + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/report/advertisers/ads-detailed?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: campaign_name + value: Holiday Sale + type: query + disabled: true + - name: campaign_id + value: campaign-id + type: query + disabled: true + - name: publisher_id + value: publisher-id + type: query + disabled: true + - name: advertiser_id + value: advertiser-id + type: query + disabled: true + - name: product_sku + value: SKU-123 + type: query + disabled: true + - name: ad_status + value: enabled + type: query + disabled: true + - name: ad_type + value: product + type: query + disabled: true + - name: targeting_type + value: category + type: query + disabled: true + - name: tag_id + value: tag-id + type: query + disabled: true + - name: sub_publisher_id + value: subpublisher-id + type: query + disabled: true + - name: sub_publisher_name + value: Subpublisher Name + type: query + disabled: true + - name: show_inactive + value: "false" + type: query + disabled: true + - name: hide_pending_rejected + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "true" + type: query + disabled: true + - name: order_by + value: income + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/report/advertisers/ads-detailed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/report/advertisers/ads-detailed - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/report/advertisers/ads-detailed - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/report/advertisers/ads-detailed - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of ads."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of detailed ad objects.","items":{"type":"object","description":"Detailed ad object.","properties":{"id":{"type":"string","description":"Unique ad identifier."},"campaign_id":{"type":"string","description":"Associated campaign identifier."},"url":{"type":"string","description":"Ad destination URL."},"status":{"type":"string","description":"Ad status."},"active":{"type":"boolean","description":"Whether the ad is active."},"product_sku":{"type":["string","null"],"description":"Associated product SKU (when applicable)."},"campaign_name":{"type":"string","description":"Associated campaign name."},"campaign_status":{"type":"string","description":"Associated campaign status."},"ad_type":{"type":"string","description":"Advertisement type."},"publisher_id":{"type":"string","description":"Publisher identifier."},"publisher_name":{"type":"string","description":"Publisher name."},"publisher_account_id":{"type":"string","description":"Publisher account identifier."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"advertiser_name":{"type":"string","description":"Advertiser name."},"advertiser_account_id":{"type":"string","description":"Advertiser account identifier."},"sub_publisher_id":{"type":["string","null"],"description":"Subpublisher identifier (only present for network campaigns)."},"sub_publisher_name":{"type":["string","null"],"description":"Subpublisher name (only present for network campaigns)."},"sub_publisher_account_id":{"type":["string","null"],"description":"Subpublisher account identifier (only present for network campaigns)."},"metrics":{"type":"object","description":"Ad performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"clicks":{"type":"string","description":"Total number of clicks."},"conversions":{"type":"string","description":"Total number of conversions."},"total_conversions_items_quantity":{"type":"string","description":"Total quantity of items across all ad-driven conversions. Sums the quantities of every item in each conversion event (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 2)."},"impressions":{"type":"string","description":"Total number of impressions."},"views":{"type":"string","description":"Total number of views."},"conversion_rate":{"type":"string","description":"Conversion rate percentage."},"ctr":{"type":"string","description":"Click-through rate percentage."},"roas":{"type":"string","description":"Return on ad spend."},"adcost":{"type":"string","description":"Ad cost percentage."},"income":{"type":"string","description":"Total income generated."},"total_spent":{"type":"string","description":"Total amount spent."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Exports a detailed ad report for advertiser accounts, including subpublisher breakdown for network campaigns. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ This route is intended for advertiser accounts. Non-network campaigns return one row per ad, while network campaigns return one row per `ad + subpublisher`. For non white-label accounts, only non-private publisher rows are returned. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `campaign_name` | query | Filters ads by campaign name. | + | `campaign_id` | query | Filters ads by campaign ID. | + | `publisher_id` | query | Filters ads by publisher ID. | + | `advertiser_id` | query | Filters ads by advertiser ID. In the BFF flow, this value is derived from the authenticated advertiser context. | + | `product_sku` | query | Filters ads by product SKU. | + | `ad_status` | query | Filters ads by status. | + | `ad_type` | query | Filters by ad type. | + | `targeting_type` | query | Filters by targeting type. | + | `tag_id` | query | Filters by advertiser tag ID. | + | `sub_publisher_id` | query | Filters network rows by subpublisher ID. | + | `sub_publisher_name` | query | Filters network rows by subpublisher name. | + | `show_inactive` | query | If `true`, includes paused ads. | + | `hide_pending_rejected` | query | If `true`, excludes `pending_review` and `rejected` rows when `ad_status` is not provided. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns pagination metadata. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "ad-id", + "campaign_id": "campaign-id", + "url": "https://example.com/product", + "status": "enabled", + "active": true, + "product_sku": "SKU-123", + "campaign_name": "Campaign Name", + "campaign_status": "running", + "ad_type": "product", + "publisher_id": "publisher-id", + "publisher_name": "Publisher Name", + "publisher_account_id": "publisher-account-id", + "advertiser_id": "advertiser-id", + "advertiser_name": "Advertiser Name", + "advertiser_account_id": "advertiser-account-id", + "sub_publisher_id": "subpublisher-id", + "sub_publisher_name": "Subpublisher Name", + "sub_publisher_account_id": "subpublisher-account-id", + "metrics": { + "clicks": "3", + "conversions": "1", + "total_conversions_items_quantity": "2", + "impressions": "10691", + "views": "0", + "conversion_rate": "33.33", + "ctr": "0.03", + "roas": "2.64", + "adcost": "37.87", + "income": "818.00", + "total_spent": "309.82000000", + "ecpm": "28.98", + "cpa": "309.82", + "avg_cpc": "103.27", + "avg_cpm": "28.98" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get advertiser campaigns detailed report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get advertiser campaigns detailed report.yml new file mode 100644 index 0000000000..00dd20014b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get advertiser campaigns detailed report.yml @@ -0,0 +1,219 @@ +info: + name: Get advertiser campaigns detailed report + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/report/advertisers/campaigns-detailed?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: campaign_id + value: campaign-id + type: query + disabled: true + - name: campaign_status + value: running + type: query + disabled: true + - name: publisher_id + value: publisher-id + type: query + disabled: true + - name: publisher_name + value: MyStore + type: query + disabled: true + - name: ad_type + value: product + type: query + disabled: true + - name: ad_status + value: enabled + type: query + disabled: true + - name: seller_id + value: seller-id + type: query + disabled: true + - name: tag_id + value: tag-id + type: query + disabled: true + - name: targeting_type + value: category + type: query + disabled: true + - name: sub_publisher_id + value: subpublisher-id + type: query + disabled: true + - name: sub_publisher_name + value: Subpublisher Name + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "true" + type: query + disabled: true + - name: order_by + value: income + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/report/advertisers/campaigns-detailed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/report/advertisers/campaigns-detailed - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/report/advertisers/campaigns-detailed - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/report/advertisers/campaigns-detailed - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of campaigns."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of detailed campaign objects.","items":{"type":"object","description":"Detailed campaign object.","properties":{"id":{"type":"string","description":"Unique campaign identifier."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"name":{"type":"string","description":"Campaign name."},"status":{"type":"string","description":"Campaign status."},"type":{"type":"string","description":"Campaign type."},"publisher_id":{"type":"string","description":"Publisher identifier."},"publisher_name":{"type":"string","description":"Publisher name."},"advertiser_name":{"type":"string","description":"Advertiser name."},"sub_publisher_id":{"type":["string","null"],"description":"Subpublisher identifier (only present for network campaigns)."},"sub_publisher_name":{"type":["string","null"],"description":"Subpublisher name (only present for network campaigns)."},"active":{"type":"boolean","description":"Whether the campaign is active."},"daily_budget":{"type":"string","description":"Daily budget amount."},"consumed_budget":{"type":"string","description":"Amount of budget consumed."},"pending":{"type":"array","description":"Pending operations awaiting review for this campaign/ad. Empty when there is nothing pending.","items":{"type":"object","description":"Pending operation entry, grouping a `label` with its `quantity`.","properties":{"label":{"type":"string","description":"Type of pending operation. Currently, only `ads` is returned, indicating ads awaiting review.","enum":["ads"]},"quantity":{"type":"integer","description":"Number of pending items of the given `label`."}}}},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"clicks":{"type":"integer","description":"Total number of clicks."},"conversions":{"type":"integer","description":"Total number of conversions."},"total_conversions_items_quantity":{"type":"integer","description":"Total quantity of converted items."},"impressions":{"type":"integer","description":"Total number of impressions."},"views":{"type":"integer","description":"Total number of views."},"conversions_click":{"type":"string","description":"Number of conversions attributed to clicks."},"conversions_view":{"type":"string","description":"Number of conversions attributed to views."},"conversion_rate":{"type":"string","description":"Consolidated conversion rate percentage, calculated as total conversions divided by the sum of clicks and views (`total_conversions / (total_clicks + total_views)`). This is the default conversion rate and considers both click- and view-attributed conversions."},"conversion_rate_click":{"type":"string","description":"Conversion rate percentage considering click-attributed conversions only, calculated as `conversions_click / total_clicks`."},"conversion_rate_view":{"type":"string","description":"Conversion rate percentage considering view-attributed conversions only, calculated as `conversions_view / total_views`."},"ctr":{"type":"string","description":"Click-through rate percentage."},"roas":{"type":"string","description":"Consolidated return on ad spend, combining click- and view-attributed revenue across all ad formats."},"roas_click":{"type":"string","description":"Return on ad spend calculated using click-attributed revenue only."},"roas_view":{"type":"string","description":"Return on ad spend calculated using view-attributed revenue only."},"roas_halo":{"type":"string","description":"Halo return on ad spend: incremental revenue from non-advertised products purchased in the same order as advertised products (the halo effect), divided by ad spend."},"roas_overall":{"type":"string","description":"Total return on ad spend, combining direct revenue from the advertised product with halo revenue from other products in the same order, divided by the ad investment. Measures the campaign's total impact on the whole order."},"adcost":{"type":"string","description":"Ad cost percentage."},"income":{"type":"string","description":"Total income generated."},"total_spent":{"type":"string","description":"Total amount spent."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"halo_revenue":{"type":"string","description":"Incremental revenue from non-advertised products that were purchased in the same order as an advertised product, attributed to the ad's spillover (halo) effect."},"halo_orders":{"type":"string","description":"Number of orders with at least one halo item."},"halo_items":{"type":"string","description":"Quantity of halo items sold."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Exports a mixed campaign report for advertiser accounts, including both regular campaigns and subpublisher information for network campaigns. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ This route is intended for advertiser accounts. For non white-label accounts, only non-private publisher rows are returned. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `campaign_id` | query | Filters by campaign ID. | + | `campaign_status` | query | Filters by campaign status. | + | `publisher_id` | query | Filters by publisher ID. | + | `publisher_name` | query | Filters by publisher name. | + | `ad_type` | query | Filters by ad type. | + | `ad_status` | query | Filters by ad status. | + | `seller_id` | query | Filters by seller ID. | + | `tag_id` | query | Filters by advertiser tag ID. | + | `targeting_type` | query | Filters by targeting type. | + | `sub_publisher_id` | query | Filters network rows by subpublisher ID. | + | `sub_publisher_name` | query | Filters network rows by subpublisher name. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns pagination metadata. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "campaign-id", + "advertiser_id": "advertiser-id", + "name": "Campaign Name", + "status": "partial_running", + "type": "on_site", + "publisher_id": "publisher-id", + "publisher_name": "Publisher Name", + "advertiser_name": "Advertiser Name", + "sub_publisher_id": "subpublisher-id", + "sub_publisher_name": "Subpublisher Name", + "active": true, + "daily_budget": "10000.00", + "consumed_budget": "1750.0000", + "pending": [], + "metrics": { + "clicks": 39, + "conversions": 4, + "total_conversions_items_quantity": 7, + "impressions": 7603, + "views": 51, + "conversions_click": "3", + "conversions_view": "1", + "conversion_rate": "4.44", + "conversion_rate_click": "7.69", + "conversion_rate_view": "1.96", + "ctr": ".51", + "roas": "2.64", + "roas_click": "1.80", + "roas_view": "0.84", + "roas_halo": "0.95", + "roas_overall": "3.59", + "adcost": "37.87", + "income": "25747.00", + "total_spent": "9750.00", + "ecpm": "3.3864", + "cpa": "2437.50", + "avg_cpc": "250.00", + "avg_cpm": "1282.39", + "halo_revenue": "9260.00", + "halo_orders": "2", + "halo_items": "5" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get advertisers report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get advertisers report.yml new file mode 100644 index 0000000000..4d5a3242c4 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get advertisers report.yml @@ -0,0 +1,153 @@ +info: + name: Get advertisers report + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/report/v2/advertisers?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: account_info + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "false" + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/report/v2/advertisers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/report/v2/advertisers - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/report/v2/advertisers - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/report/v2/advertisers - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of advertisers available."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of advertiser objects.","items":{"type":"object","description":"Advertiser object.","properties":{"id":{"type":"string","description":"Unique advertiser identifier."},"name":{"type":"string","description":"Advertiser name."},"account_id":{"type":"string","description":"Account identifier."},"checking_account_id":{"type":"string","description":"Checking account identifier."},"seller_id":{"type":["string","null"],"description":"Seller identifier (when applicable)."},"advertiser_tags":{"type":["array","null"],"description":"Tags associated with the advertiser.","items":{"type":"string","description":"Advertiser tag."}},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"total_campaigns":{"type":"string","description":"Total number of campaigns."},"total_daily_budget":{"type":"string","description":"Total daily budget amount."},"balance":{"type":"string","description":"Account balance."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"impressions":{"type":"string","description":"Total number of ad impressions."},"views":{"type":"string","description":"Total number of ad views."},"clicks":{"type":"string","description":"Total number of ad clicks."},"conversions":{"type":"string","description":"Total number of conversions."},"conversion_rate":{"type":"string","description":"Conversion rate percentage."},"total_conversions_items_quantity":{"type":"string","description":"Total quantity of items across all ad-driven conversions. Sums the quantities of every item in each conversion event (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 2)."},"ctr":{"type":"string","description":"Click-through rate percentage."},"income":{"type":"string","description":"Total income generated."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"total_spent":{"type":"string","description":"Total amount spent."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"conversions_quantity":{"type":"string","description":"Total number of ad-driven conversions (sales attributed to an ad). Counts each conversion event as 1, regardless of how many items were purchased (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 1)."},"roas":{"type":"string","description":"Return on ad spend."},"adcost":{"type":"string","description":"Ad cost."},"consumed_daily_budget":{"type":"string","description":"Amount of daily budget consumed."}}},"account_logo":{"type":"string","description":"URL of the advertiser's logo."},"account_theme":{"type":"object","description":"Theme configuration object.","properties":{"primary_color":{"type":"string","description":"Primary color code (hex format)."},"header_color":{"type":"string","description":"Header color code (hex format)."},"second_color":{"type":"string","description":"Secondary color code (hex format)."},"dark_color":{"type":"string","description":"Dark color code (hex format)."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information from all advertisers associated with a publisher account. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ Only available in the publisher view (publisher account). + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `account_info` | query | If `true`, includes detailed account information in the result. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns the total number of available records. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "id", + "name": "name", + "account_id": "account-id", + "checking_account_id": "checking-account-id", + "seller_id": null, + "advertiser_tags": null, + "metrics": { + "total_campaigns": "100", + "total_daily_budget": "50000.00", + "balance": "6756756.40", + "advertiser_id": "advertiser-id", + "impressions": "395696", + "views": "323720", + "clicks": "1237", + "conversions": "0", + "conversion_rate": "0.00", + "total_conversions_items_quantity": "0", + "ctr": "0.31", + "income": "0.0000", + "ecpm": "0.00", + "total_spent": "213122.6000", + "cpa": "0", + "avg_cpc": "31.99", + "avg_cpm": "100.00", + "conversions_quantity": "0", + "roas": "0.00", + "adcost": "0.0", + "consumed_daily_budget": "4407.70" + }, + "account_logo": "https://cdn.newtail.com.br/accounts/4852asd4q-3b0a-11ef-b7a2-014ea2680b7e/assets/advertiser-logo.png", + "account_theme": { + "primary_color": "#00B941", + "header_color": "#00B941", + "second_color": "#00B941", + "dark_color": "#00B941" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get campaign details.yml b/BrunoCollections/VTEX - Ads API/Reports/Get campaign details.yml new file mode 100644 index 0000000000..848debe53b --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get campaign details.yml @@ -0,0 +1,207 @@ +info: + name: Get campaign details + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/campaign/:campaign_id?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: campaign_id + value: ab90a43b-582e-4be9-b126-2067dd8f30a3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/campaign/:campaign_id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/campaign/:campaign_id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/campaign/:campaign_id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/campaign/:campaign_id - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique campaign identifier."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"name":{"type":"string","description":"Campaign name."},"description":{"type":["string","null"],"description":"Campaign description."},"status":{"type":"string","description":"Campaign status."},"type":{"type":"string","description":"Campaign type."},"settings":{"type":"object","description":"Campaign settings object. The fields are dynamic and may vary depending on the campaign type.","properties":{"daily_budget":{"type":"number","description":"Daily budget amount.","format":"double"},"cpc":{"type":"number","description":"Cost per click value.","format":"double"},"cpm":{"type":"number","description":"Cost per mille value.","format":"double"},"budget_type":{"type":"string","description":"Budget distribution type."}}},"start_at":{"type":"string","description":"Campaign start date in ISO 8601 format."},"end_at":{"type":"string","description":"Campaign end date in ISO 8601 format."},"created_at":{"type":"string","description":"Campaign creation date in ISO 8601 format."},"updated_at":{"type":"string","description":"Campaign last update date in ISO 8601 format."},"deleted_at":{"type":["string","null"],"description":"Campaign deletion date in ISO 8601 format."},"ad_type":{"type":"string","description":"Advertisement type."},"targeting_type":{"type":"string","description":"Targeting type."},"strategy_type":{"type":"string","description":"Campaign strategy type."},"total_budget":{"type":"string","description":"Total campaign budget."},"active":{"type":"boolean","description":"Whether the campaign is active."},"publisher_id":{"type":"string","description":"Publisher identifier."},"seller_id":{"type":["string","null"],"description":"Seller identifier (when applicable)."},"target":{"type":"string","description":"Campaign target (when applicable)."},"network_id":{"type":["string","null"],"description":"Network identifier (when applicable)."},"audience_id":{"type":["string","null"],"description":"Audience identifier (when applicable)."},"advertiser_name":{"type":"string","description":"Advertiser name."},"advertiser_account_id":{"type":"string","description":"Advertiser account identifier."},"publisher_name":{"type":"string","description":"Publisher name."},"publisher_account_id":{"type":"string","description":"Publisher account identifier."},"conversions_quantity":{"type":"string","description":"Total quantity of conversions."},"consumed_budget":{"type":"string","description":"Amount of budget consumed."},"pending":{"type":"array","description":"Pending operations awaiting review for this campaign/ad. Empty when there is nothing pending.","items":{"type":"object","description":"Pending operation entry, grouping a `label` with its `quantity`.","properties":{"label":{"type":"string","description":"Type of pending operation. Currently, only `ads` is returned, indicating ads awaiting review.","enum":["ads"]},"quantity":{"type":"integer","description":"Number of pending items of the given `label`."}}}},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"clicks":{"type":"integer","description":"Total number of clicks."},"conversions":{"type":"integer","description":"Total number of conversions."},"impressions":{"type":"integer","description":"Total number of impressions."},"views":{"type":"integer","description":"Total number of views."},"conversions_click":{"type":"string","description":"Number of conversions attributed to clicks."},"conversions_view":{"type":"string","description":"Number of conversions attributed to views."},"conversion_rate":{"type":"string","description":"Consolidated conversion rate percentage, calculated as total conversions divided by the sum of clicks and views (`total_conversions / (total_clicks + total_views)`). This is the default conversion rate and considers both click- and view-attributed conversions."},"conversion_rate_click":{"type":"string","description":"Conversion rate percentage considering click-attributed conversions only, calculated as `conversions_click / total_clicks`."},"conversion_rate_view":{"type":"string","description":"Conversion rate percentage considering view-attributed conversions only, calculated as `conversions_view / total_views`."},"ctr":{"type":"string","description":"Click-through rate percentage."},"roas":{"type":"string","description":"Consolidated return on ad spend, combining click- and view-attributed revenue across all ad formats."},"roas_click":{"type":"string","description":"Return on ad spend calculated using click-attributed revenue only."},"roas_view":{"type":"string","description":"Return on ad spend calculated using view-attributed revenue only."},"roas_halo":{"type":"string","description":"Halo return on ad spend: incremental revenue from non-advertised products purchased in the same order as advertised products (the halo effect), divided by ad spend."},"roas_overall":{"type":"string","description":"Total return on ad spend, combining direct revenue from the advertised product with halo revenue from other products in the same order, divided by the ad investment. Measures the campaign's total impact on the whole order."},"adcost":{"type":"string","description":"Ad cost percentage."},"income":{"type":"string","description":"Total income generated."},"total_spent":{"type":"string","description":"Total amount spent."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"halo_revenue":{"type":"string","description":"Incremental revenue from non-advertised products that were purchased in the same order as an advertised product, attributed to the ad's spillover (halo) effect."},"halo_orders":{"type":"string","description":"Number of orders with at least one halo item."},"halo_items":{"type":"string","description":"Quantity of halo items sold."}}},"ads":{"type":"array","description":"Array of ad objects associated with the campaign.","items":{"type":"object","description":"Ad object.","properties":{"id":{"type":"string","description":"Unique ad identifier."},"campaign_id":{"type":"string","description":"Associated campaign identifier."},"url":{"type":"string","description":"Ad destination URL."},"settings":{"type":"object","description":"Ad-specific settings object. The fields are dynamic and may vary depending on the ad type.","properties":{"ad_size":{"type":"string","description":"Ad dimensions/size specification."},"media_url":{"type":"string","description":"URL of the ad media asset."},"type":{"type":"string","description":"Ad type."}}},"disabled_at":{"type":["string","null"],"description":"Ad disabled date in ISO 8601 format."},"created_at":{"type":"string","description":"Ad creation date in ISO 8601 format."},"updated_at":{"type":"string","description":"Ad last update date in ISO 8601 format."},"deleted_at":{"type":["string","null"],"description":"Ad deletion date in ISO 8601 format."},"status":{"type":"string","description":"Ad status."},"aid":{"type":"integer","description":"Ad internal ID."},"asset_type":{"type":"string","description":"Asset type (for example, `image`, `video`)."},"active":{"type":"boolean","description":"Whether the ad is active."},"campaign_name":{"type":"string","description":"Associated campaign name."},"ad_type":{"type":"string","description":"Advertisement type."},"campaign_status":{"type":"string","description":"Associated campaign status."},"is_running":{"type":"boolean","description":"Whether the ad is currently running."},"campaign_settings":{"type":"object","description":"Associated campaign settings. The fields are dynamic and may vary depending on the campaign type.","properties":{"daily_budget":{"type":"number","description":"Daily budget amount.","format":"double"},"cpm":{"type":"number","description":"Cost per mille value.","format":"double"},"budget_type":{"type":"string","description":"Budget distribution type."}}},"metrics":{"type":"object","description":"Ad-specific performance metrics. All metric values are returned as strings regardless of their numeric nature."}}}},"products":{"type":"array","description":"Array of products associated with the campaign.","items":{"type":"object","description":"Product object.","properties":{"id":{"type":"string","description":"Unique product identifier."},"name":{"type":"string","description":"Product name."},"sku":{"type":"string","description":"Product SKU."},"image_url":{"type":"string","description":"Product image URL."}}}},"status_history":{"type":"array","description":"Array of status change history.","items":{"type":"object","description":"Status change object.","properties":{"id":{"type":"string","description":"Unique status change identifier."},"status":{"type":"string","description":"Status value."},"created_at":{"type":"string","description":"Status change date in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves detailed information about a campaign, such as the products associated with the campaign, status history, ads, and metrics. The data is returned only in JSON format. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `campaign_id` | path | (Required) Unique identifier of the campaign to fetch. | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "campaign-001", + "advertiser_id": "advertiser-xyz", + "name": "Sample Campaign Name", + "description": "Sample Campaign Description", + "status": "running", + "type": "on_site", + "settings": { + "daily_budget": 10000, + "cpm": 1000, + "budget_type": "evenly" + }, + "start_at": "2025-01-01T00:00:00.000Z", + "end_at": "2025-01-31T00:00:00.000Z", + "created_at": "2025-07-14T17:14:56.513Z", + "updated_at": "2025-07-14T17:14:56.513Z", + "deleted_at": null, + "ad_type": "banner", + "targeting_type": "category", + "strategy_type": "standard", + "total_budget": "0.0000", + "active": true, + "publisher_id": "publisher-id", + "seller_id": null, + "target": "target-name", + "network_id": null, + "audience_id": null, + "advertiser_name": "advertiser-name", + "advertiser_account_id": "advertiser-account-id", + "publisher_name": "publisher-name", + "publisher_account_id": "publisher-account-id", + "conversions_quantity": "82", + "consumed_budget": "36070.0000", + "pending": [], + "metrics": { + "clicks": 39, + "conversions": 4, + "impressions": 7603, + "views": 51, + "conversions_click": "3", + "conversions_view": "1", + "conversion_rate": "4.44", + "conversion_rate_click": "7.69", + "conversion_rate_view": "1.96", + "ctr": ".51", + "roas": "2.64", + "roas_click": "1.80", + "roas_view": "0.84", + "roas_halo": "0.95", + "roas_overall": "3.59", + "adcost": "37.87", + "income": "25747.00", + "total_spent": "9750.00", + "ecpm": "3.3864", + "cpa": "2437.50", + "avg_cpc": "250.00", + "avg_cpm": "1282.39", + "halo_revenue": "9260.00", + "halo_orders": "2", + "halo_items": "5" + }, + "ads": [ + { + "id": "ad-001", + "campaign_id": "ab90a43b-582e-4be9-b126-2067dd8f30a3", + "url": "https://example.com", + "settings": { + "ad_size": "example-size", + "media_url": "https://cdn.example.com/ad-image.jpeg", + "type": "banner" + }, + "disabled_at": null, + "created_at": "2025-07-14T17:14:56.513Z", + "updated_at": "2025-07-14T17:14:56.513Z", + "deleted_at": null, + "status": "enabled", + "aid": 255272, + "asset_type": "image", + "active": true, + "campaign_name": "Sample Campaign Name", + "ad_type": "banner", + "campaign_status": "pending_review", + "is_running": true, + "campaign_settings": { + "daily_budget": 10000, + "cpm": 1000, + "budget_type": "evenly" + }, + "metrics": { + "clicks": 39, + "conversions": 4, + "impressions": 7603, + "views": 51, + "conversion_rate": "10.26", + "ctr": ".51", + "roas": "2.64", + "adcost": "37.87", + "income": "25747.00", + "total_spent": "9750.00", + "ecpm": "3.3864", + "cpa": "2437.50", + "avg_cpc": "250.00", + "avg_cpm": "1282.39" + } + } + ], + "products": [ + { + "id": "product-001", + "name": "Example Product Name", + "sku": "123456", + "image_url": "https://example.com/product.jpg" + } + ], + "status_history": [ + { + "id": "status-001", + "status": "running", + "created_at": "2025-07-03T22:53:57.272Z" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get network publishers report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get network publishers report.yml new file mode 100644 index 0000000000..5ef33ab2f3 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get network publishers report.yml @@ -0,0 +1,162 @@ +info: + name: Get network publishers report + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/report/network/publishers?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: publisher_name + value: MyStore + type: query + disabled: true + - name: account_info + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "false" + type: query + disabled: true + - name: order_by + value: impressions + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/report/network/publishers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/report/network/publishers - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/report/network/publishers - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/report/network/publishers - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of network publishers available."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of network publisher objects.","items":{"type":"object","description":"Network publisher object.","properties":{"id":{"type":"string","description":"Unique network publisher identifier."},"name":{"type":"string","description":"Publisher name."},"account_id":{"type":"string","description":"Account identifier."},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"publisher_id":{"type":"string","description":"Publisher identifier."},"impressions":{"type":"string","description":"Total number of ad impressions."},"views":{"type":"string","description":"Total number of ad views."},"clicks":{"type":"string","description":"Total number of ad clicks."},"conversions":{"type":"string","description":"Total number of conversions."},"conversion_rate":{"type":"string","description":"Conversion rate percentage."},"total_conversions_items_quantity":{"type":"string","description":"Total quantity of items across all ad-driven conversions. Sums the quantities of every item in each conversion event (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 2)."},"ctr":{"type":"string","description":"Click-through rate percentage."},"income":{"type":"string","description":"Total income generated."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"total_spent":{"type":"string","description":"Total amount spent."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"conversions_quantity":{"type":"string","description":"Total number of ad-driven conversions (sales attributed to an ad). Counts each conversion event as 1, regardless of how many items were purchased (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 1)."},"roas":{"type":"string","description":"Return on ad spend."},"adcost":{"type":"string","description":"Ad cost."},"requests":{"type":"string","description":"Total number of ad requests."}}},"account_logo":{"type":"string","description":"URL of the publisher's logo."},"account_theme":{"type":"object","description":"Theme configuration object.","properties":{"primary_color":{"type":"string","description":"Primary color code (hex format)."},"header_color":{"type":"string","description":"Header color code (hex format)."},"second_color":{"type":"string","description":"Secondary color code (hex format)."},"dark_color":{"type":"string","description":"Dark color code (hex format)."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about publishers associated with a Network Publisher account. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ Only publishers operating in the Network format are allowed to access this report. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `publisher_name` | query | Filters results by publisher name. | + | `account_info` | query | If `true`, includes detailed account information in the result. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns the total number of available records. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "publisher-id", + "name": "publisher-name", + "account_id": "publisher-account-name", + "metrics": { + "publisher_id": "publisher-id", + "impressions": "0", + "views": "0", + "clicks": "0", + "conversions": "0", + "conversion_rate": "0", + "total_conversions_items_quantity": "0", + "ctr": "0", + "income": "0.00", + "ecpm": "0", + "total_spent": "0.0000", + "cpa": "0", + "avg_cpc": "0", + "avg_cpm": "0", + "conversions_quantity": "0", + "roas": "0.0", + "adcost": "0.0", + "requests": "1" + }, + "account_logo": "https://cdn.newtail.com.br/accounts/4852asd4q-3b0a-11ef-b7a2-014ea2680b7e/assets/publisher-logo.png", + "account_theme": { + "primary_color": "#00B941", + "header_color": "#00B941", + "second_color": "#00B941", + "dark_color": "#00B941" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/Get publishers report.yml b/BrunoCollections/VTEX - Ads API/Reports/Get publishers report.yml new file mode 100644 index 0000000000..2250ac98c9 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/Get publishers report.yml @@ -0,0 +1,165 @@ +info: + name: Get publishers report + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/report/v2/publishers?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: publisher_name + value: MyStore + type: query + disabled: true + - name: account_info + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "false" + type: query + disabled: true + - name: order_by + value: income + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/report/v2/publishers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/report/v2/publishers - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/report/v2/publishers - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/report/v2/publishers - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of publishers available."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of publisher objects.","items":{"type":"object","description":"Publisher object.","properties":{"id":{"type":"string","description":"Unique publisher identifier."},"name":{"type":"string","description":"Publisher name."},"account_id":{"type":"string","description":"Account identifier."},"checking_account_id":{"type":"string","description":"Checking account identifier."},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"total_campaigns":{"type":"string","description":"Total number of campaigns."},"total_daily_budget":{"type":"string","description":"Total daily budget amount."},"balance":{"type":"string","description":"Account balance."},"publisher_id":{"type":"string","description":"Publisher identifier."},"impressions":{"type":"string","description":"Total number of ad impressions."},"views":{"type":"string","description":"Total number of ad views."},"clicks":{"type":"string","description":"Total number of ad clicks."},"conversions":{"type":"string","description":"Total number of conversions."},"conversion_rate":{"type":"string","description":"Conversion rate percentage."},"total_conversions_items_quantity":{"type":"string","description":"Total quantity of items across all ad-driven conversions. Sums the quantities of every item in each conversion event (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 2)."},"ctr":{"type":"string","description":"Click-through rate percentage."},"income":{"type":"string","description":"Total income generated."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"total_spent":{"type":"string","description":"Total amount spent."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"conversions_quantity":{"type":"string","description":"Total number of ad-driven conversions (sales attributed to an ad). Counts each conversion event as 1, regardless of how many items were purchased (for example, if a shopper buys two units of a product after clicking an ad, this metric increases by 1)."},"roas":{"type":"string","description":"Return on ad spend."},"adcost":{"type":"string","description":"Ad cost."}}},"account_logo":{"type":"string","description":"URL of the publisher's logo."},"account_theme":{"type":"object","description":"Theme configuration object.","properties":{"primary_color":{"type":"string","description":"Primary color code (hex format)."},"header_color":{"type":"string","description":"Header color code (hex format)."},"second_color":{"type":"string","description":"Secondary color code (hex format)."},"dark_color":{"type":"string","description":"Dark color code (hex format)."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the publishers associated with an advertiser account. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >ℹ️ Only available in the advertiser view (advertiser account). + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `publisher_name` | query | Filters results by publisher name. | + | `account_info` | query | If `true`, includes detailed account information in the result. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns the total number of available records. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "publisher-id", + "name": "publisher-name", + "account_id": "publisher-account-name", + "checking_account_id": "checking-account-id", + "metrics": { + "total_campaigns": "560", + "total_daily_budget": "00999.00", + "balance": "60001.29", + "publisher_id": "publisher-id", + "impressions": "999999", + "views": "0", + "clicks": "4954", + "conversions": "214", + "conversion_rate": "4.32", + "total_conversions_items_quantity": "214", + "ctr": "0.09", + "income": "581620.1500", + "ecpm": "0.11", + "total_spent": "1340.4000", + "cpa": "6.26", + "avg_cpc": "0.27", + "avg_cpm": "0.25", + "conversions_quantity": "214", + "roas": "433.92", + "adcost": "0.23" + }, + "account_logo": "https://cdn.newtail.com.br/accounts/4852asd4q-3b0a-11ef-b7a2-014ea2680b7e/assets/publisher-logo.png", + "account_theme": { + "primary_color": "#00B941", + "header_color": "#00B941", + "second_color": "#00B941", + "dark_color": "#00B941" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/List campaigns.yml b/BrunoCollections/VTEX - Ads API/Reports/List campaigns.yml new file mode 100644 index 0000000000..b6d13b3ddb --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/List campaigns.yml @@ -0,0 +1,209 @@ +info: + name: List campaigns + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/campaign/v2?start_date=2025-01-01&end_date=2025-01-31" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: start_date + value: 2025-01-01 + type: query + - name: end_date + value: 2025-01-31 + type: query + - name: status + value: running + type: query + disabled: true + - name: advertiser_id + value: advertiser-id + type: query + disabled: true + - name: ad_type + value: product + type: query + disabled: true + - name: name + value: Holiday Sale + type: query + disabled: true + - name: account_info + value: "false" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: quantity + value: "100" + type: query + disabled: true + - name: count + value: "false" + type: query + disabled: true + - name: order_by + value: created_at + type: query + disabled: true + - name: order_direction + value: desc + type: query + disabled: true + - name: download + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/campaign/v2 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/campaign/v2 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/campaign/v2 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/campaign/v2 - Schema is valid", function () { + const schema = {"type":"object","properties":{"total":{"type":"integer","description":"Total number of campaigns."},"pages":{"type":"integer","description":"Total number of pages for pagination."},"currentPage":{"type":"integer","description":"Current page number."},"data":{"type":"array","description":"Array of campaign objects.","items":{"type":"object","description":"Campaign object.","properties":{"id":{"type":"string","description":"Unique campaign identifier."},"advertiser_id":{"type":"string","description":"Advertiser identifier."},"name":{"type":"string","description":"Campaign name."},"status":{"type":"string","description":"Campaign status."},"type":{"type":"string","description":"Campaign type."},"settings":{"type":"object","description":"Campaign settings object. The fields are dynamic and may vary depending on the campaign type.","properties":{"daily_budget":{"type":"number","description":"Daily budget amount.","format":"double"},"cpc":{"type":"number","description":"Cost per click value.","format":"double"},"cpm":{"type":"number","description":"Cost per mille value.","format":"double"},"budget_type":{"type":"string","description":"Budget distribution type."}}},"start_at":{"type":"string","description":"Campaign start date in ISO 8601 format."},"end_at":{"type":"string","description":"Campaign end date in ISO 8601 format."},"disabled_at":{"type":["string","null"],"description":"Campaign disabled date in ISO 8601 format."},"created_at":{"type":"string","description":"Campaign creation date in ISO 8601 format."},"updated_at":{"type":"string","description":"Campaign last update date in ISO 8601 format."},"deleted_at":{"type":["string","null"],"description":"Campaign deletion date in ISO 8601 format."},"description":{"type":["string","null"],"description":"Campaign description."},"publisher_id":{"type":"string","description":"Publisher identifier."},"ad_type":{"type":"string","description":"Advertisement type."},"cid":{"type":"integer","description":"Campaign internal ID."},"seller_id":{"type":["string","null"],"description":"Seller identifier (when applicable)."},"target":{"type":"string","description":"Campaign target (when applicable)."},"network_id":{"type":["string","null"],"description":"Network identifier (when applicable)."},"audience_id":{"type":["string","null"],"description":"Audience identifier (when applicable)."},"targeting_type":{"type":["string","null"],"description":"Targeting type."},"strategy_type":{"type":"string","description":"Campaign strategy type."},"total_budget":{"type":"string","description":"Total campaign budget."},"active":{"type":"boolean","description":"Whether the campaign is active."},"advertiser_name":{"type":"string","description":"Advertiser name."},"advertiser_account_id":{"type":"string","description":"Advertiser account identifier."},"publisher_name":{"type":"string","description":"Publisher name."},"publisher_account_id":{"type":"string","description":"Publisher account identifier."},"consumed_budget":{"type":"string","description":"Amount of budget consumed."},"daily_budget":{"type":"string","description":"Daily budget amount."},"campaign_status":{"type":"integer","description":"Campaign status code."},"advertiser_tags":{"type":["array","null"],"description":"Tags associated with the advertiser.","items":{"type":"string","description":"Advertiser tag."}},"pending":{"type":"array","description":"Pending operations awaiting review for this campaign/ad. Empty when there is nothing pending.","items":{"type":"object","description":"Pending operation entry, grouping a `label` with its `quantity`.","properties":{"label":{"type":"string","description":"Type of pending operation. Currently, only `ads` is returned, indicating ads awaiting review.","enum":["ads"]},"quantity":{"type":"integer","description":"Number of pending items of the given `label`."}}}},"metrics":{"type":"object","description":"Performance metrics object. All metric values are returned as strings regardless of their numeric nature.","properties":{"clicks":{"type":"integer","description":"Total number of clicks."},"conversions":{"type":"integer","description":"Total number of conversions."},"impressions":{"type":"integer","description":"Total number of impressions."},"views":{"type":"integer","description":"Total number of views."},"conversions_click":{"type":"string","description":"Number of conversions attributed to clicks."},"conversions_view":{"type":"string","description":"Number of conversions attributed to views."},"conversion_rate":{"type":"string","description":"Consolidated conversion rate percentage, calculated as total conversions divided by the sum of clicks and views (`total_conversions / (total_clicks + total_views)`). This is the default conversion rate and considers both click- and view-attributed conversions."},"conversion_rate_click":{"type":"string","description":"Conversion rate percentage considering click-attributed conversions only, calculated as `conversions_click / total_clicks`."},"conversion_rate_view":{"type":"string","description":"Conversion rate percentage considering view-attributed conversions only, calculated as `conversions_view / total_views`."},"ctr":{"type":"string","description":"Click-through rate percentage."},"roas":{"type":"string","description":"Consolidated return on ad spend, combining click- and view-attributed revenue across all ad formats."},"roas_click":{"type":"string","description":"Return on ad spend calculated using click-attributed revenue only."},"roas_view":{"type":"string","description":"Return on ad spend calculated using view-attributed revenue only."},"roas_halo":{"type":"string","description":"Halo return on ad spend: incremental revenue from non-advertised products purchased in the same order as advertised products (the halo effect), divided by ad spend."},"roas_overall":{"type":"string","description":"Total return on ad spend, combining direct revenue from the advertised product with halo revenue from other products in the same order, divided by the ad investment. Measures the campaign's total impact on the whole order."},"adcost":{"type":"string","description":"Ad cost percentage."},"income":{"type":"string","description":"Total income generated."},"total_spent":{"type":"string","description":"Total amount spent."},"ecpm":{"type":"string","description":"Effective cost per mille (CPM)."},"cpa":{"type":"string","description":"Cost per acquisition."},"avg_cpc":{"type":"string","description":"Average cost per click."},"avg_cpm":{"type":"string","description":"Average cost per mille."},"halo_revenue":{"type":"string","description":"Incremental revenue from non-advertised products that were purchased in the same order as an advertised product, attributed to the ad's spillover (halo) effect."},"halo_orders":{"type":"string","description":"Number of orders with at least one halo item."},"halo_items":{"type":"string","description":"Quantity of halo items sold."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fetches all available campaigns, applying filters as needed. The data is returned in JSON format by default, but can be exported as an XLSX file by setting `download=true`. + + >⚠️ This endpoint is limited to 100 requests per minute per account. Exceeding the limit returns `429 Too Many Requests`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `start_date` | query | (Required) Start date for metrics in `YYYY-MM-DD` format. | + | `end_date` | query | (Required) End date for metrics in `YYYY-MM-DD` format. | + | `status` | query | Filters by campaign status. | + | `advertiser_id` | query | Filters campaigns by advertiser ID. | + | `ad_type` | query | Filters by ad type. | + | `name` | query | Searches campaigns by name. | + | `account_info` | query | If `true`, includes detailed account information in the result. | + | `page` | query | Page number of the results. | + | `quantity` | query | Number of items per page. When `download=true`, the BFF requests up to `20000` rows for XLSX generation. | + | `count` | query | If `true`, returns the total number of available records. | + | `order_by` | query | Field used to sort results. | + | `order_direction` | query | Sort direction. | + | `download` | query | If `true`, returns an XLSX file buffer for download instead of JSON. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "total": 1, + "pages": 1, + "currentPage": 1, + "data": [ + { + "id": "campaign-id", + "advertiser_id": "advertiser-id", + "name": "Campaign Name", + "status": "partial_running", + "type": "on_site", + "settings": { + "daily_budget": 10000, + "cpc": 250, + "budget_type": "evenly" + }, + "start_at": "2025-01-01T00:00:00.000Z", + "end_at": "2025-01-31T00:00:00.000Z", + "disabled_at": null, + "created_at": "2025-01-01T07:33:08.482Z", + "updated_at": "2025-01-26T16:16:08.482Z", + "deleted_at": null, + "description": null, + "publisher_id": "publisher-id", + "ad_type": "product", + "cid": 16674, + "seller_id": null, + "target": "target-name", + "network_id": null, + "audience_id": null, + "targeting_type": null, + "strategy_type": "standard", + "total_budget": "0.0000", + "active": true, + "advertiser_name": "advertiser name", + "advertiser_account_id": "advertiser-account-id", + "publisher_name": "publisher-name", + "publisher_account_id": "publisher-account-id", + "consumed_budget": "1750.0000", + "daily_budget": "10000.00", + "campaign_status": 1, + "advertiser_tags": null, + "pending": [], + "metrics": { + "clicks": 39, + "conversions": 4, + "impressions": 7603, + "views": 51, + "conversions_click": "3", + "conversions_view": "1", + "conversion_rate": "4.44", + "conversion_rate_click": "7.69", + "conversion_rate_view": "1.96", + "ctr": ".51", + "roas": "2.64", + "roas_click": "1.80", + "roas_view": "0.84", + "roas_halo": "0.95", + "roas_overall": "3.59", + "adcost": "37.87", + "income": "25747.00", + "total_spent": "9750.00", + "ecpm": "3.3864", + "cpa": "2437.50", + "avg_cpc": "250.00", + "avg_cpm": "1282.39", + "halo_revenue": "9260.00", + "halo_orders": "2", + "halo_items": "5" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Reports/folder.yml b/BrunoCollections/VTEX - Ads API/Reports/folder.yml new file mode 100644 index 0000000000..a0610abd2e --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Reports/folder.yml @@ -0,0 +1,4 @@ +info: + name: Reports + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Ads API/Single sign-on/Generate seller single sign-on URL.yml b/BrunoCollections/VTEX - Ads API/Single sign-on/Generate seller single sign-on URL.yml new file mode 100644 index 0000000000..fe971629c0 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Single sign-on/Generate seller single sign-on URL.yml @@ -0,0 +1,83 @@ +info: + name: Generate seller single sign-on URL + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/sso/marketplace" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "sso_token": "sso-token-12345", + "email": "seller@example.com", + "user_id": "seller123", + "name": "Seller Name", + "marketplace_name": "My Marketplace" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/sso/marketplace - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/sso/marketplace - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/sso/marketplace - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/sso/marketplace - Schema is valid", function () { + const schema = {"type":"object","properties":{"redirect_url":{"type":"string","description":"Redirect URL the seller user must follow to access the VTEX Ads platform."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Generates a redirect URL that allows a seller user to access the VTEX Ads platform without needing to log in again. Use this endpoint to enable a unified login experience for marketplace sellers. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "redirect_url": "https://app.ads.vtex.com/sso/auth?token=GENERATED_TOKEN" + } + ``` diff --git a/BrunoCollections/VTEX - Ads API/Single sign-on/folder.yml b/BrunoCollections/VTEX - Ads API/Single sign-on/folder.yml new file mode 100644 index 0000000000..c6daded59e --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/Single sign-on/folder.yml @@ -0,0 +1,4 @@ +info: + name: Single sign-on + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Ads API/environments/VTEX.yml b/BrunoCollections/VTEX - Ads API/environments/VTEX.yml new file mode 100644 index 0000000000..3901176556 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: https://api-retail-media.newtail.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Ads API/opencollection.yml b/BrunoCollections/VTEX - Ads API/opencollection.yml new file mode 100644 index 0000000000..9e493bced2 --- /dev/null +++ b/BrunoCollections/VTEX - Ads API/opencollection.yml @@ -0,0 +1,73 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Ads API + +request: + auth: + type: apikey + key: X-App-Id + value: "{{apiKey}}" + placement: header + +docs: + content: |- + VTEX Ads API enables merchants and marketplace operators to synchronize product catalogs, display ads in the storefront, record ad interactions, among other operations within the VTEX Ads platform. + + This API is primarily used by: + - Store developers + - Marketplace operators + - Integration partners + - Advertising platform providers + + With this API you can: + - Synchronize product catalog information for advertising + - Track ad impressions, clicks, and views + - Monitor conversion events and campaign performance + - Manage ad inventory and placements + + >ℹ️ Learn more about [VTEX Ads](https://help.vtex.com/en/docs/tracks/retail-media). + + ## Architecture + + VTEX Ads is **cookie-less**. Identification and targeting rely on first-party identifiers — `user_id` and `session_id` — rather than third-party cookies, ensuring compliance with modern privacy regulations. + + - **`session_id`:** Persistent visitor identifier, required in every ad query and event. It must remain stable for at least 14 days (the default conversion window). For mobile applications, send the device ID as the `session_id` (GAID on Android, IDFA on iOS) so that the session is maintained indefinitely. + - **`user_id`:** Unique customer identifier on the publisher's platform. It must be consistent across web, mobile app, and physical store. Required in conversion events; recommended for impressions, clicks, and views. + + ## Before you begin + + - **Base URLs.** The API is served from three hosts depending on the operation: + - `https://api-retail-media.newtail.com.br` — Catalog synchronization, Reports, Credit transfer webhook, and SSO. + - `https://newtail-media.newtail.com.br` — Ad query. + - `https://events.newtail-media.newtail.com.br` — Ads events notification (impression, click, view, conversion). + - **Authentication.** Catalog synchronization, Reports, and SSO endpoints require the `X-App-Id` and `X-Api-Key` headers. Ad query and ads event notifications are public and do not require authentication. The Credit transfer webhook uses a different scheme: `X-Api-Key` and `X-Secret-Key` (it does not use `X-App-Id`). Contact [our support](https://help.vtex.com/en/tutorial/how-does-vtex-support-work--2eAT5EyOvaLoHdIWDVaxC3) to obtain credentials. + - **Bulk operations.** A maximum of 500 objects per request and 3 simultaneous requests are allowed for catalog and inventory updates. + - **Event URLs.** The event URLs for tracking impressions, clicks, and views must not be constructed manually — always use the URLs returned by `POST` [Get ads](https://developers.vtex.com/docs/api-reference/vtex-ads-api#post-/v1/rma/-publisher_id-). + - **Browser-side events.** Use `navigator.sendBeacon()` to fire impression, view, click, and conversion events from the browser. It ensures asynchronous delivery even when the user navigates away or closes the page. + - **PII hashing.** All personally identifiable fields (`email_hashed`, `phone_hashed`, `social_id_hashed`, `first_name_hashed`, `last_name_hashed`) must be hashed with SHA-256 before being sent. Normalize values first (lowercase and trim; phone numbers in E.164 format). + - **Reports export.** Reports return JSON by default. Set `download=true` to receive an XLSX file (capped at 20,000 rows per export). + - **Rate limits.** Reports endpoints are limited to 100 requests per minute per account. This limit applies only to API Key-authenticated calls and does not affect normal platform use through the UI. Requests that exceed the limit receive `429 Too Many Requests` with "Rate limit exceeded for this account". Wait for the next window before retrying, and spread large export workloads over time. Contact [our support](https://help.vtex.com/en/tutorial/how-does-vtex-support-work--2eAT5EyOvaLoHdIWDVaxC3) if your integration needs a higher volume. + - **Ad query performance.** Apply a 500-600 ms timeout to ad query calls and prefer persistent HTTP connections (`Connection: keep-alive`). + + ## Attribution and deduplication + + - **Default conversion window:** 14 days from the user's interaction (click for product campaigns; view for banner, video, and sponsored brand campaigns). + - **Conversion idempotency:** Re-sending the same `order_id` within 30 days is ignored. + - **Event deduplication:** For the same user and ad, impressions are deduplicated for 1 minute and clicks for 1 hour. + - **Data latency:** Conversions appear in reports approximately 30 minutes (API integrations) or up to 2 hours (VTEX platform) after the order is placed. + + | Parameter name | Description | Type | + | - | - | - | + | `X-App-Id` | Publisher App ID for authorization | Authentication header | + | `X-Api-Key` | API Key for authentication | Authentication header | + | `X-Secret-Key` | Secret key paired with `X-Api-Key` for the credit transfer webhook | Authentication header | + | `Content-Type` | Type of the content being sent | Request header | + | `Accept` | HTTP Client Negotiation Accept Header | Request header | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Get anti-fraud status.yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Get anti-fraud status.yml new file mode 100644 index 0000000000..f2fed067ed --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Get anti-fraud status.yml @@ -0,0 +1,99 @@ +info: + name: Get anti-fraud status + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/transactions/:transactions.id" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactions + value: "" + type: path + - name: transactions.Id + value: D3AA1FC8372E430E8236649DB5EBD08E + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/transactions/:transactions.id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/transactions/:transactions.id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/transactions/:transactions.id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/transactions/:transactions.id - Schema is valid", function () { + const schema = {"required":["id","tid","status","fraudRiskPercentage","analysisType","responses"],"type":"object","description":"Anti-fraud status information.","properties":{"id":{"type":"string","description":"VTEX transaction ID. The ID of this transaction must be in the response."},"tid":{"type":"string","description":"Provider transaction ID. The ID of this transaction must be in the response. The anti-fraud provider must generate a unique transaction ID."},"status":{"type":"string","description":"Transaction status from provider. Must be one of the values: `approved`, `denied` or `undefined`."},"fraudRiskPercentage":{"type":"number","description":"Fraud risk percentage."},"analysisType":{"type":"string","description":"Analysis type. Valid values are `automatic` or `manual`."},"responses":{"required":["foo","custom"],"type":"object","description":"Responses information.","properties":{"foo":{"type":"string","description":"Any foo information."},"custom":{"type":"string","description":"Any custom value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the anti-fraud analysis status. This request is performed every two hours up to 5 days. After 5 days in `undefined` status, the order will expire and be cancelled. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactions.Id` | path | (Required) VTEX transaction ID. This parameter is the same `id` sent in the request body of the [Send Anti-fraud Data endpoint](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions). | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "BF900B7CB15147F98D91208989100A05", + "tid": "3146f46162f042f483cd3979ba4e8317", + "status": "approved", + "fraudRiskPercentage": 5.01, + "analysisType": "automatic", + "responses": { + "foo": "anyFoo", + "custom": "customAnyValue" + } + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/List anti-fraud provider manifest.yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/List anti-fraud provider manifest.yml new file mode 100644 index 0000000000..b8d2c89956 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/List anti-fraud provider manifest.yml @@ -0,0 +1,97 @@ +info: + name: List anti-fraud provider manifest + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/manifest" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/manifest - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/manifest - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/manifest - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/manifest - Schema is valid", function () { + const schema = {"required":["customFields"],"type":"object","description":"Custom fields information.","properties":{"cardholderDocument":{"type":"string","description":"Indicates the requirement of cardholder document in card transactions. The field has three possible values: `required`, `optional`, or `unused`."},"allowAntifraudOnGiftCard":{"type":"boolean","description":"Indicates whether the anti-fraud provider can process payment transactions made using [gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."},"customFields":{"type":"array","description":"Describes the customized fields supported by the connector.","items":{"type":"object","description":"Custom fields information.","properties":{"name":{"type":"string","description":"Custom field name."},"type":{"type":"string","description":"Custom field type. Sensitive or security data should be defined as `password`.","enum":["text","password","select"]},"options":{"type":"array","description":"In case of `select` type, the possible params are `text` and `value`.","items":{"type":"object","description":"Custom field information.","properties":{"text":{"type":"string","description":"Custom field description."},"value":{"type":"string","description":"Custom field value."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the custom fields of the anti-fraud provider manifest. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "cardholderDocument": "required", + "allowAntifraudOnGiftCard": true, + "customFields": [ + { + "name": "AnalysisMode", + "type": "text" + }, + { + "name": "Client secret", + "type": "password" + }, + { + "name": "AnalysisLocation", + "type": "select", + "options": [ + { + "text": "MEX", + "value": "Latin America" + }, + { + "text": "USA", + "value": "United States" + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud data.yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud data.yml new file mode 100644 index 0000000000..71ee6a3a2b --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud data.yml @@ -0,0 +1,235 @@ +info: + name: Send anti-fraud data + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/transactions" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "reference": "vtexargentina", + "value": 10, + "ip": "10.0.0.1", + "store": "serasa", + "deviceFingerprint": "Generated_using_GTM_Store_Is_Responsible_To_Configure", + "miniCart": { + "buyer": { + "id": "c1245228-1c68-11e6-94ac-0afa86a846a5", + "firstName": "John", + "lastName": "Doe", + "document": "012.345.678-90", + "documentType": "CPF", + "email": "john@doe.com", + "phone": "+5521987654321", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "shipping": { + "value": 8.41, + "estimatedDate": "2017-08-02T14:46:47", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "items": [ + { + "id": "132981", + "name": "Shirt", + "price": 20.51, + "quantity": 2, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "111", + "categoryName": "Electronica", + "discount": 1.99, + "sellerId": "vtexargentina" + }, + { + "id": "132981", + "name": "Shirt", + "price": 20.51, + "quantity": 2, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "111", + "categoryName": "Electronica", + "discount": 1.99, + "sellerId": "vtexargentina" + } + ], + "taxValue": 5.58, + "listRegistry": { + "name": "My gift list.", + "deliveryToOwner": false + } + }, + "payments": [ + { + "id": "2D00FEBB", + "method": "CreditCard", + "value": 63.98, + "currencyIso4217": "BRL", + "installments": 3, + "name": "Visa", + "details": { + "bin": "507860", + "lastDigits": "2798", + "holder": "John Doe", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + } + }, + { + "id": "2D00FEBB", + "method": "CreditCard", + "value": 63.98, + "currencyIso4217": "BRL", + "installments": 3, + "name": "Visa", + "details": { + "bin": "507860", + "lastDigits": "2798", + "holder": "John Doe", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + } + } + ], + "hook": "https://hook.vtex.com/notifyIfChangeStatus", + "transactionStartDate": "2025-06-15T18:08:23", + "merchantSettings": [ + { + "name": "Country", + "value": "BRL" + }, + { + "name": "Country", + "value": "BRL" + } + ] + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/transactions - Schema is valid", function () { + const schema = {"required":["id","tid","code","message","status","score","analysisType","responses"],"type":"object","description":"Anti-fraud data.","properties":{"id":{"type":"string","description":"VTEX transaction ID. The ID of this transaction must be in the response."},"tid":{"type":"string","description":"Provider transaction ID. The ID of this transaction must be in the response. The anti-fraud provider must generate a unique transaction ID."},"code":{"type":"string","description":"Error code returned from provider. It will be logged in transaction interactions log."},"message":{"type":"string","description":"Error message returned from provider. It will be logged in transaction interactions log."},"status":{"description":"Pre-analysis status from provider. Must be `approved` or `denied`.","enum":["approved","denied"]},"score":{"type":"number","description":"Value of the risk score. The maximum value is `100.00`, which means total fraud."},"analysisType":{"type":"string","description":"Pre-analysis type. Must be `automatic`."},"responses":{"required":["foo","custom"],"type":"object","description":"Responses information.","properties":{"foo":{"type":"string","description":"Any foo information."},"custom":{"type":"string","description":"Any custom value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Receives a new transaction anti-fraud data. This step is performed only if all payments are authorized. + + VTEX expects that your anti-fraud provider process this request and retrieves the process result. After that, the VTEX order flow will check the response status to cancel or approve the transaction. + + + > Only data from the main account is sent from VTEX to the anti-fraud system. Information related to subaccounts is not included in the request. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "tid": "4692c1f54d514fe69da0b472a3b2a770", + "code": "customCode", + "message": "customMessage", + "status": "approved", + "score": 5.01, + "analysisType": "automatic", + "responses": { + "foo": "anyFoo", + "custom": "customAnyValue" + } + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud pre-analysis data (optional).yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud pre-analysis data (optional).yml new file mode 100644 index 0000000000..29f3364b94 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Send anti-fraud pre-analysis data (optional).yml @@ -0,0 +1,234 @@ +info: + name: Send anti-fraud pre-analysis data (optional) + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/pre-analysis" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "reference": "vtexargentina", + "value": 10, + "ip": "10.0.0.1", + "store": "serasa", + "deviceFingerprint": "Generated_using_GTM_Store_Is_Responsible_To_Configure", + "miniCart": { + "buyer": { + "id": "c1245228-1c68-11e6-94ac-0afa86a846a5", + "firstName": "John", + "lastName": "Doe", + "document": "012.345.678-90", + "documentType": "CPF", + "email": "john@doe.com", + "phone": "+5521987654321", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "shipping": { + "value": 8.41, + "estimatedDate": "2017-08-02T14:46:47", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "items": [ + { + "id": "132981", + "name": "Shirt", + "price": 20.51, + "quantity": 2, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "111", + "categoryName": "Electronica", + "discount": 1.99, + "sellerId": "vtexargentina" + }, + { + "id": "132981", + "name": "Shirt", + "price": 20.51, + "quantity": 2, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "111", + "categoryName": "Electronica", + "discount": 1.99, + "sellerId": "vtexargentina" + } + ], + "taxValue": 5.58, + "listRegistry": { + "name": "My gift list.", + "deliveryToOwner": false + } + }, + "payments": [ + { + "id": "2D00FEBB", + "method": "CreditCard", + "value": 63.98, + "currencyIso4217": "BRL", + "installments": 3, + "name": "Visa", + "details": { + "bin": "507860", + "lastDigits": "2798", + "holder": "John Doe", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + } + }, + { + "id": "2D00FEBB", + "method": "CreditCard", + "value": 63.98, + "currencyIso4217": "BRL", + "installments": 3, + "name": "Visa", + "details": { + "bin": "507860", + "lastDigits": "2798", + "holder": "John Doe", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + } + } + ], + "hook": "https://hook.vtex.com/notifyIfChangeStatus", + "transactionStartDate": "2025-06-15T18:08:23", + "merchantSettings": [ + { + "name": "Country", + "value": "BRL" + }, + { + "name": "Country", + "value": "BRL" + } + ] + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pre-analysis - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pre-analysis - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pre-analysis - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pre-analysis - Schema is valid", function () { + const schema = {"required":["id","tid","code","message","status","score","analysisType","responses"],"type":"object","description":"Anti-fraud data.","properties":{"id":{"type":"string","description":"VTEX transaction ID. The ID of this transaction must be in the response."},"tid":{"type":"string","description":"Provider transaction ID. The ID of this transaction must be in the response. The anti-fraud provider must generate a unique transaction ID."},"code":{"type":"string","description":"Error code returned from provider. It will be logged in transaction interactions log."},"message":{"type":"string","description":"Error message returned from provider. It will be logged in transaction interactions log."},"status":{"description":"Pre-analysis status from provider. Must be `approved` or `denied`.","enum":["approved","denied"]},"score":{"type":"number","description":"Value of the risk score. The maximum value is `100.00`, which means total fraud."},"analysisType":{"type":"string","description":"Pre-analysis type. Must be `automatic`."},"responses":{"required":["foo","custom"],"type":"object","description":"Responses information.","properties":{"foo":{"type":"string","description":"Any foo information."},"custom":{"type":"string","description":"Any custom value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Receives a new transaction anti-fraud data for (synchronous) pre-analysis. This step is performed before payments authorization. + + >⚠️ This endpoint can only be used if your anti-fraud provider already has the pre-analysis function configured within VTEX. To check if it is already configured, in the VTEX Admin, go to **Store Settings > Payment > Providers**, click the name of your anti-fraud provider, and verify if the **Enable Risk Pre-Analysis** field is available to be selected. If the **Enable Risk Pre-Analysis** field is not available, check with your anti-fraud provider if this feature is available in their integration and open a ticket in our [VTEX Support](https://help.vtex.com/en/support) to update the connector. + + >⚠️ The pre-analysis does not exclude the need for full analysis after payments authorization. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "tid": "4692c1f54d514fe69da0b472a3b2a770", + "code": "customCode", + "message": "customMessage", + "status": "approved", + "score": 5.01, + "analysisType": "automatic", + "responses": { + "foo": "anyFoo", + "custom": "customAnyValue" + } + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Stop anti-fraud analysis (optional).yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Stop anti-fraud analysis (optional).yml new file mode 100644 index 0000000000..8e4b731683 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Stop anti-fraud analysis (optional).yml @@ -0,0 +1,110 @@ +info: + name: Stop anti-fraud analysis (optional) + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/transactions/:transactions.Id" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactions + value: "" + type: path + - name: transactions.Id + value: D3AA1FC8372E430E8236649DB5EBD08E + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/transactions/:transactions.Id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/transactions/:transactions.Id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/transactions/:transactions.Id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/transactions/:transactions.Id - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["name"],"type":"object","description":"Payment methods information.","properties":{"name":{"type":"string","description":"Payment method name."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Notifies whether the order has been canceled by the store or the buyer before completing the anti-fraud analysis status. + + This endpoint is not mandatory for the antifraud flow to work. Check this [developer guide](https://developers.vtex.com/docs/guides/how-the-integration-protocol-between-vtex-and-antifraud-companies-works) for more details. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactions.Id` | path | (Required) VTEX transaction ID. This parameter is the same `id` sent in the request body of the [Send Anti-fraud Data endpoint](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions). | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "name": "CreditCard" + }, + { + "name": "DebitCard" + }, + { + "name": "GiftCard" + }, + { + "name": "BankIssueInvoice" + }, + { + "name": "Voucher" + }, + { + "name": "Promissory" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Update anti-fraud transactions (optional).yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Update anti-fraud transactions (optional).yml new file mode 100644 index 0000000000..87128b9d3f --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/Update anti-fraud transactions (optional).yml @@ -0,0 +1,207 @@ +info: + name: Update anti-fraud transactions (optional) + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/transactions/:transactionId" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: "" + type: path + - name: transactions.Id + value: D3AA1FC8372E430E8236649DB5EBD08E + type: path + body: + type: json + data: |- + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "reference": "v32478982vtx-01", + "value": 10, + "ip": "10.0.0.1", + "store": "serasa", + "deviceFingerprint": "Generated_using_GTM_Store_Is_Responsible_To_Configure", + "miniCart": { + "buyer": { + "id": "c1245228-1c68-11e6-94ac-0afa86a846a5", + "firstName": "John", + "lastName": "Doe", + "document": "012.345.678-90", + "documentType": "CPF", + "email": "john@doe.com", + "phone": "+5521987654321", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "shipping": { + "value": 8.41, + "estimatedDate": "2017-08-02T14:46:47", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + }, + "items": [ + { + "id": "132981", + "name": "Some useful product", + "price": 20.51, + "quantity": 2, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "111", + "categoryName": "Electronica", + "discount": 1.99, + "sellerId": "vtexargentina" + }, + { + "id": "123242", + "name": "Some useless product", + "price": 21.98, + "quantity": 1, + "deliveryType": "Normal", + "deliverySlaInMinutes": 4320, + "categoryId": "123", + "categoryName": "Lar", + "discount": 1.01, + "sellerId": "vtexargentina" + } + ], + "taxValue": 5.58, + "listRegistry": { + "name": "Minha lista Presente", + "deliveryToOwner": false + } + }, + "payments": [ + { + "id": "2D00FE", + "method": "CreditCard", + "name": "Visa", + "value": 63.98, + "currencyIso4217": "BRL", + "installments": 3, + "details": { + "bin": "507860", + "lastDigits": "2798", + "holder": "John Doe", + "address": { + "country": "BRA", + "street": "Rua Praia de Botafogo", + "number": "518", + "complement": "2o. andar", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ" + } + } + }, + { + "id": "04D430E517B2494FBC3DF7721CCDACC7", + "method": "GiftCard", + "value": 10.01, + "currencyIso4217": "BRL", + "installments": 1 + } + ], + "hook": "https://hook.vtex.com/notifyIfChangeStatus" + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/transactions/:transactionId - Schema is valid", function () { + const schema = {"required":["id","status","fraudRiskPercentage","analysisType","responses"],"type":"object","description":"Anti-fraud transaction data.","properties":{"id":{"type":"string","description":"VTEX transaction ID. The ID of this transaction must be in the response."},"status":{"type":"string","description":"Transaction status from provider. Must be one of the values: `approved`, `denied` or `undefined`."},"fraudRiskPercentage":{"type":"number","description":"Fraud risk percentage."},"analysisType":{"type":"string","description":"Analysis type. Valid values are `automatic` or `manual`."},"responses":{"type":["string","null"],"description":"Value dictionary to add custom responses from analysis."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Receives a new transaction anti-fraud data. This step is performed only if all payments are authorized. + + VTEX expects that your anti-fraud provider process this request and retrieves the process result. After that, the VTEX order flow will check the response status to cancel or approve the transaction. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactions.Id` | path | (Required) VTEX transaction ID. This parameter is the same `id` sent in the request body of the [Send Anti-fraud Data endpoint](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions). | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "D3AA1FC8372E430E8236649DB5EBD08E", + "status": "approved", + "fraudRiskPercentage": 0, + "analysisType": "automatic", + "responses": null + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/folder.yml b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/folder.yml new file mode 100644 index 0000000000..df323f5bd7 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/Anti-fraud Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: Anti-fraud Flow + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/1. Retrieve token.yml b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/1. Retrieve token.yml new file mode 100644 index 0000000000..b9de2c8d48 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/1. Retrieve token.yml @@ -0,0 +1,91 @@ +info: + name: 1. Retrieve token + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/authorization/token" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "applicationId": "vtex", + "returnUrl": "https://storevtex.vtexpayments.com/?authorizationCode=" + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/authorization/token - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/authorization/token - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/authorization/token - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/authorization/token - Schema is valid", function () { + const schema = {"required":["applicationId","token"],"type":"object","description":"Token information.","properties":{"applicationId":{"type":"string","description":"This value is always identified as `vtex`."},"token":{"type":"string","description":"Payment Provider Token. Used to identify the context after you receive the redirected user to your site."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used to retrieve a payment provider token. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "applicationId": "vtex", + "token": "358a5bea-07d0-4122-888a-54ab70b5f02f" + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/2. Redirect.yml b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/2. Redirect.yml new file mode 100644 index 0000000000..25e4d9b1db --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/2. Redirect.yml @@ -0,0 +1,64 @@ +info: + name: 2. Redirect + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/redirect?token={token}&applicationId=vtex" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: token + value: "{token}" + type: query + - name: applicationId + value: vtex + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/redirect - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Through this endpoint, VTEX will redirect the store administrator to the Payment provider website using the `token` retrieved in the [previous request](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/authorization/token). + + At this point in the flow, the provider shows the login site to the store admin and authorizes VTEX to use its integration as a valid Payment Provider Processor. After that, your server generates an `authorizationCode`. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `token` | query | (Required) Token information. | + | `applicationId` | query | (Required) VTEX application identifier. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/3. Return to VTEX.yml b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/3. Return to VTEX.yml new file mode 100644 index 0000000000..cf83854db9 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/3. Return to VTEX.yml @@ -0,0 +1,62 @@ +info: + name: 3. Return to VTEX + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/authorizationCode?providerAuthorizationCode={providerAuthorizationCode}" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + params: + - name: providerAuthorizationCode + value: "{providerAuthorizationCode}" + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/authorizationCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Through this endpoint, the provider will redirect the store administrator to the VTEX website using the `returnUrl` passed from VTEX to create token. + + The `returnUrl` must be filled with your query string **authorizationCode**. + + Example: + + If you receive the following URL: + + `https://store.vtex.com/return?authorizationCode=&otherparams...` + + and your **authorizationCode** is `pro2018`. Then, you redirect the store administrator to: `https://store.vtex.com/return?authorizationCode=pro2018&otherparams...`. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `providerAuthorizationCode` | query | (Required) Provider authorization code information. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | diff --git a/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/4. Get credentials.yml b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/4. Get credentials.yml new file mode 100644 index 0000000000..82467e1ecd --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/4. Get credentials.yml @@ -0,0 +1,90 @@ +info: + name: 4. Get credentials + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/authorization/credentials?authorizationCode={authorizationCode}&applicationId=vtex" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Accept + value: application/json + params: + - name: authorizationCode + value: "{authorizationCode}" + type: query + - name: applicationId + value: vtex + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/authorization/credentials - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/authorization/credentials - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/authorization/credentials - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/authorization/credentials - Schema is valid", function () { + const schema = {"required":["applicationId","appKey","appToken"],"type":"object","description":"Credentials information.","properties":{"applicationId":{"type":"string","description":"This value is always identified as `vtex`."},"appKey":{"type":"string","description":"It will be used in all API requests as X-VTEX-API-AppKey."},"appToken":{"type":"string","description":"It will be used in all API requests as X-VTEX-API-AppToken."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves merchant credentials. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `authorizationCode` | query | (Required) Code generate by affiliation that will be used to identify the merchant authorization. | + | `applicationId` | query | (Required) VTEX application identifier. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). | + + ## Example response (`200`) + + ```json + { + "applicationId": "vtex", + "appKey": "c5a5e3f1-4a77-4a00-8b53-0d1adb3e9628", + "appToken": "57ea254d-f3d3-488d-88d7-129766037ed1" + } + ``` diff --git a/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/folder.yml b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/folder.yml new file mode 100644 index 0000000000..8895dbde03 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/OAuth Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: OAuth Flow + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Antifraud Provider API/environments/VTEX.yml b/BrunoCollections/VTEX - Antifraud Provider API/environments/VTEX.yml new file mode 100644 index 0000000000..d17c3f4dc6 --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/environments/VTEX.yml @@ -0,0 +1,12 @@ +name: VTEX +variables: + - name: providerApiEndpoint + value: "{providerApiEndpoint}" + - name: baseUrl + value: https://{{providerApiEndpoint}} + - secret: true + name: X-PROVIDER-API-AppKey + - secret: true + name: X-PROVIDER-API-AppToken + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Antifraud Provider API/opencollection.yml b/BrunoCollections/VTEX - Antifraud Provider API/opencollection.yml new file mode 100644 index 0000000000..601036f7ed --- /dev/null +++ b/BrunoCollections/VTEX - Antifraud Provider API/opencollection.yml @@ -0,0 +1,43 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Antifraud Provider API + +docs: + content: |- + >ℹ️ Onboarding guide + > + > Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey. + + The Anti-fraud Provider Protocol is a set of definitions to help you integrate your anti-fraud service API into VTEX platform. + + To achieve this, you need to implement a web API (REST) following the specifications described in this documentation. + + >⚠️ You can also access our [template on GitHub](https://github.com/vtex-apps/antifraud-provider-example) to help you quickly develop your anti-fraud connector using the Anti-fraud Provider Protocol and VTEX IO. + + To learn more about the Anti-fraud Provider Protocol, check our [developer guide](https://developers.vtex.com/docs/guides/how-the-integration-protocol-between-vtex-and-antifraud-companies-works). + + ## Anti-fraud Provider API Index + + ### Anti-fraud Flow + + - `POST` [Send anti-fraud pre-analysis data (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/pre-analysis) + - `POST` [Send anti-fraud data](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions) + - `PUT` [Update anti-fraud transactions (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#put-/transactions/-transactionId-) + - `GET` [List anti-fraud provider manifest](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/manifest) + - `GET` [Get anti-fraud status](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/transactions/-transactions.id-) + - `DELETE` [Stop anti-fraud analysis (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#delete-/transactions/-transactions.Id-) + + ### OAuth Flow + + 1. `POST` [Retrieve token](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/authorization/token) + 2. `GET` [Redirect](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/redirect) + 3. `GET` [Return to VTEX](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/authorizationCode) + 4. `GET` [Get credentials](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/authorization/credentials) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Audience API/Audience Manager/Fetch audience.yml b/BrunoCollections/VTEX - Audience API/Audience Manager/Fetch audience.yml new file mode 100644 index 0000000000..a3332c08f5 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Audience Manager/Fetch audience.yml @@ -0,0 +1,85 @@ +info: + name: Fetch audience + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/audience-manager/pvt/audience" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + body: + type: json + data: |- + { + "email": "shopper-email@email.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/audience-manager/pvt/audience - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/audience-manager/pvt/audience - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/audience-manager/pvt/audience - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/audience-manager/pvt/audience - Schema is valid", function () { + const schema = {"type":"array","description":"Array of price table IDs.","items":{"type":"string","description":"Audience ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fetch the audience ID based on the provided shopper email. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "f8cb4d62-b43a-599c-89cc-027fadaa4b18" + ] + ``` diff --git a/BrunoCollections/VTEX - Audience API/Audience Manager/folder.yml b/BrunoCollections/VTEX - Audience API/Audience Manager/folder.yml new file mode 100644 index 0000000000..8c5de07cbe --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Audience Manager/folder.yml @@ -0,0 +1,4 @@ +info: + name: Audience Manager + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Audience API/Price Table Mapper/Delete price table mapping.yml b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Delete price table mapping.yml new file mode 100644 index 0000000000..efeb568426 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Delete price table mapping.yml @@ -0,0 +1,53 @@ +info: + name: Delete price table mapping + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/price-table-mapper/pvt/mapping/:audienceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: audienceId + value: f8cb4d62-b43a-599c-89cc-027fadaa4b18 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/price-table-mapper/pvt/mapping/:audienceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/price-table-mapper/pvt/mapping/:audienceId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes the price table mapping for the provided audience. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `audienceId` | path | (Required) ID that represents an audience. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Audience API/Price Table Mapper/Get price table mapping.yml b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Get price table mapping.yml new file mode 100644 index 0000000000..1477799256 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Get price table mapping.yml @@ -0,0 +1,78 @@ +info: + name: Get price table mapping + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/price-table-mapper/pvt/mapping/:audienceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: audienceId + value: f8cb4d62-b43a-599c-89cc-027fadaa4b18 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/price-table-mapper/pvt/mapping/:audienceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/price-table-mapper/pvt/mapping/:audienceId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/price-table-mapper/pvt/mapping/:audienceId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/price-table-mapper/pvt/mapping/:audienceId - Schema is valid", function () { + const schema = {"type":"array","description":"Array of price table IDs.","items":{"type":"string","description":"Price table ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fetches the price table mapping for a specific audience. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `audienceId` | path | (Required) ID that represents an audience. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "priceTable01" + ] + ``` diff --git a/BrunoCollections/VTEX - Audience API/Price Table Mapper/Set price table mapping.yml b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Set price table mapping.yml new file mode 100644 index 0000000000..515b90ae77 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Price Table Mapper/Set price table mapping.yml @@ -0,0 +1,60 @@ +info: + name: Set price table mapping + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/price-table-mapper/pvt/mapping/:audienceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: audienceId + value: f8cb4d62-b43a-599c-89cc-027fadaa4b18 + type: path + body: + type: json + data: |- + [ + "myPriceTable", + "myPriceTable" + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/price-table-mapper/pvt/mapping/:audienceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/price-table-mapper/pvt/mapping/:audienceId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sets one or more price table mappings for the specified audience. Each price table ID in the array defines a distinct price table that applies to the audience. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `audienceId` | path | (Required) ID that represents an audience. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Audience API/Price Table Mapper/folder.yml b/BrunoCollections/VTEX - Audience API/Price Table Mapper/folder.yml new file mode 100644 index 0000000000..c8a0187177 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/Price Table Mapper/folder.yml @@ -0,0 +1,4 @@ +info: + name: Price Table Mapper + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Audience API/environments/VTEX.yml b/BrunoCollections/VTEX - Audience API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Audience API/opencollection.yml b/BrunoCollections/VTEX - Audience API/opencollection.yml new file mode 100644 index 0000000000..b9c45b088a --- /dev/null +++ b/BrunoCollections/VTEX - Audience API/opencollection.yml @@ -0,0 +1,42 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Audience API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + API for managing audiences and mapping [price tables](https://help.vtex.com/en/tutorial/setting-up-price-tables-for-specific-users--5S9oDOMHNmY4K0kAewAiWY) to these audiences for contextual seller pricing. + + ## Index + + ### Audience Manager + - `POST` [Fetch audience](https://developers.vtex.com/docs/api-reference/audience-api/#post-/api/audience-manager/pvt/audience) + + ### Price Table Mapper + - `GET` [Get price table mapping](https://developers.vtex.com/docs/api-reference/audience-api/#get-/api/price-table-mapper/pvt/mapping/-audienceId-) + - `PUT` [Set price table mapping](https://developers.vtex.com/docs/api-reference/audience-api/#put-/api/price-table-mapper/pvt/mapping/-audienceId-) + - `DELETE`[Delete price table mapping](https://developers.vtex.com/docs/api-reference/audience-api/#delete-/api/price-table-mapper/pvt/mapping/-audienceId-) + + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}`| Name of the VTEX account. Used as part of the URL. | + | `{{environment}}`| Name of the VTEX account. Used as part of the URL. | + | `{{X-VTEX-API-AppKey}}` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + | `{{X-VTEX-API-AppToken}}` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/Create B2B address.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Create B2B address.yml new file mode 100644 index 0000000000..26bc09c616 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Create B2B address.yml @@ -0,0 +1,109 @@ +info: + name: Create B2B address + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/AD/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "addressName": "NC Office", + "addressLabel": "NC Office", + "addressType": "commercial", + "receiverName": ".", + "city": "Orlando", + "state": "FL", + "country": "USA", + "postalCode": "02999", + "street": "Main Street", + "number": "300", + "neighborhood": "Downtown", + "complement": "3rd floor", + "reference": "Next to the park", + "geoCoordinates": [ + 28.48, + -81.2 + ], + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/AD/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/AD/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/AD/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/AD/documents - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object for a created or updated document.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new B2B address document in the `AD` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "AD-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/AD/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/Delete B2B address.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Delete B2B address.yml new file mode 100644 index 0000000000..073fc5ae23 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Delete B2B address.yml @@ -0,0 +1,61 @@ +info: + name: Delete B2B address + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Accept + value: application/json + params: + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific B2B address document from the `AD` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the B2B address to be deleted. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/Get B2B address by ID.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Get B2B address by ID.yml new file mode 100644 index 0000000000..5ff52d9c2c --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Get B2B address by ID.yml @@ -0,0 +1,121 @@ +info: + name: Get B2B address by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + disabled: true + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a B2B address document.","properties":{"addressLabel":{"type":["string","null"],"description":"User-defined label to identify the B2B address."},"addressType":{"type":["string","null"],"description":"Type of B2B address. `commercial` for shipping (delivery) or `invoice` for billing (payment).","enum":["commercial","invoice"]},"city":{"type":["string","null"],"description":"City of the B2B address."},"complement":{"type":["string","null"],"description":"Any additional information for the B2B address (for example, apartment or floor)."},"country":{"type":["string","null"],"description":"Country of the B2B address in three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format (for example, `USA`)."},"geoCoordinates":{"type":["array","null"],"description":"Geographical coordinates of the B2B address as an array of doubles (latitude and longitude), or an empty array `[]`.","items":{"type":"number","format":"double","description":"Latitude or longitude value."}},"neighborhood":{"type":["string","null"],"description":"Neighborhood of the B2B address."},"number":{"type":["string","null"],"description":"Street number of the B2B address."},"postalCode":{"type":["string","null"],"description":"Postal code of the B2B address. The format must match the exact country postal code format (for example, `02999` for addresses in the USA)."},"receiverName":{"type":["string","null"],"description":"Name of the person or entity receiving at this B2B address. This field will be deprecated in favor of the [Recipients](https://developers.vtex.com/docs/api-reference/b2b-addresses#post-/api/dataentities/contact_information/documents) feature, but it must be filled with some value."},"reference":{"type":["string","null"],"description":"Optional reference point or landmark near the B2B address."},"state":{"type":["string","null"],"description":"State or province of the B2B address as a two-letter code (for example, `FL` or `SP`)."},"street":{"type":["string","null"],"description":"Street name of the B2B address."},"userId":{"type":["string","null"],"description":"ID of the buyer organization to whom the B2B address belongs."},"id":{"type":["string","null"],"description":"Unique identifier for this B2B address record."},"accountId":{"type":["string","null"],"description":"ID of the account related to this B2B address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this B2B address."},"dataEntityId":{"type":["string","null"],"description":"ID of the data entity this B2B address belongs to (always `AD`)."},"createdBy":{"type":["string","null"],"description":"ID of the user who created the B2B address record."},"createdIn":{"type":["string","null"],"description":"Timestamp of when the B2B address record was created."},"updatedBy":{"type":["string","null"],"description":"ID of the user who last updated the B2B address record."},"updatedIn":{"type":["string","null"],"description":"Timestamp of the last update to the B2B address record."},"lastInteractionBy":{"type":["string","null"],"description":"ID of the user who had the last interaction with the record."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of the last interaction with the record."},"followers":{"type":["array","null"],"description":"List of users following this B2B address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this B2B address.","items":{"type":"string","description":"Tag value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a specific B2B address by its unique identifier. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the B2B address to retrieve. | + | `_fields` | query | Specifies which fields of the document should be included in the response. Use `_all` to return all fields, or provide a comma-separated list of field names. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "addressLabel": "NC Office", + "addressType": "commercial", + "city": "Orlando", + "complement": "", + "country": "USA", + "geoCoordinates": [ + 28.48, + -81.2 + ], + "neighborhood": "", + "number": "11", + "postalCode": "02999", + "receiverName": ".", + "reference": null, + "state": "FL", + "street": "Toringon Street", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "id": "4286e252-050b-11f0-b37f-d6617047d485", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "qastore", + "dataEntityId": "AD", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdIn": "2025-03-19T21:44:01.4199691Z", + "updatedBy": null, + "updatedIn": null, + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionIn": "2025-03-19T21:44:01.4199691Z", + "followers": [], + "tags": [] + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/Search B2B addresses.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Search B2B addresses.yml new file mode 100644 index 0000000000..987e085e36 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Search B2B addresses.yml @@ -0,0 +1,148 @@ +info: + name: Search B2B addresses + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/AD/search" + headers: + - name: Accept + value: application/json + - name: REST-Range + value: resources=0-10 + params: + - name: _fields + value: addressType,city,state,country,postalCode,userId + type: query + disabled: true + - name: _where + value: userId=2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: query + disabled: true + - name: _sort + value: createdIn DESC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/AD/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/AD/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/AD/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/AD/search - Schema is valid", function () { + const schema = {"type":"array","description":"List of B2B address documents matching the search criteria.","items":{"type":"object","description":"Response body for a B2B address document.","properties":{"addressLabel":{"type":["string","null"],"description":"User-defined label to identify the B2B address."},"addressType":{"type":["string","null"],"description":"Type of B2B address. `commercial` for shipping (delivery) or `invoice` for billing (payment).","enum":["commercial","invoice"]},"city":{"type":["string","null"],"description":"City of the B2B address."},"complement":{"type":["string","null"],"description":"Any additional information for the B2B address (for example, apartment or floor)."},"country":{"type":["string","null"],"description":"Country of the B2B address in three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format (for example, `USA`)."},"geoCoordinates":{"type":["array","null"],"description":"Geographical coordinates of the B2B address as an array of doubles (latitude and longitude), or an empty array `[]`.","items":{"type":"number","format":"double","description":"Latitude or longitude value."}},"neighborhood":{"type":["string","null"],"description":"Neighborhood of the B2B address."},"number":{"type":["string","null"],"description":"Street number of the B2B address."},"postalCode":{"type":["string","null"],"description":"Postal code of the B2B address. The format must match the exact country postal code format (for example, `02999` for addresses in the USA)."},"receiverName":{"type":["string","null"],"description":"Name of the person or entity receiving at this B2B address. This field will be deprecated in favor of the [Recipients](https://developers.vtex.com/docs/api-reference/b2b-addresses#post-/api/dataentities/contact_information/documents) feature, but it must be filled with some value."},"reference":{"type":["string","null"],"description":"Optional reference point or landmark near the B2B address."},"state":{"type":["string","null"],"description":"State or province of the B2B address as a two-letter code (for example, `FL` or `SP`)."},"street":{"type":["string","null"],"description":"Street name of the B2B address."},"userId":{"type":["string","null"],"description":"ID of the buyer organization to whom the B2B address belongs."},"id":{"type":["string","null"],"description":"Unique identifier for this B2B address record."},"accountId":{"type":["string","null"],"description":"ID of the account related to this B2B address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this B2B address."},"dataEntityId":{"type":["string","null"],"description":"ID of the data entity this B2B address belongs to (always `AD`)."},"createdBy":{"type":["string","null"],"description":"ID of the user who created the B2B address record."},"createdIn":{"type":["string","null"],"description":"Timestamp of when the B2B address record was created."},"updatedBy":{"type":["string","null"],"description":"ID of the user who last updated the B2B address record."},"updatedIn":{"type":["string","null"],"description":"Timestamp of the last update to the B2B address record."},"lastInteractionBy":{"type":["string","null"],"description":"ID of the user who had the last interaction with the record."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of the last interaction with the record."},"followers":{"type":["array","null"],"description":"List of users following this B2B address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this B2B address.","items":{"type":"string","description":"Tag value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves B2B addresses from the `AD` data entity, with support for field selection, filtering, sorting, and pagination. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api) and [Querying documents in Master Data v1](https://developers.vtex.com/docs/guides/querying-documents-in-master-data-v1). + + ## Query examples + + | **Filter type** | **Example** | + | --- | --- | + | **Simple filter** | `/dataentities/AD/search?userId=2da4e9ab-050b-11f0-b37f-f4b136dbcce1` | + | **Complex filter** | `/dataentities/AD/search?_where=(addressType=commercial OR addressType=invoice) AND country=USA` | + | **Date range** | `/dataentities/AD/search?_where=createdIn between 2024-01-01 AND 2025-01-01` | + | **Partial filter** | `/dataentities/AD/search?city=*Orlando*` | + | **Null values** | `/dataentities/AD/search?_where=reference is null` | + | **Non-null values** | `/dataentities/AD/search?_where=reference is not null` | + | **Difference** | `/dataentities/AD/search?_where=state<>FL` | + + >⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_fields` | query | Names of the fields that will be returned per document, separated by a comma `,`. It is possible to fetch all fields using `_all` as the value of this query parameter. However, in order to avoid permission errors, we strongly recommend informing only the names of the exact fields that will be used. | + | `_where` | query | Defines a condition the B2B address document must comply with. When referring to fields, you can use a nested field up to the first level. For example, filter by buyer organization with `userId=2da4e9ab-050b-11f0-b37f-f4b136dbcce1`. | + | `_sort` | query | Defines sorting mode in two parts. The first part is the name of the field you want to sort by. In the second part, use `ASC` for ascending order or `DESC` for descending order. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | (Required) Specifies the range of documents to be returned in the response. The value should follow the format `resources={x}-{y}`, where: * `x`: Index of the first document in the returned array. * `y`: Index of the last document in the returned array + 1. This field controls pagination by defining the subset of documents to be retrieved. The maximum number of documents returned per query is limited to 100. For example, `resources=0-10` returns the first 10 documents. | + + ## Example response (`200`) + + ```json + [ + { + "id": "4286e252-050b-11f0-b37f-d6617047d485", + "addressType": "commercial", + "addressLabel": "NC Office", + "receiverName": ".", + "street": "Toringon Street", + "number": "11", + "city": "Orlando", + "state": "FL", + "country": "USA", + "postalCode": "02999", + "geoCoordinates": [ + 28.48, + -81.2 + ], + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + }, + { + "id": "7de8a913-16a4-11ef-bc95-0ac138d2d42e", + "addressType": "invoice", + "addressLabel": "Billing HQ", + "receiverName": ".", + "street": "Corporate Ave", + "number": "200", + "city": "Miami", + "state": "FL", + "country": "USA", + "postalCode": "33101", + "geoCoordinates": [], + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/Update B2B address.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Update B2B address.yml new file mode 100644 index 0000000000..c633c5c92d --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/Update B2B address.yml @@ -0,0 +1,116 @@ +info: + name: Update B2B address + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + body: + type: json + data: |- + { + "addressName": "NC Office", + "addressLabel": "NC Office", + "postalCode": "02999", + "street": "Toringon Street", + "number": "11", + "neighborhood": "", + "complement": "", + "city": "Orlando", + "state": "FL", + "country": "USA", + "receiverName": ".", + "geoCoordinates": [ + 28.48, + -81.2 + ], + "addressType": "commercial", + "reference": "Grey building", + "userId": "2da4e9ab-050b-11f0-b37f-d6617047d485" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object for a created or updated document.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates an existing B2B address document in the `AD` data entity. + + > ⚠️ When updating addresses you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan). + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the B2B address to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "AD-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/AD/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Addresses/folder.yml b/BrunoCollections/VTEX - B2B Addresses API/Addresses/folder.yml new file mode 100644 index 0000000000..4c93ba84ec --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Addresses/folder.yml @@ -0,0 +1,4 @@ +info: + name: Addresses + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/Create location.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/Create location.yml new file mode 100644 index 0000000000..6a0495cb6b --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/Create location.yml @@ -0,0 +1,97 @@ +info: + name: Create location + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": "4286e252-050b-11f0-b37f-d6617047d485", + "value": "CC3", + "description": "Cost Center 3" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/customFieldValues/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing the created location information.","properties":{"Id":{"type":"string","description":"Unique identifier of the created location, prefixed with the data entity name."},"Href":{"type":"string","description":"Direct URL to access the created location document."},"DocumentId":{"type":"string","description":"The location ID without the data entity prefix."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a location value associated with a B2B address. A location is a [custom checkout field](https://developers.vtex.com/docs/guides/custom-fields-integration) value linked to a specific B2B address through the `auxId` field (the B2B address ID). This endpoint assumes the underlying location setting is already configured, which is the native behavior. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "customFieldValues-07d12677-08d8-11f0-b37f-e1ae31409099", + "Href": "https://accountName.myvtex.com.br/api/dataentities/customFieldValues/documents/07d12677-08d8-11f0-b37f-e1ae31409099", + "DocumentId": "07d12677-08d8-11f0-b37f-e1ae31409099" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/Delete location.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/Delete location.yml new file mode 100644 index 0000000000..405598a198 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/Delete location.yml @@ -0,0 +1,65 @@ +info: + name: Delete location + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:locationId?_fields=_all" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + - name: locationId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/customFieldValues/documents/:locationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/customFieldValues/documents/:locationId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific location. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location document. | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. This query string parameter allows you to specify which fields to include. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/Get location.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/Get location.yml new file mode 100644 index 0000000000..b6f3e1a4f6 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/Get location.yml @@ -0,0 +1,118 @@ +info: + name: Get location + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:locationId?_fields=_all" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + - name: locationId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/customFieldValues/documents/:locationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:locationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:locationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:locationId - Schema is valid", function () { + const schema = {"type":"object","description":"Location document object.","properties":{"id":{"type":"string","description":"The ID of the location document."},"dataEntityId":{"type":"string","description":"The ID of the data entity (`customFieldValues`)."},"accountId":{"type":"string","description":"Unique identifier of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"followers":{"type":"array","description":"Array of followers for this document.","items":{"type":"string","description":"Follower identifier."}},"schemas":{"type":"array","description":"Array of schemas associated with this document.","items":{"type":"string","description":"Schema version."}},"customFieldId":{"type":"string","description":"The ID of the location setting to which this location belongs."},"contractId":{"type":"string","description":"The ID of the contract to which this location belongs."},"auxId":{"type":["string","null"],"description":"ID of the B2B address associated with this location."},"value":{"type":"string","description":"The actual value of the location."},"description":{"type":["string","null"],"description":"Optional description explaining what the value represents."},"createdBy":{"type":"string","description":"ID of the user who created the document."},"createdBy_USER":{"type":"object","description":"Metadata about the creator.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"createdIn":{"type":"string","format":"date-time","description":"Timestamp when the document was created."},"lastInteractionBy":{"type":"string","description":"ID of the last user who modified the document."},"lastInteractionBy_USER":{"type":"object","description":"Metadata about the last interacting user.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"lastInteractionIn":{"type":"string","format":"date-time","description":"Timestamp of the last modification."},"Tags":{"type":"array","description":"Tags associated with the document.","items":{"type":"string","description":"Tag value."}},"dataInstanceId":{"type":"string","description":"Unique identifier of the data instance."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific location by its ID. The `auxId` field identifies the B2B address associated with this location. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location document. | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. This query string parameter allows you to specify which fields to include. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "a50012d0-c01f-465d-b4bc-e33b38d7437a", + "dataEntityId": "customFieldValues", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "store", + "followers": [], + "schemas": [], + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "auxId": "4286e252-050b-11f0-b37f-d6617047d485", + "value": "CC3", + "description": "Cost Center 3", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdBy_USER": { + "Id": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "Login": "user@vtex.com", + "Name": null + }, + "createdIn": "2025-04-11T18:24:14.8763277Z", + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionBy_USER": { + "Id": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "Login": "user@vtex.com", + "Name": null + }, + "lastInteractionIn": "2025-04-11T18:24:14.8763277Z", + "tags": [], + "dataInstanceId": "a50012d0-c01f-465d-b4bc-e33b38d7437a" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/Search locations.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/Search locations.yml new file mode 100644 index 0000000000..4c3b7f3273 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/Search locations.yml @@ -0,0 +1,113 @@ +info: + name: Search locations + type: http + seq: 5 + +http: + method: GET + url: '{{baseUrl}}/api/dataentities/customFieldValues/search?_schema=v1&_fields=_all&_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}"' + headers: + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: _fields + value: _all + type: query + - name: _where + value: contractId={{contractId}} AND customFieldId="{{customFieldId}}" + type: query + - name: _sort + value: value ASC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/customFieldValues/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array of location objects matching the search criteria.","items":{"type":"object","description":"Location search result object.","properties":{"id":{"type":"string","description":"The unique ID of the location document."},"contractId":{"type":"string","description":"The ID of the contract associated with the location."},"customFieldId":{"type":"string","description":"The ID of the location setting to which this location belongs."},"auxId":{"type":["string","null"],"description":"ID of the B2B address associated with this location."},"value":{"type":"string","description":"The value stored for the location."},"description":{"type":["string","null"],"description":"Optional text describing what the value represents."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves locations filtered by contract ID, location setting ID, and optionally by specific value. When searching locations associated with a particular B2B address, filter by `auxId={{addressId}}`. Results can be sorted by value. + + You can use the `_where` query parameter to filter results: + - To get all locations for a contract and setting: `_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}"` + - To get locations for a specific B2B address: `_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND auxId="{{addressId}}"` + - To get a specific value: `_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND value="{{value}}"` + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_where` | query | (Required) Filter expression to search documents using Master Data v2 query syntax. You can combine multiple conditions using `AND`. Examples: - Get all locations for a contract: `contractId={{contractId}}` - Filter by contract and setting: `contractId={{contractId}} AND customFieldId="{{customFieldId}}"` - Filter by B2B address: `contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND auxId="{{addressId}}"` - Filter by specific value: `contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND value="{{value}}"` Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_sort` | query | Defines the field and order for sorting results. Use the pattern `{fieldName} {ASC\|DESC}`. For example, `value ASC` sorts results by the `value` field in ascending order. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "e5130781-32ed-11f0-b37f-942217c27f9b", + "contractId": "1124b2d8-32eb-11f0-b37f-e2557e6b18d5", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": "4286e252-050b-11f0-b37f-d6617047d485", + "value": "CC3", + "description": "Cost Center 3" + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/Update location.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/Update location.yml new file mode 100644 index 0000000000..4b570ef7d0 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/Update location.yml @@ -0,0 +1,75 @@ +info: + name: Update location + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:locationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: locationId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + body: + type: json + data: |- + { + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": "4286e252-050b-11f0-b37f-d6617047d485", + "value": "CC3", + "description": "Cost Center 3" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/customFieldValues/documents/:locationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/customFieldValues/documents/:locationId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specific location. The `auxId` field must match the B2B address ID to which the location belongs. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Addresses API/Locations/folder.yml b/BrunoCollections/VTEX - B2B Addresses API/Locations/folder.yml new file mode 100644 index 0000000000..ca993c1fbe --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Locations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Locations + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/Create recipient.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Create recipient.yml new file mode 100644 index 0000000000..d478318efc --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Create recipient.yml @@ -0,0 +1,104 @@ +info: + name: Create recipient + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/contact_information/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/contact_information/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/contact_information/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Recipient document creation response.","properties":{"Id":{"type":"string","description":"Recipient document identifier. The prefix corresponds to the `contact_information` data entity name."},"Href":{"type":"string","description":"Recipient document store path."},"DocumentId":{"type":"string","description":"Recipient document ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new recipient document in the `contact_information` data entity. A recipient represents a person who can receive orders at one or more B2B addresses. Use the `addressIds` field to associate the recipient with existing B2B addresses from the `AD` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": "contact_information-123e4567-e89b-12d3-a456-426614174000", + "Href": "http://{{account}}.myvtex.com/api/dataentities/contact_information/documents/123e4567-e89b-12d3-a456-426614174000?_schema=v1", + "DocumentId": "123e4567-e89b-12d3-a456-426614174000" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/Delete recipient.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Delete recipient.yml new file mode 100644 index 0000000000..c44547b844 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Delete recipient.yml @@ -0,0 +1,61 @@ +info: + name: Delete recipient + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:recipientId" + headers: + - name: Accept + value: application/json + params: + - name: recipientId + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/contact_information/documents/:recipientId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/contact_information/documents/:recipientId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a recipient document from the `contact_information` data entity. This operation does not delete the B2B addresses associated with the recipient through the `addressIds` field. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recipientId` | path | (Required) Unique identifier of the recipient document. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/Get recipient by ID.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Get recipient by ID.yml new file mode 100644 index 0000000000..03cdf84463 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Get recipient by ID.yml @@ -0,0 +1,112 @@ +info: + name: Get recipient by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:recipientId?_schema=v1" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: firstName,lastName,email + type: query + disabled: true + - name: _schema + value: v1 + type: query + - name: recipientId + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/documents/:recipientId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:recipientId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:recipientId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/documents/:recipientId - Schema is valid", function () { + const schema = {"type":"object","description":"Recipient document object. A recipient can be associated with one or more B2B addresses through the `addressIds` field.","required":["firstName","lastName"],"properties":{"email":{"type":"string","description":"Recipient email."},"firstName":{"type":"string","description":"Recipient first name."},"lastName":{"type":"string","description":"Recipient last name."},"profileId":{"type":"string","format":"uuid","description":"ID of the contract (`CL` data entity) that owns the recipient. This is the `id` returned by the contract creation request."},"phone":{"type":"string","description":"Main phone number."},"phoneExtension":{"type":"string","description":"Internal phone extension, if applicable."},"document":{"type":"string","description":"Identification document."},"documentType":{"type":"string","description":"Type of document."},"addressIds":{"type":"array","description":"References to the B2B addresses associated with the recipient. Each value is the UUID of an address stored in the `AD` data entity.","items":{"type":"string","format":"uuid","description":"B2B address UUID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a recipient by ID from the `contact_information` data entity. The returned recipient may be associated with one or more B2B addresses through the `addressIds` field. + + >ℹ️ Assign the `_fields` parameter in the query string to retrieve the desired fields. If you want to return all the fields use `_fields=_all`. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recipientId` | path | (Required) Unique identifier of the recipient document. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/Search recipients.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Search recipients.yml new file mode 100644 index 0000000000..b06ffe99b3 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Search recipients.yml @@ -0,0 +1,115 @@ +info: + name: Search recipients + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/search?_where=profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f&_schema=v1" + headers: + - name: Accept + value: application/json + params: + - name: _where + value: profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f + type: query + - name: _fields + value: firstName,lastName,email + type: query + disabled: true + - name: _schema + value: v1 + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array of recipient objects.","items":{"type":"object","description":"Recipient object.","properties":{"firstName":{"type":"string","description":"Recipient first name."},"lastName":{"type":"string","description":"Recipient last name."},"email":{"type":"string","description":"Recipient email."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Searches for recipients in the `contact_information` data entity based on the query parameters. Recipients returned by this endpoint can be linked to one or more B2B addresses through the `addressIds` field. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + > ℹ️ It is also possible to use pagination and sort as described in the [Master Data v2 Search API](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/search) documentation. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_where` | query | (Required) Filter for recipient documents. This is a Master Data search condition built from the field names defined on the `contact_information` entity and the values you want to match. Use `fieldName=value` (for example, `email=example@example.com` or `profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f`). Combine conditions using the syntax supported for the Master Data v2 [Search Documents endpoint](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/search?endpoint=get-/api/dataentities/-dataEntityName-/search) (for example, `AND` / `OR` where applicable). Which fields you can use depends on your entity schema, not on this API parameter alone. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=firstName,lastName,email`. The default behavior is to return all fields. You can also use `_fields=_all` to fetch all fields. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "firstName": "Rafael", + "lastName": "Silva", + "email": "rafael.silva@example.com" + }, + { + "firstName": "Carolina", + "lastName": "Mendes", + "email": "carolina.mendes@example.com" + }, + { + "firstName": "Lucas", + "lastName": "Oliveira", + "email": "lucas.oliveira@example.com" + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/Update recipient.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Update recipient.yml new file mode 100644 index 0000000000..f58bc37aa8 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/Update recipient.yml @@ -0,0 +1,82 @@ +info: + name: Update recipient + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:recipientId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: recipientId + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/contact_information/documents/:recipientId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/contact_information/documents/:recipientId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates a recipient document in the `contact_information` data entity. Use the `addressIds` field to change the B2B addresses associated with the recipient. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recipientId` | path | (Required) Unique identifier of the recipient document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Addresses API/Recipients/folder.yml b/BrunoCollections/VTEX - B2B Addresses API/Recipients/folder.yml new file mode 100644 index 0000000000..24f1b167a3 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/Recipients/folder.yml @@ -0,0 +1,4 @@ +info: + name: Recipients + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - B2B Addresses API/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Addresses API/environments/VTEX.yml new file mode 100644 index 0000000000..22216cd2e5 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/environments/VTEX.yml @@ -0,0 +1,14 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - name: contractId + value: "" + - name: customFieldId + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - B2B Addresses API/opencollection.yml b/BrunoCollections/VTEX - B2B Addresses API/opencollection.yml new file mode 100644 index 0000000000..2970e6c5cd --- /dev/null +++ b/BrunoCollections/VTEX - B2B Addresses API/opencollection.yml @@ -0,0 +1,51 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Addresses API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The B2B Addresses API allows you to manage B2B addresses and their related entities in VTEX. A B2B address stores location data used for shipping and billing. Addresses, recipients, and locations are stored in [Master Data](https://developers.vtex.com/docs/guides/master-data-introduction) data entities. + + >⚠️ This API is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## B2B address requirements + + B2B addresses must follow these rules: + + | **Field** | **Required** | **Description** | + | --- | --- | --- | + | `addressType` | Yes | Type of address. Use `commercial` for shipping (delivery) or `invoice` for billing (payment). | + | `receiverName` | Yes | Name of the person receiving orders at this address. This field will be deprecated in favor of the [Recipients](https://developers.vtex.com/docs/api-reference/b2b-addresses#post-/api/dataentities/contact_information/documents) feature, but it must be filled with some value (for example, `.`). | + | `country` | Yes | Three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code (for example, `BRA` or `USA`). | + | `state` | Yes | Two-letter state or province code (for example, `FL` or `SP`). Full names such as `Florida` are not accepted. | + | `postalCode` | Yes | String following the exact country format (for example, `02999` instead of `2999`). Nine-digit formats are not accepted. | + | `geoCoordinates` | No | Array of doubles representing latitude and longitude (for example, `[28.48, -81.20]`), or an empty array `[]`. | + + ## Addresses + + Stored in the `AD` data entity. A B2B address represents a shipping or billing location tied to a buyer organization. + + ## Recipients + + Stored in the `contact_information` data entity. A recipient represents a person who can receive orders at one or more B2B addresses. Recipients are linked to B2B addresses through the `addressIds` field. + + ## Locations + + A location is a specific delivery point within a site, such as a dock, department, or internal area. For example, freight may be consigned to the company's street address while the actual delivery is to Dock 3456. The **Locations API** is based in the [Custom Fields API](https://developers.vtex.com/docs/api-reference/custom-fields-api). + + To discover the `customFieldId` for your account, list the existing settings with `GET` [Search custom field settings](https://developers.vtex.com/docs/api-reference/custom-fields-api#get-/api/dataentities/customFieldSettings/search) and pick the one matching the location feature. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Create buyer.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Create buyer.yml new file mode 100644 index 0000000000..845947e386 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Create buyer.yml @@ -0,0 +1,112 @@ +info: + name: Create buyer + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/shopper/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/shopper/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/shopper/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/shopper/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/shopper/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object returned when a document is successfully created.","properties":{"Id":{"type":"string","description":"Unique identifier of the document, prefixed with the entity name (`buyer`)."},"Href":{"type":"string","description":"URL to access the document. May be empty if not applicable."},"DocumentId":{"type":"string","description":"Same as `Id`, used internally to identify the document."}},"required":["Id","DocumentId"]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint creates a buyer entity document. + + > ℹ️ The buyer schema supports additional properties. Clients can include extra properties (e.g., `phone2`, `marketingOptIn`) in the request body, and they will be persisted alongside the standard fields. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema name. The value must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": "buyer-a26301e6-1a1e-11f0-b37f-e46d3d0578c6", + "Href": "", + "DocumentId": "a26301e6-1a1e-11f0-b37f-e46d3d0578c6" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Delete buyer.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Delete buyer.yml new file mode 100644 index 0000000000..88cf39dd31 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Delete buyer.yml @@ -0,0 +1,63 @@ +info: + name: Delete buyer + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/shopper/documents/:buyerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: buyerId + value: buyer-8abea412-4702-46fb-b835-3edb29d8a261 + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/shopper/documents/:buyerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a buyer document. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `buyerId` | path | (Required) Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer by ID.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer by ID.yml new file mode 100644 index 0000000000..b37cda805a --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer by ID.yml @@ -0,0 +1,120 @@ +info: + name: Get buyer by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/documents/:buyerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: buyerId + value: buyer-8abea412-4702-46fb-b835-3edb29d8a261 + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/documents/:buyerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/documents/:buyerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/shopper/documents/:buyerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/documents/:buyerId - Schema is valid", function () { + const schema = {"type":"object","description":"Buyer document. May include additional properties beyond the standard schema if they were previously stored.","properties":{"userId":{"type":"string","format":"uuid","description":"Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users)."},"email":{"type":"string","description":"Buyer's email."},"firstName":{"type":"string","description":"Buyer's first name."},"lastName":{"type":"string","description":"Buyer's last name."},"document":{"type":"string","description":"Buyer's document number (e.g., CPF number)."},"documentType":{"type":"string","description":"Type of the document provided (e.g., `cpf`)."},"phone":{"type":"string","description":"Buyer's phone number."},"cards":{"type":"array","description":"List of cards associated with the buyer. This field is used by the checkout module.","items":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"string","description":"Unique identifier of the saved card."},"paymentSystem":{"type":"string","description":"Code representing the payment system (e.g., `2` for Visa)."},"paymentSystemName":{"type":"string","description":"Name of the payment system (e.g., `Visa`)."},"cardNumber":{"type":"string","description":"Masked credit card number."},"bin":{"type":"string","description":"Bank Identification Number - the first digits of the card."},"expirationDate":{"type":"string","description":"Expiry date of the card in `MM/YYYY` format."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"cardLabel":{"type":"string","description":"Label or nickname for the card."},"isCardToken":{"type":"boolean","description":"Indicates whether the card data is tokenized."},"availableAddresses":{"type":"array","description":"Array of address IDs the card is associated with.","items":{"type":"string","description":"Address identifier."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a buyer entity document by User ID. + + > ℹ️ The response may include additional properties beyond the standard schema if they were previously stored (e.g., `phone2`, `marketingOptIn`). + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `buyerId` | path | (Required) Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true, + "cards": [ + { + "cardId": "D05881AD4F424A6C93D8536C9F7F992E", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************3232", + "bin": "22343333", + "availableAddresses": [ + "12345" + ], + "expirationDate": "02/2029", + "useCvvForAuthorization": true, + "isCardToken": false + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer schema.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer schema.yml new file mode 100644 index 0000000000..62b5eaa753 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Get buyer schema.yml @@ -0,0 +1,178 @@ +info: + name: Get buyer schema + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/schemas/v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Schema response containing the buyer entity schema definition with properties, required fields, and indexed fields configuration.","properties":{"name":{"type":"string","description":"Schema name."},"schema":{"type":"object","description":"Buyer schema definition containing properties, required fields, and indexed fields.","properties":{"title":{"type":"string","description":"Schema title."},"type":{"type":"string","description":"Schema type."},"properties":{"type":"object","description":"Schema properties definition.","properties":{"userId":{"required":["type","format"],"type":"object","description":"Buyer identifier definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the buyer ID field."},"format":{"type":"string","description":"Indicates the expected format for the buyer ID field."}}},"email":{"type":"object","description":"Email field definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the email field."}}},"firstName":{"type":"object","description":"Buyer's first name definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the first name field."}}},"lastName":{"type":"object","description":"Buyer's last name definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the last name field."}}},"document":{"type":"object","description":"Buyer's document number (e.g., CPF) definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the document number field."}}},"documentType":{"type":"object","description":"Type of document (e.g., `cpf`) definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the document type field."}}},"phone":{"type":"object","description":"Buyer's phone number definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the phone number field."}}},"cards":{"type":"object","description":"Saved credit cards information. This field is used by the checkout module.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the cards field."},"items":{"type":"object","description":"Credit card information.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the card ID field."},"properties":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"object","description":"Unique identifier of the saved card definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the card ID field."}}},"paymentSystem":{"type":"object","description":"Payment system definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the payment system field."}}},"paymentSystemName":{"type":"object","description":"Payment system name definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the payment system name field."}}},"cardNumber":{"type":"object","description":"Card number definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the card number field."},"pattern":{"type":"string","description":"Indicates the expected pattern for the card number field.","pattern":"^[\\*]{12}[0-9]{4}$"}}},"bin":{"type":"object","description":"Bin definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the bin field."}}},"expirationDate":{"type":"object","description":"Expiration date definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the expiration date field."}}},"useCvvForAuthorization":{"type":"object","properties":{"type":{"type":"string","description":"Indicates the expected data type for the use CVV for authorization field."}},"description":"Indicates the expected data type for the use CVV for authorization field."},"cardLabel":{"type":"object","description":"Card label definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the card label field."}}},"isCardToken":{"type":"object","description":"`isCardToken` definition.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the `isCardToken` field."}}},"availableAddresses":{"type":"object","description":"Indicates the expected data type for the available addresses field.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the available addresses field."},"items":{"type":"object","description":"Address identifier.","properties":{"type":{"type":"string","description":"Indicates the expected data type for the address identifier field."}}}}}}},"additionalProperties":{"type":"boolean","description":"When `true`, allows clients to send and persist custom fields beyond the defined schema. This enables storing extra fields like `phone2`, `marketingOptIn`, or any buyer-specific data."}}}}}}},"additionalProperties":{"type":"boolean","description":"When `true`, allows clients to send and persist custom fields beyond the defined schema. This enables storing extra fields like `phone2`, `marketingOptIn`, or any buyer-specific data."},"requiredField":{"title":"required","type":"array","description":"List of required properties.","items":{"type":"string","description":"Name of a required property field."}},"v-indexed":{"type":"array","description":"List of indexed properties.","items":{"type":"string","description":"Name of an indexed property field."}}}}},"required":["name","schema"]}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a buyer entity [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) with buyer personal data. + + > ℹ️ The buyer schema supports `additionalProperties: true`, allowing clients to send and persist additional properties beyond the defined schema properties (e.g., `phone2`, `marketingOptIn`, or any business-specific fields). + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "name": "v1", + "schema": { + "title": "buyer", + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "document": { + "type": "string" + }, + "documentType": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "cards": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cardId": { + "type": "string" + }, + "paymentSystem": { + "type": "string" + }, + "paymentSystemName": { + "type": "string" + }, + "cardNumber": { + "type": "string", + "pattern": "^[\\*]{12}[0-9]{4}$" + }, + "bin": { + "type": "string" + }, + "expirationDate": { + "type": "string" + }, + "useCvvForAuthorization": { + "type": "boolean" + }, + "cardLabel": { + "type": "string" + }, + "isCardToken": { + "type": "boolean" + }, + "availableAddresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": true, + "required": [ + "userId", + "firstName", + "lastName" + ], + "v-indexed": [ + "userId", + "firstName", + "lastName", + "document", + "phone" + ] + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Search buyers.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Search buyers.yml new file mode 100644 index 0000000000..d0a58f6e6b --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Search buyers.yml @@ -0,0 +1,128 @@ +info: + name: Search buyers + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/search?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _where + value: userId=8abea412-4702-46fb-b835-3edb29d8a261 + type: query + disabled: true + - name: _schema + value: v1 + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/search - Content-Type is application/vnd.vtex.create-budget+json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/vnd.vtex.create-budget+json"); + }); + + test("[GET]::/api/dataentities/shopper/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/search - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Buyer document. May include additional properties beyond the standard schema if they were previously stored.","properties":{"userId":{"type":"string","format":"uuid","description":"Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users)."},"email":{"type":"string","description":"Buyer's email."},"firstName":{"type":"string","description":"Buyer's first name."},"lastName":{"type":"string","description":"Buyer's last name."},"document":{"type":"string","description":"Buyer's document number (e.g., CPF number)."},"documentType":{"type":"string","description":"Type of the document provided (e.g., `cpf`)."},"phone":{"type":"string","description":"Buyer's phone number."},"cards":{"type":"array","description":"List of cards associated with the buyer. This field is used by the checkout module.","items":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"string","description":"Unique identifier of the saved card."},"paymentSystem":{"type":"string","description":"Code representing the payment system (e.g., `2` for Visa)."},"paymentSystemName":{"type":"string","description":"Name of the payment system (e.g., `Visa`)."},"cardNumber":{"type":"string","description":"Masked credit card number."},"bin":{"type":"string","description":"Bank Identification Number - the first digits of the card."},"expirationDate":{"type":"string","description":"Expiry date of the card in `MM/YYYY` format."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"cardLabel":{"type":"string","description":"Label or nickname for the card."},"isCardToken":{"type":"boolean","description":"Indicates whether the card data is tokenized."},"availableAddresses":{"type":"array","description":"Array of address IDs the card is associated with.","items":{"type":"string","description":"Address identifier."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint searches a buyer entity document by User ID. + + > ℹ️ The response may include additional properties beyond the standard schema if they were previously stored (e.g., `phone2`, `marketingOptIn`). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **List Applications** | + | Master Data | Application | **View logs** | + | Master Data | Form | **List Forms** | + | Master Data | Comment | **List Comments** | + | Master Data | Customized Search | **List Custom Search** | + | Master Data | Generic resources | **Read-only form access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_where` | query | Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users). Use the `userId={{userId}}` value. | + | `_schema` | query | (Required) Schema name. The value must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true, + "cards": [ + { + "cardId": "D05881AD4F424A6C93D8536C9F7F992E", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************3232", + "bin": "22343333", + "availableAddresses": [ + "12345" + ], + "expirationDate": "02/2029", + "useCvvForAuthorization": true, + "isCardToken": false + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Update buyer.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Update buyer.yml new file mode 100644 index 0000000000..e96afe0d8a --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/Update buyer.yml @@ -0,0 +1,84 @@ +info: + name: Update buyer + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/shopper/documents/:buyerId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: buyerId + value: buyer-8abea412-4702-46fb-b835-3edb29d8a261 + type: path + body: + type: json + data: |- + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/shopper/documents/:buyerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/shopper/documents/:buyerId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request allows you to partially update a buyer document. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ You can use this request to update documents for any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `buyerId` | path | (Required) Unique identifier for the buyer created by [VTEX ID API](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/authenticator/v1/storefront/users). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/folder.yml b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/folder.yml new file mode 100644 index 0000000000..bfd75706ff --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/Buyer data/folder.yml @@ -0,0 +1,4 @@ +info: + name: Buyer data + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Buyer Data API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - B2B Buyer Data API/opencollection.yml b/BrunoCollections/VTEX - B2B Buyer Data API/opencollection.yml new file mode 100644 index 0000000000..02b00114fe --- /dev/null +++ b/BrunoCollections/VTEX - B2B Buyer Data API/opencollection.yml @@ -0,0 +1,24 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Buyer Data API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The B2B Buyer Data API allows you to create, retrieve, update, delete, and search buyer documents stored in the `shopper` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Create new contact information.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Create new contact information.yml new file mode 100644 index 0000000000..d913558e24 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Create new contact information.yml @@ -0,0 +1,109 @@ +info: + name: Create new contact information + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/contact_information/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/contact_information/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/contact_information/documents - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"string","description":"Contact information identifier."},"Href":{"type":"string","description":"Contact information store path."},"DocumentId":{"type":"string","description":"Contact information document identifier."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint creates new contact information. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": "contact_information-123e4567-e89b-12d3-a456-426614174000", + "Href": "http://{{account}}.myvtex.com/api/dataentities/contact_information/documents/123e4567-e89b-12d3-a456-426614174000?_schema=v1", + "DocumentId": "123e4567-e89b-12d3-a456-426614174000" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Delete contact information.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Delete contact information.yml new file mode 100644 index 0000000000..a79387d013 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Delete contact information.yml @@ -0,0 +1,64 @@ +info: + name: Delete contact information + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/contact_information/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes contact information. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the contact information document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Get contact information by ID.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Get contact information by ID.yml new file mode 100644 index 0000000000..75da33f182 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Get contact information by ID.yml @@ -0,0 +1,115 @@ +info: + name: Get contact information by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: firstName,lastName,email + type: query + disabled: true + - name: _schema + value: v1 + type: query + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Schema is valid", function () { + const schema = {"type":"object","required":["firstName","lastName"],"properties":{"email":{"type":"string","description":"User email."},"firstName":{"type":"string","description":"User first name."},"lastName":{"type":"string","description":"User last name."},"profileId":{"type":"string","format":"uuid","description":"References a Customer entity by its [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)."},"phone":{"type":"string","description":"Main phone number."},"phoneExtension":{"type":"string","description":"Internal phone extension if applicable."},"document":{"type":"string","description":"Identification document."},"documentType":{"type":"string","description":"Type of document."},"addressIds":{"type":"array","description":"References to address entities.","items":{"type":"string","format":"uuid","description":"Address entity [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves contact information by ID. + + >ℹ️ Assign the `_fields` parameter in the query string to retrieve the desired fields. If you want to return all the fields use `_fields=_all`. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the contact information document. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + ``` diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Search contact information.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Search contact information.yml new file mode 100644 index 0000000000..da3589a76f --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Search contact information.yml @@ -0,0 +1,117 @@ +info: + name: Search contact information + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/search?_where=profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f&_fields=firstName,lastName,email&_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _where + value: profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f + type: query + - name: _fields + value: firstName,lastName,email + type: query + - name: _schema + value: v1 + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing contact information.","items":{"type":"object","description":"Contact information object.","properties":{"firstName":{"type":"string","description":"User first name."},"lastName":{"type":"string","description":"User last name."},"email":{"type":"string","description":"User email."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint will search contacts information based in the query parameters. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + > ℹ️ It is also possible to use Pagination and Sort as described in the [Master Data V2 Search API](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/search) documentation. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts.\r + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_where` | query | (Required) Filter condition based in the document fields. For example, to filter by email, use `email=example@example.com`. | + | `_fields` | query | (Required) Data entities fields. Comma-separated list of fields to return. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "firstName": "Rafael", + "lastName": "Silva", + "email": "rafael.silva@example.com" + }, + { + "firstName": "Carolina", + "lastName": "Mendes", + "email": "carolina.mendes@example.com" + }, + { + "firstName": "Lucas", + "lastName": "Oliveira", + "email": "lucas.oliveira@example.com" + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Update contact information.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Update contact information.yml new file mode 100644 index 0000000000..173c01ec9b --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/Update contact information.yml @@ -0,0 +1,86 @@ +info: + name: Update contact information + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id" + headers: + - name: Accept + value: application/vnd.vtex.ds.v10+json + - name: Content-Type + value: application/json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/contact_information/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request allows you to partially update a contact information document. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the contact information document. | + | `_schema` | query | Name of the schema that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Contact Information API/Contact information/folder.yml b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/folder.yml new file mode 100644 index 0000000000..50fa563915 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/Contact information/folder.yml @@ -0,0 +1,4 @@ +info: + name: Contact information + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Contact Information API/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Contact Information API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - B2B Contact Information API/opencollection.yml b/BrunoCollections/VTEX - B2B Contact Information API/opencollection.yml new file mode 100644 index 0000000000..35ea718378 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contact Information API/opencollection.yml @@ -0,0 +1,33 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Contact Information API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The B2B Contact Information API allows you to create, retrieve, update, and delete contact information documents stored in the `contact_information` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Index + + ### Contact information + - `POST` [Create new contact information](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#post-/api/dataentities/contact_information/documents) + - `GET` [Search contact information](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#get-/api/dataentities/contact_information/search) + - `GET` [Get contact information by ID](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#get-/api/dataentities/contact_information/documents/-id-) + - `PATCH` [Update contact information](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#patch-/api/dataentities/contact_information/documents/-id-) + - `DELETE` [Delete contact information](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#delete-/api/dataentities/contact_information/documents/-id-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Contracts API/Contracts/Create contract.yml b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Create contract.yml new file mode 100644 index 0000000000..82ffff77c1 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Create contract.yml @@ -0,0 +1,153 @@ +info: + name: Create contract + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/CL/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + body: + type: json + data: |- + { + "email": "business-klub-spc@email.com", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "documentType": "CNPJ", + "corporateDocument": "00000000000000", + "homePhone": "1122223333", + "cellPhone": "1122223333", + "corporateName": "Business Klub SPC", + "tradeName": "Business Klub", + "isCorporate": true, + "stateRegistration": "", + "isFreeStateRegistration": true, + "priceTables": "CL4000060,CL3000007", + "restrictions": { + "vtex.catalog": { + "assortmentIds": [ + "1", + "2" + ] + }, + "vtex.checkout": { + "creditCards": [ + "da89bc50-994e-4e39-9974-4a9d081cc3f4", + "65ec3ec6-c504-4431-b17a-ea3800fb03d2" + ] + }, + "vtex.payments": { + "paymentSystemIds": [ + "1", + "2", + "3", + "4", + "5", + "7", + "8", + "9", + "14", + "21", + "29", + "31", + "33", + "34", + "35", + "36", + "37", + "48", + "789" + ] + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/CL/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/CL/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/CL/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/CL/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a created contract.","properties":{"id":{"type":"string","description":"The ID of the created contract document."},"href":{"type":"string","description":"URL of the created document."},"documentId":{"type":"string","description":"The document ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new contract with an ID automatically generated by VTEX, stored in the `CL` data entity. The request body is a JSON object where the key is the name of the field. + + > ⚠️ When creating contracts you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + Authentication requires the `VtexIdclientAutCookie` header. + + **Note**: The following restriction fields are accepted: + + - `vtex.catalog.assortmentIds` + - `vtex.checkout.creditCards` + - `vtex.payments.paymentSystemIds` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "CL-2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "documentId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Contracts API/Contracts/Delete contract by ID.yml b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Delete contract by ID.yml new file mode 100644 index 0000000000..d253a5393f --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Delete contract by ID.yml @@ -0,0 +1,64 @@ +info: + name: Delete contract by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/CL/documents/:contractId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to delete a specific contract from the data entity `CL`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to be deleted. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Contracts API/Contracts/Get contract by ID.yml b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Get contract by ID.yml new file mode 100644 index 0000000000..670a130850 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Get contract by ID.yml @@ -0,0 +1,184 @@ +info: + name: Get contract by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: _all + type: query + disabled: true + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a contract document.","properties":{"cluster":{"type":["string","null"],"description":"Internal or optional analytics or tags fields."},"priceTables":{"type":["string","null"],"description":"Comma-separated list of assigned price table codes."},"isCorporate":{"type":["boolean","null"],"description":"Whether it's a legal entity."},"tradeName":{"type":["string","null"],"description":"The trade name of the contract."},"homePhone":{"type":["string","null"],"description":"contract phone number."},"phone":{"type":["string","null"],"description":"contract phone number."},"businessPhone":{"type":["string","null"],"description":"contract business phone number."},"email":{"type":["string","null"],"description":"The email of the contract."},"firstName":{"type":["string","null"],"description":"The first name of the contract."},"lastName":{"type":["string","null"],"description":"The last name of the contract."},"document":{"type":["string","null"],"description":"The document number of the contract."},"documentType":{"type":["string","null"],"description":"The type of document (e.g., \"EIN\", \"State Business Registration Number\")."},"corporateDocument":{"type":["string","null"],"description":"Business document number if different from main document."},"corporateName":{"type":["string","null"],"description":"Company's registered corporate name."},"stateRegistration":{"type":["string","null"],"description":"State-level registration number."},"isNewsletterOptIn":{"type":["boolean","null"],"description":"Indicates newsletter opt-in status."},"createdIn":{"type":["string","null"],"description":"Timestamp of document creation."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of last update."},"id":{"type":["string","null"],"description":"Unique contract ID."},"dataEntityId":{"type":["string","null"],"description":"Fixed entity ID (always \"CL\")."},"accountId":{"type":["string","null"],"description":"ID of the account related to this address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this address."},"followers":{"type":["array","null"],"description":"List of users following this address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this address.","items":{"type":"string","description":"Tag value."}},"restrictions":{"type":["object","null"],"description":"Object with restriction definitions for `vtex.catalog`, `vtex.checkout`, and `vtex.payments`.","properties":{"vtex.catalog":{"type":"object","description":"Contains catalog restrictions for the contract.","properties":{"assortmentIds":{"type":"array","description":"List of product assortment IDs authorized for this contract. Assortments define catalog visibility through included and excluded collections.","items":{"type":"string","description":"Product assortment ID."}}}},"vtex.checkout":{"type":"object","description":"Contains restrictions regarding checkout.","properties":{"creditCards":{"type":"array","description":"A list of credit card IDs that the customer is allowed to use during checkout. These IDs reference cards stored in the BK entity, managed by the VTEX Checkout system.","items":{"type":"string","description":"Credit card ID."}}}},"vtex.payments":{"type":"object","description":"Contains restrictions regarding payments.","properties":{"paymentSystemIds":{"type":"array","description":"A list of numeric IDs that represent the allowed payment systems for the customer.","items":{"type":"string","description":"Payment system ID."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves information related to a given contract, by its unique identifier. Use the `_fields=_all` query parameter to return all fields. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to retrieve. | + | `_fields` | query | Specifies that all fields of the document should be included in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "cluster": null, + "priceTables": "CL-4000060,CL3000007,NCC,NCNC", + "isCorporate": null, + "tradeName": null, + "rclastcart": null, + "rclastcartvalue": null, + "rclastsession": null, + "rclastsessiondate": null, + "homePhone": "1122223333", + "phone": null, + "brandPurchasedTag": null, + "brandVisitedTag": null, + "categoryPurchasedTag": null, + "categoryVisitedTag": null, + "departmentVisitedTag": null, + "productPurchasedTag": null, + "productVisitedTag": null, + "stateRegistration": "", + "email": "business-klub-spc@email.com", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "isNewsletterOptIn": false, + "localeDefault": null, + "attach": null, + "approved": null, + "birthDate": null, + "businessPhone": "1122223333", + "carttag": null, + "checkouttag": null, + "corporateDocument": null, + "corporateName": "Business Klub SPC", + "documentType": "CNPJ", + "gender": null, + "visitedProductWithStockOutSkusTag": null, + "customerClass": null, + "profilePicture": null, + "birthDateMonth": null, + "id": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "qastore", + "dataEntityId": "CL", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdIn": "2025-03-19T21:43:29.7132146Z", + "updatedBy": null, + "updatedIn": null, + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionIn": "2025-03-19T21:43:29.7132146Z", + "followers": [], + "tags": [], + "auto_filter": null, + "restrictions": { + "vtex.catalog": { + "assortmentIds": [ + "1", + "2" + ] + }, + "vtex.checkout": { + "creditCards": [ + "da89bc50-994e-4e39-9974-4a9d081cc3f4", + "65ec3ec6-c504-4431-b17a-ea3800fb03d2" + ] + }, + "vtex.payments": { + "paymentSystemIds": [ + "1", + "2", + "3", + "4", + "5", + "7", + "8", + "9", + "14", + "21", + "29", + "31", + "33", + "34", + "35", + "36", + "37", + "48", + "789" + ] + } + } + } + ``` diff --git a/BrunoCollections/VTEX - B2B Contracts API/Contracts/Update contract by ID.yml b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Update contract by ID.yml new file mode 100644 index 0000000000..1be549689a --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/Contracts/Update contract by ID.yml @@ -0,0 +1,128 @@ +info: + name: Update contract by ID + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + body: + type: json + data: |- + { + "email": "business-klub-spc@email.com", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "documentType": "CNPJ", + "corporateDocument": "00000000000000", + "homePhone": "1122223333", + "cellPhone": "1122223333", + "corporateName": "Business Klub SPC", + "tradeName": "Business Klub", + "isCorporate": true, + "stateRegistration": "", + "isFreeStateRegistration": true, + "priceTables": "CL4000060,CL3000007", + "restrictions": { + "vtex.catalog": { + "assortmentIds": [ + "1" + ] + }, + "vtex.checkout": { + "creditCards": [ + "da89bc50-994e-4e39-9974-4a9d081cc3f4", + "65ec3ec6-c504-4431-b17a-ea3800fb03d2" + ] + }, + "vtex.payments": { + "paymentSystemIds": [ + "1", + "2", + "3", + "4", + "5", + "7", + "8", + "9", + "14", + "21", + "29", + "31", + "33", + "34", + "35", + "36", + "37", + "48", + "789" + ] + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/CL/documents/:contractId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing contract by its unique identifier. When updating `restrictions`, send the complete object for the fields you are changing. + + > ⚠️ When updating contracts you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + **Note**: The following restriction fields are accepted: + + - `vtex.catalog.assortmentIds` + - `vtex.checkout.creditCards` + - `vtex.payments.paymentSystemIds` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Contracts API/Contracts/folder.yml b/BrunoCollections/VTEX - B2B Contracts API/Contracts/folder.yml new file mode 100644 index 0000000000..b759af73ef --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/Contracts/folder.yml @@ -0,0 +1,4 @@ +info: + name: Contracts + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Contracts API/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Contracts API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - B2B Contracts API/opencollection.yml b/BrunoCollections/VTEX - B2B Contracts API/opencollection.yml new file mode 100644 index 0000000000..a0f1af03f0 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Contracts API/opencollection.yml @@ -0,0 +1,26 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Contracts API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The B2B Contracts API allows you to create, retrieve, update, and delete contract documents stored in the `CL` data entity. Contracts represent B2B buyer accounts and carry restriction settings that control catalog visibility, checkout payment methods, and allowed payment systems. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + > ⚠️ When creating or updating contracts you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/Validate legacy credentials.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/Validate legacy credentials.yml new file mode 100644 index 0000000000..01a2621491 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/Validate legacy credentials.yml @@ -0,0 +1,131 @@ +info: + name: Validate legacy credentials + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/authentication" + headers: + - name: Content-Type + value: application/json; charset=utf-8 + - name: Accept + value: application/json + - name: X-VTEX-Client-Id + value: vtex-b2b-store + - name: X-VTEX-Timestamp + value: Tue, 31 Mar 2026 16:11:59 GMT + - name: X-VTEX-Nonce + value: a1b2c3d4e5f6 + - name: X-VTEX-Content-SHA256 + value: 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + - name: Authorization + value: HMAC-SHA256 SignedHeaders=X-VTEX-Client-Id;X-VTEX-Timestamp;X-VTEX-Nonce;X-VTEX-Content-SHA256&Signature=mK8C3gF9xQ7vN2pL5wR8tY6uI4oP1aS3dF7gH9jK2lZ= + body: + type: json + data: |- + { + "username": "john.doe", + "password": "MySecureP@ssw0rd" + } + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/authentication - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Validates a user's legacy credentials against your external authentication system. This endpoint is called by VTEX when a user with the `isLegacyPassword` flag attempts to log in for the first time. + + For more information, see the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + ⚠️ The request to your middleware will always be made from one of the VTEX IPs listed at [http://ips.vtex.com](http://ips.vtex.com). Although VTEX cannot enforce this, we strongly recommend that your middleware checks the IP origin. If the IP is not from VTEX, your middleware should not respond. + + > ℹ️ This request is made from VTEX to your authentication middleware. + + ## Endpoint-specific requirements + + - The endpoint path must end with `/authentication`. + - Must validate HMAC-SHA256 signatures to authenticate requests from VTEX. + - Must check that requests originate from VTEX IP addresses. + + ## Middleware verification steps + + Your middleware must perform the following steps in order: + + 1. Validate that all required headers are present. + 2. Validate timestamp within ±300 seconds (recommended). + 3. Validate that the nonce has not been seen before for this `ClientId` within the clock skew window. + 4. Reconstruct the canonical string from the incoming request. + 5. Compute the expected HMAC-SHA256 signature and compare using constant-time comparison. + 6. Only then proceed to validate credentials against the legacy system. + + ## HMAC signature validation + + VTEX and your middleware must sign the exact same canonical string. Your middleware must reconstruct it from the incoming request. + + **Canonical string format (with `\n` separators, UTF-8 encoded):** + + ``` + {HTTP_METHOD}\n + {PATH}\n + {X-VTEX-Client-Id}\n + {X-VTEX-Timestamp}\n + {X-VTEX-Nonce}\n + {SHA256_OF_BODY} + ``` + + Where: + - `HTTP_METHOD` is uppercase (e.g., `POST`). + - `PATH` is `/authentication` and any provided query strings (no scheme or host). + - `SHA256_OF_BODY` is the base64-encoded SHA-256 digest of the raw request body bytes. Do not parse or re-serialize the JSON. + + **Signature computation:** + + ``` + signature = HMAC-SHA256(UTF8(canonicalString), secret) + ``` + + **Authorization header format:** + + ``` + Authorization: HMAC-SHA256 SignedHeaders=X-VTEX-Client-Id;X-VTEX-Timestamp;X-VTEX-Nonce;X-VTEX-Content-SHA256&Signature={{signature}} + ``` + + ## Response requirements + + Your middleware must return **only** the following HTTP status codes: + + - `200 OK`: Credentials are valid; user is authorized. + - `401 Unauthorized`: Credentials are invalid (user not found or wrong password). + - `403 Forbidden`: Request is not authenticated (invalid or missing HMAC). + + Any other HTTP status code is treated by VTEX as a technical error. + + ⚠️ **Important for security:** "User not found" and "wrong password" scenarios must both return `401`, indistinguishably. This prevents user enumeration. Don't include response body content that reveals credential validity, user existence, or internal errors. VTEX ignores response bodies entirely. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `X-VTEX-Client-Id` | header | (Required) Client identifier agreed upon during registration. | + | `X-VTEX-Timestamp` | header | (Required) Request timestamp in RFC 1123 format. Must be within an acceptable clock skew window (recommended: ±300 seconds). | + | `X-VTEX-Nonce` | header | (Required) Unique random string for this request. Must be unique per client within the clock skew window. Your middleware must enforce nonce uniqueness to prevent replay attacks. | + | `X-VTEX-Content-SHA256` | header | (Required) Base64-encoded SHA-256 hash of the request body. | + | `Authorization` | header | (Required) HMAC-SHA256 signature of the canonical string. Format: `HMAC-SHA256 SignedHeaders=X-VTEX-Client-Id;X-VTEX-Timestamp;X-VTEX-Nonce;X-VTEX-Content-SHA256&Signature={{signature}}` | diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/folder.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/folder.yml new file mode 100644 index 0000000000..9bb77801ff --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/Authentication Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication Flow + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/Register client.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/Register client.yml new file mode 100644 index 0000000000..2c805607ea --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/Register client.yml @@ -0,0 +1,97 @@ +info: + name: Register client + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/register" + headers: + - name: Content-Type + value: application/json; charset=utf-8 + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Store": "store-name" + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/register - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/register - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/register - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/register - Schema is valid", function () { + const schema = {"type":"object","properties":{"Store":{"type":"string","description":"Echo of the store name from the request."},"ClientId":{"type":"string","description":"Generated client identifier. This will be sent in the `X-VTEX-Client-Id` header in subsequent requests."},"Secret":{"type":"string","description":"Generated shared secret (Base64-encoded). Used by VTEX to sign requests via HMAC-SHA256."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers VTEX as a client in your middleware and generates the shared credentials used for HMAC request signing. VTEX calls this endpoint before sending any authentication requests. + + For more information, see the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + Your middleware must: + 1. Generate a unique `ClientId` for the store. + 2. Generate a high-entropy `Secret` (recommended: 32+ random bytes / 256-bit, encoded as Base64). + 3. Store the mapping between the store name, ClientId, and Secret. + 4. Return the generated credentials to VTEX. + + > ℹ️ This request is made from VTEX to your authentication middleware during the initial setup. + + ## Security requirements + + - The `Secret` should be a high-entropy value (recommended: 32+ random bytes / 256-bit, encoded as Base64). + - Store the `Secret` securely and treat it as a sensitive credential. + - Never log the `Secret` or expose it in error messages. + - Do not reuse secrets across different environments (staging vs. production). + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Store": "store-name", + "ClientId": "", + "Secret": "" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/folder.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/folder.yml new file mode 100644 index 0000000000..a78c8f942f --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/Client Registration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Client Registration + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/environments/VTEX.yml new file mode 100644 index 0000000000..1d45d06fa6 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: middlewareEndpoint + value: auth-middleware.example.com + - name: baseUrl + value: https://{{middlewareEndpoint}} diff --git a/BrunoCollections/VTEX - B2B Password Migration Protocol/opencollection.yml b/BrunoCollections/VTEX - B2B Password Migration Protocol/opencollection.yml new file mode 100644 index 0000000000..4cd2b45ecb --- /dev/null +++ b/BrunoCollections/VTEX - B2B Password Migration Protocol/opencollection.yml @@ -0,0 +1,40 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Password Migration Protocol + +docs: + content: |- + >ℹ️ The B2B Password Migration Protocol is a set of definitions to help you integrate your legacy authentication system with VTEX's B2B user migration flow. + + This protocol defines the endpoints that your middleware must implement to enable B2B password migration. Your middleware must provide a client registration endpoint and an authentication endpoint that VTEX will call during the migration process. + + To learn more about B2B password migration, check the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + > ⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/docs/tutorials/b2b-buyer-portal), which is currently available to selected accounts. + + ## General Requirements + + - Must use a standard subdomain/domain name, not an IP address. + - Must be served over HTTPS on port 443 with TLS 1.3. + - TLS certificates must be valid and issued by a trusted CA. + - Must respond in less than 3 seconds (p95 ≤ 1s, p99 ≤ 2.5s recommended). + - Never log the `Secret`, passwords, or signatures. + - Do not reuse secrets across environments (staging vs. production). + + ## B2B Password Migration Protocol API Index + + ### Client Registration + + - `POST` [Register client](https://developers.vtex.com/docs/api-reference/b2b-password-migration-protocol#post-/register) + + ### Authentication Flow + + - `POST` [Validate legacy credentials](https://developers.vtex.com/docs/api-reference/b2b-password-migration-protocol#post-/authentication) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/Create new recipient.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Create new recipient.yml new file mode 100644 index 0000000000..ef7dc23e76 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Create new recipient.yml @@ -0,0 +1,109 @@ +info: + name: Create new recipient + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/contact_information/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/contact_information/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/contact_information/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/contact_information/documents - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"string","description":"Recipient document identifier. The prefix corresponds to the `contact_information` data entity name."},"Href":{"type":"string","description":"Recipient document store path."},"DocumentId":{"type":"string","description":"Recipient document ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new recipient document in the `contact_information` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": "contact_information-123e4567-e89b-12d3-a456-426614174000", + "Href": "http://{{account}}.myvtex.com/api/dataentities/contact_information/documents/123e4567-e89b-12d3-a456-426614174000?_schema=v1", + "DocumentId": "123e4567-e89b-12d3-a456-426614174000" + } + ``` diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/Delete recipient.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Delete recipient.yml new file mode 100644 index 0000000000..98ec307cc1 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Delete recipient.yml @@ -0,0 +1,64 @@ +info: + name: Delete recipient + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/contact_information/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a recipient document from the `contact_information` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the recipient document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/Get recipient by ID.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Get recipient by ID.yml new file mode 100644 index 0000000000..c143218804 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Get recipient by ID.yml @@ -0,0 +1,115 @@ +info: + name: Get recipient by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: firstName,lastName,email + type: query + disabled: true + - name: _schema + value: v1 + type: query + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/documents/:id - Schema is valid", function () { + const schema = {"type":"object","required":["firstName","lastName"],"properties":{"email":{"type":"string","description":"User email."},"firstName":{"type":"string","description":"User first name."},"lastName":{"type":"string","description":"User last name."},"profileId":{"type":"string","format":"uuid","description":"References a Customer entity by its [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)."},"phone":{"type":"string","description":"Main phone number."},"phoneExtension":{"type":"string","description":"Internal phone extension if applicable."},"document":{"type":"string","description":"Identification document."},"documentType":{"type":"string","description":"Type of document."},"addressIds":{"type":"array","description":"References to address entities.","items":{"type":"string","format":"uuid","description":"Address entity [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a recipient by ID from the `contact_information` data entity. + + >ℹ️ Assign the `_fields` parameter in the query string to retrieve the desired fields. If you want to return all the fields use `_fields=_all`. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the recipient document. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + ``` diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/Search recipients.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Search recipients.yml new file mode 100644 index 0000000000..11b10b5c75 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Search recipients.yml @@ -0,0 +1,117 @@ +info: + name: Search recipients + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/contact_information/search?_where=profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f&_fields=firstName,lastName,email&_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _where + value: profileId=878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f + type: query + - name: _fields + value: firstName,lastName,email + type: query + - name: _schema + value: v1 + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/contact_information/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/contact_information/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/contact_information/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/contact_information/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array of recipient objects.","items":{"type":"object","description":"Recipient object.","properties":{"firstName":{"type":"string","description":"User first name."},"lastName":{"type":"string","description":"User last name."},"email":{"type":"string","description":"User email."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Searches for recipients in the `contact_information` data entity based on the query parameters. + + >⚠️ The `_schema` query parameter is required and must be set to `v1`. + + > ℹ️ It is also possible to use Pagination and Sort as described in the [Master Data V2 Search API](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/search) documentation. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts.\r + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_where` | query | (Required) Filter condition based in the document fields. For example, to filter by email, use `email=example@example.com`. | + | `_fields` | query | (Required) Data entities fields. Comma-separated list of fields to return. | + | `_schema` | query | (Required) Master Data version. This field must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "firstName": "Rafael", + "lastName": "Silva", + "email": "rafael.silva@example.com" + }, + { + "firstName": "Carolina", + "lastName": "Mendes", + "email": "carolina.mendes@example.com" + }, + { + "firstName": "Lucas", + "lastName": "Oliveira", + "email": "lucas.oliveira@example.com" + } + ] + ``` diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/Update recipient.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Update recipient.yml new file mode 100644 index 0000000000..fd7ed6e714 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/Update recipient.yml @@ -0,0 +1,86 @@ +info: + name: Update recipient + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/contact_information/documents/:id" + headers: + - name: Accept + value: application/vnd.vtex.ds.v10+json + - name: Content-Type + value: application/json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: id + value: 123e4567-e89b-12d3-a456-426614174000 + type: path + body: + type: json + data: |- + { + "email": "rafael.silva@example.com", + "firstName": "Rafael", + "lastName": "Silva", + "profileId": "878fa807-7c7b-4ad3-aaa6-e3ef4fb22b8f", + "phone": "+1 212 555 1234", + "phoneExtension": "123", + "document": "112-3456789", + "documentType": "EIN", + "addressIds": [ + "1ded2836-2061-4545-96d3-58f5338627c5", + "a3e103fc-d074-44fb-941a-949f1bca937c" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/contact_information/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/contact_information/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates a recipient document in the `contact_information` data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the recipient document. | + | `_schema` | query | Name of the schema that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - B2B Recipients API/Recipients/folder.yml b/BrunoCollections/VTEX - B2B Recipients API/Recipients/folder.yml new file mode 100644 index 0000000000..a9b0177d91 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/Recipients/folder.yml @@ -0,0 +1,4 @@ +info: + name: Recipients + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - B2B Recipients API/environments/VTEX.yml b/BrunoCollections/VTEX - B2B Recipients API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - B2B Recipients API/opencollection.yml b/BrunoCollections/VTEX - B2B Recipients API/opencollection.yml new file mode 100644 index 0000000000..35fd2dfb19 --- /dev/null +++ b/BrunoCollections/VTEX - B2B Recipients API/opencollection.yml @@ -0,0 +1,33 @@ +opencollection: 1.0.0 + +info: + name: VTEX - B2B Recipients API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The B2B Recipients API allows you to create, retrieve, update, and delete recipient documents stored in the `contact_information` [Master Data](https://developers.vtex.com/docs/guides/master-data-introduction) data entity. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Index + + ### Recipients + - `POST` [Create new recipient](https://developers.vtex.com/docs/api-reference/b2b-recipients-api#post-/api/dataentities/contact_information/documents) + - `GET` [Search recipients](https://developers.vtex.com/docs/api-reference/b2b-recipients-api#get-/api/dataentities/contact_information/search) + - `GET` [Get recipient by ID](https://developers.vtex.com/docs/api-reference/b2b-recipients-api#get-/api/dataentities/contact_information/documents/-id-) + - `PATCH` [Update recipient](https://developers.vtex.com/docs/api-reference/b2b-recipients-api#patch-/api/dataentities/contact_information/documents/-id-) + - `DELETE` [Delete recipient](https://developers.vtex.com/docs/api-reference/b2b-recipients-api#delete-/api/dataentities/contact_information/documents/-id-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Change allocation status.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Change allocation status.yml new file mode 100644 index 0000000000..e555c8caa2 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Change allocation status.yml @@ -0,0 +1,107 @@ +info: + name: Change allocation status + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/status" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "status": "ACTIVE" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/status - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/status - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/status - Schema is valid", function () { + const schema = {"type":"object","properties":{"status":{"type":"string","description":"The updated status of the allocation (e.g., `ACTIVE`, `INACTIVE`).","enum":["ACTIVE","INACTIVE"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the status of a specific allocation within a budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "status": "ACTIVE" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Create allocation.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Create allocation.yml new file mode 100644 index 0000000000..9d7adffb4b --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Create allocation.yml @@ -0,0 +1,152 @@ +info: + name: Create allocation + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + body: + type: json + data: |- + { + "linkedEntity": { + "id": "f07c85ed-ea1f-443e-953d-0f1b094ed012", + "type": "CostCenter" + }, + "referenceId": "4d00d477-e4fe-4345-b5cd-ba2ef1725cc8", + "amount": 658, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing allocation details.","properties":{"id":{"type":"string","description":"Identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the budget."},"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE` or `INACTIVE`).","enum":["ACTIVE","INACTIVE","DELETED"]},"referenceId":{"type":"string","description":"Identifier of the related entity (e.g., Identifier of a contract)."},"contractId":{"type":"string","description":"Identifier of the contract. Alternative field to `referenceId`."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new allocation within a specific VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "0197c1f6-eca5-7553-bbf1-34d3cc4ccf2d", + "budgetId": "0197c1eb-3f62-73e1-93a2-6fa5d37b74f1", + "linkedEntity": { + "id": "3bfdafe0-a111-4ce9-9205-1dd5f872b44e", + "type": "CostCenter" + }, + "balance": { + "amount": 358, + "balanceAdjustment": 0, + "remaining": 358 + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "referenceId": "67c9779d-b9a8-4512-a746-5f41361c7270", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Create batch of allocations.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Create batch of allocations.yml new file mode 100644 index 0000000000..14b860f685 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Create batch of allocations.yml @@ -0,0 +1,179 @@ +info: + name: Create batch of allocations + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/batch" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + body: + type: json + data: |- + { + "allocations": [ + { + "linkedEntity": { + "id": "PO-number-2025-001-01", + "type": "PO Number" + }, + "referenceId": "21795f6f-5378-11f0-b37f-842fce820b77", + "contractId": "21795f6f-5378-11f0-b37f-842fce820b77", + "amount": 2040 + }, + { + "linkedEntity": { + "id": "PO-number-2025-002-02", + "type": "PO Number" + }, + "referenceId": "21795f6f-5378-11f0-b37f-842fce820b77", + "amount": 2040, + "notificationSettings": [ + { + "type": "AMOUNT", + "threshold": 121, + "recipients": [ + { + "email": "user1@email.com" + } + ] + } + ] + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/batch - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/batch - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/batch - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/batch - Schema is valid", function () { + const schema = {"type":"object","properties":{"budgetId":{"type":"string","description":"Unique identifier of the budget."},"allocations":{"type":"array","description":"List of allocation objects to be created.","items":{"type":"object","description":"Created allocation object.","properties":{"id":{"type":"string","description":"Allocation ID."},"budgetId":{"type":"string","description":"Budget ID."},"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Allocation balance information.","properties":{"amount":{"type":"number","description":"Amount allocated."},"balanceAdjustment":{"type":"number","description":"Allocation balance adjustments."},"remaining":{"type":"number","description":"Balance remaining."}}},"notificationSettings":{"type":"array","description":"List of thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","items":{"type":"object","description":"Notification setting.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"threshold":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"email":{"type":"string","format":"email","description":"Email address of the recipient."}}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE` or `INACTIVE`).","enum":["ACTIVE","INACTIVE"]},"referenceId":{"type":"string","description":"Identifier of the related entity (e.g., Identifier of a contract)."},"contractId":{"type":"string","description":"Identifier of the contract. Alternative field to `referenceId`."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates one or more budget allocations in batch under a specific VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "budgetId": "0197c1eb-3f62-73e1-93a2-6fa5d37b74f1", + "allocations": [ + { + "id": "0197c1f8-082a-776a-ade2-992badbcc96a", + "budgetId": "0197c1eb-3f62-73e1-93a2-6fa5d37b74f1", + "linkedEntity": { + "id": "PO-number-2025-001-01", + "type": "PO Number" + }, + "balance": { + "amount": 2040, + "balanceAdjustment": 0, + "remaining": 2040 + }, + "status": "ACTIVE", + "referenceId": "21795f6f-5378-11f0-b37f-842fce820b77", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + }, + { + "id": "0197c1f8-082a-776b-9eb4-f9d4822f6c34", + "budgetId": "0197c1eb-3f62-73e1-93a2-6fa5d37b74f1", + "linkedEntity": { + "id": "PO-number-2025-002-02", + "type": "PO Number" + }, + "balance": { + "amount": 2040, + "balanceAdjustment": 0, + "remaining": 2040 + }, + "notificationSettings": [ + { + "type": "AMOUNT", + "threshold": 121, + "recipients": [ + { + "email": "user1@email.com" + } + ] + } + ], + "status": "ACTIVE", + "referenceId": "21795f6f-5378-11f0-b37f-842fce820b77", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Delete allocation.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Delete allocation.yml new file mode 100644 index 0000000000..802dab4600 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Delete allocation.yml @@ -0,0 +1,71 @@ +info: + name: Delete allocation + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific allocation from a budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + > Allocations are not definitively deleted, they are maintained for the sake of record keeping. When looking at statements you will be able to see transaction history for deleted allocations. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Get allocation.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Get allocation.yml new file mode 100644 index 0000000000..1fe5b8da3b --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Get allocation.yml @@ -0,0 +1,128 @@ +info: + name: Get allocation + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing allocation details.","properties":{"id":{"type":"string","description":"Identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the budget."},"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE` or `INACTIVE`).","enum":["ACTIVE","INACTIVE","DELETED"]},"referenceId":{"type":"string","description":"Identifier of the related entity (e.g., Identifier of a contract)."},"contractId":{"type":"string","description":"Identifier of the contract. Alternative field to `referenceId`."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific allocation within a VTEX budget by its ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "0197c65e-1012-70f3-9fef-52bd7fe66a13", + "budgetId": "0197c251-5b00-707b-9023-4f3d386be220", + "linkedEntity": { + "id": "d5c996af-455e-4b76-a36d-43376e96d82a", + "type": "CostCenter" + }, + "balance": { + "amount": 864, + "balanceAdjustment": 0, + "remaining": 864 + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "referenceId": "cd1e8e85-bc9e-479e-b2a5-8d916a33618f", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/List budget allocations.yml b/BrunoCollections/VTEX - Budgets API/Allocations/List budget allocations.yml new file mode 100644 index 0000000000..cdc74968d6 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/List budget allocations.yml @@ -0,0 +1,142 @@ +info: + name: List budget allocations + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations" + headers: + - name: Accept + value: application/json + params: + - name: type + value: Location + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + - name: status + value: ACTIVE + type: query + disabled: true + - name: referenceId + value: 4d00d477-e4fe-4345-b5cd-ba2ef1725cc8 + type: query + disabled: true + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations - Schema is valid", function () { + const schema = {"type":"object","properties":{"pagination":{"type":"object","description":"Pagination information.","properties":{"current":{"type":"integer","description":"Current page number."},"pages":{"type":"integer","description":"Total number of pages available."},"results":{"type":"integer","description":"Total number of results across all pages."}}},"items":{"type":"array","description":"List of budget allocations.","items":{"type":"object","description":"Allocation object.","properties":{"id":{"type":"string","description":"Identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the budget to which the allocation belongs."},"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount allocated."},"balanceAdjustment":{"type":"number","description":"Total amount used."},"remaining":{"type":"number","description":"Current balance left for this allocation."}}},"status":{"type":"string","description":"Status of the allocation (e.g., `ACTIVE`, `INACTIVE` or `DELETE`).","enum":["ACTIVE","INACTIVE","DELETED"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the allocations for a specific budget, with optional filtering by entity type. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `type` | query | Filters the allocations by linked entity type. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration)). | + | `page` | query | Page number of the results. | + | `pageSize` | query | Number of items per page. | + | `status` | query | Filter allocations by their status. Use `ACTIVE` for current allocations, `INACTIVE` for temporary disabled ones, or `DELETED` for removed allocations. | + | `referenceId` | query | Filters the allocations by contract ID. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pagination": { + "current": 1, + "pages": 1, + "results": 3 + }, + "items": [ + { + "id": "f8dc5da1-bac5-4d5c-8907-b29f8dda4e18", + "budgetId": "d5793a13-c453-483b-8fc3-d17d96282c15", + "linkedEntity": { + "id": "565db6d8-e125-404d-8d9d-20d96dce10c6", + "type": "Cont" + }, + "balance": { + "amount": 26, + "balanceAdjustment": 0, + "remaining": 26 + }, + "status": "DELETED", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Query allocations.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Query allocations.yml new file mode 100644 index 0000000000..bd06ae93bd --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Query allocations.yml @@ -0,0 +1,129 @@ +info: + name: Query allocations + type: http + seq: 10 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/allocations/query" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + body: + type: json + data: |- + { + "items": [ + { + "id": "41b9ec1e-af0a-45f6-b3fb-351f700a63aa", + "type": "CostCenter" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/allocations/query - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/allocations/query - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/allocations/query - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/allocations/query - Schema is valid", function () { + const schema = {"type":"object","properties":{"items":{"type":"array","description":"List of matching allocation entries.","items":{"type":"object","description":"Allocation query result.","properties":{"budgetId":{"type":"string","description":"Identifier of the budget to which the allocation belongs."},"allocationId":{"type":"string","description":"Identifier of the specific allocation."},"linkedEntity":{"type":"object","description":"Linked entity object containing `id` and `type`.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"budgetBalance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total budget amount."},"balanceAdjustment":{"type":"number","description":"Total amount utilized from the budget."},"remaining":{"type":"number","description":"Remaining amount in the budget."}}},"cycleConfiguration":{"type":"object","description":"Configuration for budget cycle.","required":["startDate","autoResetOnPeriodEnd","carryOverBalance"],"properties":{"startDate":{"type":"string","format":"date-time","description":"Start date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"endDate":{"type":"string","format":"date-time","description":"End date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"autoResetOnPeriodEnd":{"type":"boolean","description":"Enable (`true`) or disable (`false`) the autoreset period."},"carryOverBalance":{"type":"boolean","description":"Defines wether to carry over balance (`true`) or not (`false`)."}}},"allocationBalance":{"type":"object","description":"Allocation balance information.","properties":{"amount":{"type":"number","description":"Total allocation amount."},"balanceAdjustment":{"type":"number","description":"Total amount utilized from the allocation."},"remaining":{"type":"number","description":"Remaining amount in the allocation."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Queries budget allocations by context and linked entities. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "budgetId": "0197c65f-a1d3-71e8-ab11-013cc2f7f023", + "allocationId": "0197c65f-bfb3-7452-8ae2-edf9f83624ae", + "linkedEntity": { + "id": "41b9ec1e-af0a-45f6-b3fb-351f700a63aa", + "type": "CostCenter" + }, + "budgetBalance": { + "amount": 1000, + "balanceAdjustment": 0, + "remaining": 1000 + }, + "cycleConfiguration": { + "startDate": "2025-04-01T00:00:00.0000000Z", + "endDate": "2025-04-08T00:00:00.0000000Z", + "autoResetOnPeriodEnd": true, + "carryOverBalance": true + }, + "allocationBalance": { + "amount": 13, + "balanceAdjustment": 0, + "remaining": 13 + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation linked entity.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation linked entity.yml new file mode 100644 index 0000000000..bb6f72ecfb --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation linked entity.yml @@ -0,0 +1,78 @@ +info: + name: Update allocation linked entity + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/linked-entity" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "linkedEntityId": "f07c85ed-ea1f-443e-953d-0f1b094ed012", + "linkedEntityType": "CostCenter" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/linked-entity - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the linked entity of a specific allocation within a budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation usage.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation usage.yml new file mode 100644 index 0000000000..20594aed85 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation usage.yml @@ -0,0 +1,81 @@ +info: + name: Update allocation usage + type: http + seq: 9 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/usage" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": 150, + "requestedBy": "user1@email.com", + "type": "CREDIT" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/usage - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the usage of a specific allocation within a budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation.yml b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation.yml new file mode 100644 index 0000000000..edf797b510 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/Update allocation.yml @@ -0,0 +1,175 @@ +info: + name: Update allocation + type: http + seq: 5 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "linkedEntity": { + "id": "5ae133af-ea31-44b4-a74e-9e14752673c4", + "type": "CostCenter" + }, + "amount": 40, + "referenceId": "50e7cb46-ec05-441c-b558-78160798ceb6", + "contractId": "50e7cb46-ec05-441c-b558-78160798ceb6", + "allocations": [ + { + "linkedEntity": { + "id": "PO-number-2025-001-01", + "type": "PO Number" + }, + "contractId": "21795f6f-5378-11f0-b37f-842fce820b77", + "amount": 2040 + }, + { + "linkedEntity": { + "id": "PO-number-2025-002-02", + "type": "PO Number" + }, + "referenceId": "21795f6f-5378-11f0-b37f-842fce820b77", + "amount": 2040, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "EMAIL", + "identifier": "user1@email.com" + } + ] + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing allocation details.","properties":{"id":{"type":"string","description":"Identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the budget."},"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE` or `INACTIVE`).","enum":["ACTIVE","INACTIVE","DELETED"]},"referenceId":{"type":"string","description":"Identifier of the related entity (e.g., Identifier of a contract)."},"contractId":{"type":"string","description":"Identifier of the contract. Alternative field to `referenceId`."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing budget allocation within a specific VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "0197c1f6-eca5-7553-bbf1-34d3cc4ccf2d", + "budgetId": "0197c1eb-3f62-73e1-93a2-6fa5d37b74f1", + "linkedEntity": { + "id": "99805a66-143c-4409-a674-600b77e10fe9", + "type": "CostCenter" + }, + "balance": { + "amount": 51, + "balanceAdjustment": 0, + "remaining": 51 + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "EMAIL", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "referenceId": "2c817a12-fafd-4fc9-becb-727dd7777d5f", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Allocations/folder.yml b/BrunoCollections/VTEX - Budgets API/Allocations/folder.yml new file mode 100644 index 0000000000..58da2b7474 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Allocations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Allocations + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/Create budget.yml b/BrunoCollections/VTEX - Budgets API/Budgets/Create budget.yml new file mode 100644 index 0000000000..1eeb2faea6 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/Create budget.yml @@ -0,0 +1,213 @@ +info: + name: Create budget + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + body: + type: json + data: |- + { + "name": "Grocery Store", + "description": "Bermudian Dollar (customarily known as Bermuda Dollar)", + "amount": 956, + "cycleConfiguration": { + "startDate": "2025-04-01T00:00:00.0000000Z", + "endDate": "2025-04-08T00:00:00.0000000Z", + "autoResetOnPeriodEnd": true, + "carryOverBalance": true + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "allocations": [ + { + "linkedEntity": { + "id": "4de8235f-ff2d-451b-bfcf-9873aeb9feee", + "type": "User" + }, + "amount": 639, + "referenceId": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing budget details.","properties":{"id":{"type":"string","description":"Identifier of the budget."},"name":{"type":"string","description":"Name of the budget."},"description":{"type":"string","description":"Description of the budget."},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"cycleConfiguration":{"type":"object","description":"Configuration for budget cycle in response.","properties":{"startDate":{"type":"string","format":"date-time","description":"Start date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"endDate":{"type":"string","format":"date-time","description":"End date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"autoResetOnPeriodEnd":{"type":"boolean","description":"Condition if the period will auto reset when ended."},"carryOverBalance":{"type":"boolean","description":"Condition if the remain balance will be transferred to the next cycle."},"nextRenewal":{"type":"string","format":"date-time","description":"Next cycle renewal date (format: YYYY-MM-DDThh:mm:ssZ)."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the budget (e.g., `ACTIVE`, `INACTIVE`).","enum":["ACTIVE","INACTIVE"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."},"allocations":{"type":"array","description":"Optional list of initial allocations to create with the budget.","items":{"type":"object","description":"Allocation object.","properties":{"id":{"type":"string","description":"Unique identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"linkedEntity":{"type":"object","description":"Entity to which the allocation is linked.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Financial details of the allocation.","properties":{"amount":{"type":"number","description":"Total amount allocated."},"balanceAdjustment":{"type":"number","description":"Amount already used from the allocation."},"remaining":{"type":"number","description":"Remaining balance."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE`)."},"referenceId":{"type":"string","description":"Identifier of the related contract."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new budget with optional allocations and cycle configuration. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "0197c1e3-a82f-7746-8614-bf518e625a92", + "name": "USER 1", + "description": "USER 1", + "balance": { + "amount": 1000, + "balanceAdjustment": 0, + "remaining": 1000 + }, + "cycleConfiguration": { + "startDate": "2025-01-01T00:00:00.0000000Z", + "endDate": "2055-01-01T00:00:00.0000000Z", + "autoResetOnPeriodEnd": true, + "carryOverBalance": true, + "nextRenewal": "2055-01-01T00:00:00.0000000Z" + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14", + "allocations": [ + { + "id": "0197c1e3-a82f-7747-8534-2aed2ba95417", + "budgetId": "0197c1e3-a82f-7746-8614-bf518e625a92", + "linkedEntity": { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "USER" + }, + "balance": { + "amount": 1000, + "balanceAdjustment": 0, + "remaining": 1000 + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "referenceId": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/Delete budget.yml b/BrunoCollections/VTEX - Budgets API/Budgets/Delete budget.yml new file mode 100644 index 0000000000..bddfdd7f59 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/Delete budget.yml @@ -0,0 +1,65 @@ +info: + name: Delete budget + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/Get budget.yml b/BrunoCollections/VTEX - Budgets API/Budgets/Get budget.yml new file mode 100644 index 0000000000..888461faca --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/Get budget.yml @@ -0,0 +1,161 @@ +info: + name: Get budget + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing budget details.","properties":{"id":{"type":"string","description":"Identifier of the budget."},"name":{"type":"string","description":"Name of the budget."},"description":{"type":"string","description":"Description of the budget."},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"cycleConfiguration":{"type":"object","description":"Configuration for budget cycle in response.","properties":{"startDate":{"type":"string","format":"date-time","description":"Start date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"endDate":{"type":"string","format":"date-time","description":"End date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"autoResetOnPeriodEnd":{"type":"boolean","description":"Condition if the period will auto reset when ended."},"carryOverBalance":{"type":"boolean","description":"Condition if the remain balance will be transferred to the next cycle."},"nextRenewal":{"type":"string","format":"date-time","description":"Next cycle renewal date (format: YYYY-MM-DDThh:mm:ssZ)."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the budget (e.g., `ACTIVE`, `INACTIVE`).","enum":["ACTIVE","INACTIVE"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."},"allocations":{"type":"array","description":"Optional list of initial allocations to create with the budget.","items":{"type":"object","description":"Allocation object.","properties":{"id":{"type":"string","description":"Unique identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"linkedEntity":{"type":"object","description":"Entity to which the allocation is linked.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Financial details of the allocation.","properties":{"amount":{"type":"number","description":"Total amount allocated."},"balanceAdjustment":{"type":"number","description":"Amount already used from the allocation."},"remaining":{"type":"number","description":"Remaining balance."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE`)."},"referenceId":{"type":"string","description":"Identifier of the related contract."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the details of a specific budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "0197c1e3-a82f-7746-8614-bf518e625a92", + "name": "USER 1", + "description": "USER 1", + "balance": { + "amount": 1000, + "balanceAdjustment": 0, + "remaining": 1000 + }, + "cycleConfiguration": { + "startDate": "2025-01-01T00:00:00.0000000Z", + "endDate": "2055-01-01T00:00:00.0000000Z", + "autoResetOnPeriodEnd": true, + "carryOverBalance": true, + "nextRenewal": "2055-01-01T00:00:00.0000000Z" + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14", + "allocations": [ + { + "id": "0197c1e3-a82f-7747-8534-2aed2ba95417", + "budgetId": "0197c1e3-a82f-7746-8614-bf518e625a92", + "linkedEntity": { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "USER" + }, + "balance": { + "amount": 1000, + "balanceAdjustment": 0, + "remaining": 1000 + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "referenceId": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/List budgets.yml b/BrunoCollections/VTEX - Budgets API/Budgets/List budgets.yml new file mode 100644 index 0000000000..accdddd12f --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/List budgets.yml @@ -0,0 +1,141 @@ +info: + name: List budgets + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId" + headers: + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + - name: minAmount + value: "100" + type: query + disabled: true + - name: maxAmount + value: "-98374117.74674813" + type: query + disabled: true + - name: status + value: ACTIVE + type: query + disabled: true + - name: name + value: North America Q2 Budget + type: query + disabled: true + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId - Schema is valid", function () { + const schema = {"type":"object","properties":{"pagination":{"type":"object","description":"Pagination information.","properties":{"current":{"type":"integer","description":"Current page number."},"pages":{"type":"integer","description":"Total number of pages available."},"results":{"type":"integer","description":"Total number of results across all pages."}}},"items":{"type":"array","description":"Array of budget summaries.","items":{"type":"object","description":"Budget summary object.","properties":{"id":{"type":"string","description":"Identifier of the budget."},"name":{"type":"string","description":"Name of the budget."},"startDate":{"type":"string","format":"date-time","description":"Start date of the budget in ISO 8601 format (format: YYYY-MM-DDThh:mm:ssZ)."},"endDate":{"type":"string","format":"date-time","description":"End date of the budget in ISO 8601 format (format: YYYY-MM-DDThh:mm:ssZ)."},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total budget amount."},"balanceAdjustment":{"type":"number","description":"Amount already used."},"remaining":{"type":"number","description":"Remaining budget."}}},"status":{"type":"string","description":"Current status of the allocation (`ACTIVE` or `INACTIVE`)."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a paginated list of budgets filtered by context and amount range. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `page` | query | Page number of the results. | + | `pageSize` | query | Number of items per page. | + | `minAmount` | query | Minimum budget amount for filtering. | + | `maxAmount` | query | Maximum budget amount for filtering. | + | `status` | query | Filter budgets by their status. Use `ACTIVE` for enabled budgets or `INACTIVE` for disabled budgets. The status `DELETED` is not applicable for budget filtering: deleted budgets are purged from the system and cannot be retrieved or filtered through the API. | + | `name` | query | Budget name. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pagination": { + "current": 1, + "pages": 1, + "results": 2 + }, + "items": [ + { + "id": "ffc4575e-5e5c-420e-bcb7-bf4a271f5d60", + "name": "Grocery Store", + "startDate": "2025-03-27T00:00:00.0000000Z", + "endDate": "2025-04-18T00:00:00.0000000Z", + "balance": { + "amount": 657, + "balanceAdjustment": 0, + "remaining": 657 + }, + "status": "ACTIVE", + "contextType": "UNIT", + "contextId": "unit123" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/Update budget status.yml b/BrunoCollections/VTEX - Budgets API/Budgets/Update budget status.yml new file mode 100644 index 0000000000..1db9e8049e --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/Update budget status.yml @@ -0,0 +1,103 @@ +info: + name: Update budget status + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/status" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + body: + type: json + data: |- + { + "status": "ACTIVE" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/status - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/status - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId/status - Schema is valid", function () { + const schema = {"type":"object","properties":{"status":{"type":"string","description":"The updated budget status (e.g., `ACTIVE` or `INACTIVE`).","enum":["ACTIVE","INACTIVE"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the status of a specific budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "status": "ACTIVE" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/Update budget.yml b/BrunoCollections/VTEX - Budgets API/Budgets/Update budget.yml new file mode 100644 index 0000000000..8289017df5 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/Update budget.yml @@ -0,0 +1,160 @@ +info: + name: Update budget + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + body: + type: json + data: |- + { + "name": "Grocery Store", + "description": "Syrian Pound", + "amount": 355, + "cycleConfiguration": { + "startDate": "2025-03-27T00:00:00.0000000Z", + "endDate": "2025-04-18T00:00:00.0000000Z", + "autoResetOnPeriodEnd": false, + "carryOverBalance": true + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/budgets/:contextType/:contextId/:budgetId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing budget details.","properties":{"id":{"type":"string","description":"Identifier of the budget."},"name":{"type":"string","description":"Name of the budget."},"description":{"type":"string","description":"Description of the budget."},"balance":{"type":"object","description":"Budget balance information.","properties":{"amount":{"type":"number","description":"Total amount in the budget."},"balanceAdjustment":{"type":"number","description":"Amount already utilized."},"remaining":{"type":"number","description":"Remaining budget."}}},"cycleConfiguration":{"type":"object","description":"Configuration for budget cycle in response.","properties":{"startDate":{"type":"string","format":"date-time","description":"Start date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"endDate":{"type":"string","format":"date-time","description":"End date of the budget cycle (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"autoResetOnPeriodEnd":{"type":"boolean","description":"Condition if the period will auto reset when ended."},"carryOverBalance":{"type":"boolean","description":"Condition if the remain balance will be transferred to the next cycle."},"nextRenewal":{"type":"string","format":"date-time","description":"Next cycle renewal date (format: YYYY-MM-DDThh:mm:ssZ)."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the budget (e.g., `ACTIVE`, `INACTIVE`).","enum":["ACTIVE","INACTIVE"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."},"allocations":{"type":"array","description":"Optional list of initial allocations to create with the budget.","items":{"type":"object","description":"Allocation object.","properties":{"id":{"type":"string","description":"Unique identifier of the allocation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"linkedEntity":{"type":"object","description":"Entity to which the allocation is linked.","properties":{"id":{"type":"string","description":"Identifier of the entity linked to the allocation. If `type` is `User` or `Address`, this should be the identifier of the user or address, respectively. If `type` is an Accounting Field ([Custom Field](https://developers.vtex.com/docs/guides/custom-fields-integration)), this should be the **value** of that Accounting Field."},"type":{"type":"string","description":"Type of the linked entity. Currently, the accepted entity types are: `User`, `Address`, and Accounting Fields ([Custom Fields](https://developers.vtex.com/docs/guides/custom-fields-integration))."}}},"balance":{"type":"object","description":"Financial details of the allocation.","properties":{"amount":{"type":"number","description":"Total amount allocated."},"balanceAdjustment":{"type":"number","description":"Amount already used from the allocation."},"remaining":{"type":"number","description":"Remaining balance."}}},"notificationSettings":{"type":"object","description":"Thresholds that trigger a notification based on usage. Applies to both Budgets and Allocations.","properties":{"enable":{"type":"boolean","description":"Enables notifications."},"thresholds":{"type":"array","description":"Array of threshold configurations.","items":{"type":"object","description":"Threshold configuration.","properties":{"type":{"type":"string","description":"Defines whether the threshold is based on percentage of usage or a fixed amount.","enum":["PERCENT","AMOUNT"]},"Value":{"type":"number","description":"The value of the threshold. For `\"PERCENT\"`, 100 means fully used (0 available); values above 100 indicate overuse."}}}},"recipients":{"type":"array","description":"List of recipients to notify.","items":{"type":"object","description":"Recipient information.","properties":{"type":{"type":"string","description":"Type of notification."},"identifier":{"type":"string","format":"email","description":"Email identifier to send notifications."}}}}}},"status":{"type":"string","description":"Current status of the allocation (e.g., `ACTIVE`)."},"referenceId":{"type":"string","description":"Identifier of the related contract."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + > ⚠️ Note that you can't update the fields `contextType` and `contextId`. You must send the original values, as they are used to validate the request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "0197c1e3-a82f-7746-8614-bf518e625a92", + "name": "Grocery Store", + "description": "Codes specifically reserved for testing purposes", + "balance": { + "amount": 381, + "balanceAdjustment": 0, + "remaining": 381 + }, + "cycleConfiguration": { + "startDate": "2025-01-01T00:00:00.0000000Z", + "endDate": "2055-01-01T00:00:00.0000000Z", + "autoResetOnPeriodEnd": false, + "carryOverBalance": true + }, + "notificationSettings": { + "enable": false, + "thresholds": [ + { + "type": "PERCENT", + "Value": 99 + } + ], + "recipients": [ + { + "type": "Email", + "identifier": "user1@email.com" + } + ] + }, + "status": "ACTIVE", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14", + "allocations": [] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Budgets/folder.yml b/BrunoCollections/VTEX - Budgets API/Budgets/folder.yml new file mode 100644 index 0000000000..e9a59a9291 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Budgets/folder.yml @@ -0,0 +1,4 @@ +info: + name: Budgets + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/Confirm reservation.yml b/BrunoCollections/VTEX - Budgets API/Reservations/Confirm reservation.yml new file mode 100644 index 0000000000..35e0455e07 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/Confirm reservation.yml @@ -0,0 +1,121 @@ +info: + name: Confirm reservation + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId/confirmation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + - name: reservationId + value: b0e55425-a981-4d00-b6a2-9c7294d3d2b3 + type: path + body: + type: json + data: |- + { + "requestedBy": "user1@email.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId/confirmation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId/confirmation - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId/confirmation - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId/confirmation - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing reservation details.","properties":{"id":{"type":"string","description":"Identifier of the reservation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"origin":{"type":"string","description":"The origin of the reservation (e.g., order system)."},"reference":{"type":"string","description":"Reference tied to the reservation (e.g., order ID)."},"amount":{"type":"number","description":"Amount reserved."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who requested the reservation."},"date":{"type":"string","format":"date-time","description":"Reservation date (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund).","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Confirms a reservation under a specific allocation in a VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `reservationId` | path | (Required) Identifier of the reservation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": -150, + "requestedBy": "user1@email.com", + "date": "2025-07-22T20:43:56.8455190Z", + "type": "DEBIT", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/Create reservation.yml b/BrunoCollections/VTEX - Budgets API/Reservations/Create reservation.yml new file mode 100644 index 0000000000..eb9db1df51 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/Create reservation.yml @@ -0,0 +1,122 @@ +info: + name: Create reservation + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": -150, + "requestedBy": "user1@email.com", + "reservationId": "c3722334-3892-418c-a099-b13e9c562c7e", + "type": "DEBIT" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing reservation details.","properties":{"id":{"type":"string","description":"Identifier of the reservation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"origin":{"type":"string","description":"The origin of the reservation (e.g., order system)."},"reference":{"type":"string","description":"Reference tied to the reservation (e.g., order ID)."},"amount":{"type":"number","description":"Amount reserved."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who requested the reservation."},"date":{"type":"string","format":"date-time","description":"Reservation date (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund).","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a temporary reservation under a specific allocation in a VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": -150, + "requestedBy": "user1@email.com", + "date": "2025-07-22T20:43:56.8455190Z", + "type": "DEBIT", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/Delete reservation.yml b/BrunoCollections/VTEX - Budgets API/Reservations/Delete reservation.yml new file mode 100644 index 0000000000..cf686924df --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/Delete reservation.yml @@ -0,0 +1,121 @@ +info: + name: Delete reservation + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + - name: reservationId + value: b0e55425-a981-4d00-b6a2-9c7294d3d2b3 + type: path + body: + type: json + data: |- + { + "requestedBy": "user1@email.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing reservation details.","properties":{"id":{"type":"string","description":"Identifier of the reservation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"origin":{"type":"string","description":"The origin of the reservation (e.g., order system)."},"reference":{"type":"string","description":"Reference tied to the reservation (e.g., order ID)."},"amount":{"type":"number","description":"Amount reserved."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who requested the reservation."},"date":{"type":"string","format":"date-time","description":"Reservation date (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund).","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a reservation under a specific allocation in a VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `reservationId` | path | (Required) Identifier of the reservation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": -150, + "requestedBy": "user1@email.com", + "date": "2025-07-22T20:43:56.8455190Z", + "type": "DEBIT", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/Get reservation.yml b/BrunoCollections/VTEX - Budgets API/Reservations/Get reservation.yml new file mode 100644 index 0000000000..5c40c8b3b5 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/Get reservation.yml @@ -0,0 +1,113 @@ +info: + name: Get reservation + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + - name: reservationId + value: b0e55425-a981-4d00-b6a2-9c7294d3d2b3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations/:reservationId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing reservation details.","properties":{"id":{"type":"string","description":"Identifier of the reservation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"origin":{"type":"string","description":"The origin of the reservation (e.g., order system)."},"reference":{"type":"string","description":"Reference tied to the reservation (e.g., order ID)."},"amount":{"type":"number","description":"Amount reserved."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who requested the reservation."},"date":{"type":"string","format":"date-time","description":"Reservation date (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund).","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the corresponding Unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a reservation under a specific allocation in a VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `reservationId` | path | (Required) Identifier of the reservation. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "origin": "manual-adjustment", + "reference": "6a2d99e3-76e6-46ec-9764-49e0a7b71331", + "amount": -150, + "requestedBy": "user1@email.com", + "date": "2025-07-22T20:43:56.8455190Z", + "type": "DEBIT", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/List reservations.yml b/BrunoCollections/VTEX - Budgets API/Reservations/List reservations.yml new file mode 100644 index 0000000000..187b4f48ac --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/List reservations.yml @@ -0,0 +1,132 @@ +info: + name: List reservations + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations" + headers: + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + - name: status + value: RESERVED + type: query + disabled: true + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/reservations - Schema is valid", function () { + const schema = {"type":"object","properties":{"pagination":{"type":"object","description":"Pagination information.","properties":{"current":{"type":"integer","description":"Current page number."},"pages":{"type":"integer","description":"Total number of pages available."},"results":{"type":"integer","description":"Total number of results across all pages."}}},"items":{"type":"array","description":"List of reservation objects.","items":{"type":"object","description":"Reservation object.","properties":{"id":{"type":"string","description":"Identifier of the reservation."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"type":{"type":"string","enum":["DEBIT","CREDIT"],"description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund)."},"amount":{"type":"number","description":"Amount reserved."},"date":{"type":"string","format":"date-time","description":"ISO timestamp when the transaction occurred (format: YYYY-MM-DDThh:mm:ssZ)."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of reservations under a specific allocation in a VTEX budget, optionally filtered by status. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `page` | query | Page number of the results. | + | `pageSize` | query | Number of items per page. | + | `status` | query | Filter by reservation status (e.g., `RESERVED`, `CONFIRMED`, or `CANCELED`). | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pagination": { + "current": 1, + "pages": 1, + "results": 1 + }, + "items": [ + { + "id": "299a291e-65bf-4c4c-9209-bdaa6f620d07", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "137793ab-efb6-4af7-a287-dd864cda336b", + "type": "DEBIT", + "amount": -726, + "date": "2025-07-22 20:43:43", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ], + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Reservations/folder.yml b/BrunoCollections/VTEX - Budgets API/Reservations/folder.yml new file mode 100644 index 0000000000..fdcb0b8f93 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Reservations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Reservations + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Budgets API/Statements/Get allocation statements.yml b/BrunoCollections/VTEX - Budgets API/Statements/Get allocation statements.yml new file mode 100644 index 0000000000..9037842dbb --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Statements/Get allocation statements.yml @@ -0,0 +1,125 @@ +info: + name: Get allocation statements + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/statements" + headers: + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/statements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/statements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/statements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/statements - Schema is valid", function () { + const schema = {"type":"object","properties":{"pagination":{"type":"object","description":"Pagination information.","properties":{"current":{"type":"integer","description":"Current page number."},"pages":{"type":"integer","description":"Total number of pages available."},"results":{"type":"integer","description":"Total number of results across all pages."}}},"transactions":{"type":"array","description":"List of transaction entries.","items":{"type":"object","description":"Transaction entry.","properties":{"id":{"type":"string","description":"Identifier of the transaction."},"budgetId":{"type":"string","description":"Identifier of the budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"type":{"type":"string","enum":["DEBIT","CREDIT"],"description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund)."},"amount":{"type":"number","description":"Amount involved in the transaction."},"date":{"type":"string","format":"date-time","description":"ISO timestamp when the transaction occurred (format: YYYY-MM-DDThh:mm:ssZ)."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of transactions (statement) for a specific allocation within a VTEX budget. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `page` | query | Page number of the results. | + | `pageSize` | query | Number of items per page. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pagination": { + "current": 1, + "pages": 1, + "results": 1 + }, + "transactions": [ + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "019833db-27ad-7264-b104-dfed7c0fcbac", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "type": "DEBIT", + "amount": 528, + "date": "2025-05-17T07:01:44.0196090Z", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Statements/Get budget statements.yml b/BrunoCollections/VTEX - Budgets API/Statements/Get budget statements.yml new file mode 100644 index 0000000000..721acb591a --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Statements/Get budget statements.yml @@ -0,0 +1,121 @@ +info: + name: Get budget statements + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/statements" + headers: + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/statements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/statements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/statements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/statements - Schema is valid", function () { + const schema = {"type":"object","properties":{"pagination":{"type":"object","description":"Pagination information.","properties":{"current":{"type":"integer","description":"Current page number."},"pages":{"type":"integer","description":"Total number of pages available."},"results":{"type":"integer","description":"Total number of results across all pages."}}},"transactions":{"type":"array","description":"List of transaction entries.","items":{"type":"object","description":"Transaction entry.","properties":{"id":{"type":"string","description":"Identifier of the transaction."},"budgetId":{"type":"string","description":"Identifier of the budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation."},"type":{"type":"string","enum":["DEBIT","CREDIT"],"description":"Type of transaction (`DEBIT`, meaning a regular transaction or `CREDIT` indicating a refund)."},"amount":{"type":"number","description":"Amount involved in the transaction."},"date":{"type":"string","format":"date-time","description":"ISO timestamp when the transaction occurred (format: YYYY-MM-DDThh:mm:ssZ)."},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier of the context type."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of transactions (statement) for a specific budget within the VTEX Budgets API. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `page` | query | Page number of the results. | + | `pageSize` | query | Number of items per page. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pagination": { + "current": 1, + "pages": 1, + "results": 1 + }, + "transactions": [ + { + "id": "b0e55425-a981-4d00-b6a2-9c7294d3d2b3", + "budgetId": "019833db-27ad-7264-b104-dfed7c0fcbac", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "type": "DEBIT", + "amount": 528, + "date": "2025-05-17T07:01:44.0196090Z", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Statements/folder.yml b/BrunoCollections/VTEX - Budgets API/Statements/folder.yml new file mode 100644 index 0000000000..a947a24aad --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Statements/folder.yml @@ -0,0 +1,4 @@ +info: + name: Statements + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Budgets API/Transactions/Create transaction.yml b/BrunoCollections/VTEX - Budgets API/Transactions/Create transaction.yml new file mode 100644 index 0000000000..4ce939e844 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Transactions/Create transaction.yml @@ -0,0 +1,121 @@ +info: + name: Create transaction + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + body: + type: json + data: |- + { + "origin": "ecommerce", + "reference": "093c891a-84a7-42cb-8a23-eb6dcf6607d4", + "amount": 50, + "requestedBy": "user1@email.com", + "type": "DEBIT" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing transaction details.","properties":{"id":{"type":"string","description":"Identifier of the created transaction."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the allocation within the budget."},"origin":{"type":"string","description":"Source system or origin of the transaction."},"reference":{"type":"string","description":"Reference identifier tied to the transaction."},"amount":{"type":"number","description":"Amount committed in the transaction."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who created the transaction."},"date":{"type":"string","format":"date-time","description":"Date and time of the transaction (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Condition that defines how the transaction will impact the budget (e.g., `DEBIT` or `CREDIT`). If `type` is `DEBIT`, the amount will be subtracted from the budget. If `type` is `CREDIT`, the amount will be added to the budget.","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier for the context type."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new transaction which subtracts funds from the specified budget allocation. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "880e8400-e29b-41d4-a716-446655440000", + "budgetId": "550e8400-e29b-41d4-a716-446655440000", + "allocationId": "660e8400-e29b-41d4-a716-446655440000", + "origin": "ecommerce", + "reference": "093c891a-84a7-42cb-8a23-eb6dcf6607d4", + "amount": 50, + "requestedBy": "user1@email.com", + "date": "2025-01-20T10:15:00Z", + "type": "DEBIT", + "contextType": "UNIT", + "contextId": "093f29ac-7a1b-4d6b-a79a-48f89cf73d14" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Transactions/Get transaction.yml b/BrunoCollections/VTEX - Budgets API/Transactions/Get transaction.yml new file mode 100644 index 0000000000..4f9eae365a --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Transactions/Get transaction.yml @@ -0,0 +1,109 @@ +info: + name: Get transaction + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId" + headers: + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + - name: transactionId + value: 880e8400-e29b-41d4-a716-446655440000 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing transaction details.","properties":{"id":{"type":"string","description":"Identifier of the created transaction."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the allocation within the budget."},"origin":{"type":"string","description":"Source system or origin of the transaction."},"reference":{"type":"string","description":"Reference identifier tied to the transaction."},"amount":{"type":"number","description":"Amount committed in the transaction."},"requestedBy":{"type":"string","format":"email","description":"Email of the user who created the transaction."},"date":{"type":"string","format":"date-time","description":"Date and time of the transaction (ISO format: YYYY-MM-DDThh:mm:ssZ)."},"type":{"type":"string","description":"Condition that defines how the transaction will impact the budget (e.g., `DEBIT` or `CREDIT`). If `type` is `DEBIT`, the amount will be subtracted from the budget. If `type` is `CREDIT`, the amount will be added to the budget.","enum":["DEBIT","CREDIT"]},"contextType":{"type":"string","description":"Defines the context type associated with the budget which must be `UNIT` in B2B context."},"contextId":{"type":"string","description":"Identifier for the context type."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific transaction from a budget allocation in the VTEX Budgets API. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ViewBudget** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `transactionId` | path | (Required) Identifier of the transaction. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "1bd05512-e694-4f0e-b182-bbe30ba7b613", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e", + "origin": "TEST", + "reference": "f0e2b16b-ad4c-485d-adb2-84c78d9354e7", + "amount": 480, + "requestedBy": "user1@email.com" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Transactions/Refund transaction.yml b/BrunoCollections/VTEX - Budgets API/Transactions/Refund transaction.yml new file mode 100644 index 0000000000..43665c3806 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Transactions/Refund transaction.yml @@ -0,0 +1,114 @@ +info: + name: Refund transaction + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId/refund" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contextType + value: UNIT + type: path + - name: contextId + value: 093f29ac-7a1b-4d6b-a79a-48f89cf73d14 + type: path + - name: budgetId + value: 019833db-27ad-7264-b104-dfed7c0fcbac + type: path + - name: allocationId + value: 324b5750-c827-4a6b-a670-c9297c832f4e + type: path + - name: transactionId + value: 880e8400-e29b-41d4-a716-446655440000 + type: path + body: + type: json + data: |- + { + "requestedBy": "user1@email.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId/refund - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId/refund - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId/refund - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/budgets/:contextType/:contextId/:budgetId/allocations/:allocationId/transactions/:transactionId/refund - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Identifier of the newly created refund transaction."},"originalTransactionId":{"type":"string","description":"Identifier of the original transaction being refunded."},"budgetId":{"type":"string","description":"Identifier of the associated budget."},"allocationId":{"type":"string","description":"Identifier of the associated allocation within the budget."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Refunds a specific transaction from a budget allocation by creating a new **`CREDIT`** statement item, which adds funds back to the specified budget allocation. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | Budget | **ManageBudgets** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contextType` | path | (Required) Type of context for the budget (e.g., `UNIT`). This field can't be updated, it is used for validation. You must send the original value. | + | `contextId` | path | (Required) Identifier of the corresponding Unit. This field can't be updated, it is used for validation. You must send the original value. | + | `budgetId` | path | (Required) Identifier of the budget. | + | `allocationId` | path | (Required) Identifier of the allocation. | + | `transactionId` | path | (Required) Identifier of the transaction. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "1bd05512-e694-4f0e-b182-bbe30ba7b613", + "originalTransactionId": "b343e863-f558-4b53-b250-0ad819f06642", + "budgetId": "137793ab-efb6-4af7-a287-dd864cda336b", + "allocationId": "324b5750-c827-4a6b-a670-c9297c832f4e" + } + ``` diff --git a/BrunoCollections/VTEX - Budgets API/Transactions/folder.yml b/BrunoCollections/VTEX - Budgets API/Transactions/folder.yml new file mode 100644 index 0000000000..c6b7a452de --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/Transactions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transactions + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Budgets API/environments/VTEX.yml b/BrunoCollections/VTEX - Budgets API/environments/VTEX.yml new file mode 100644 index 0000000000..178299ed89 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: myvtex + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Budgets API/opencollection.yml b/BrunoCollections/VTEX - Budgets API/opencollection.yml new file mode 100644 index 0000000000..05b11f07b6 --- /dev/null +++ b/BrunoCollections/VTEX - Budgets API/opencollection.yml @@ -0,0 +1,83 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Budgets API + +request: + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +docs: + content: |- + A **Budget** is a financial management tool that enables organizations to plan and monitor expenses, ensuring resources are allocated efficiently and in compliance with strategic criteria. + + The **Budgets API** is a comprehensive budget management service that allows you to create, manage, and control **Budgets**, **Allocations**, **Transactions**, and **Reservations**. + + Merchants and B2B organizations can manage store expenses using this API, promoting financial transparency, traceability, and control. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Budget and Allocation + + Each **Budget** can have one or more **Allocations**, which are subdivisions of the total balance within that **Budget**. + + Each **Budget** and **Allocation** has its own **amount**, **start date**, and **end date**. When funds are added to or removed from an **Allocation**, the corresponding **Budget**'s total amount is updated accordingly to reflect the change. + + ## Transactions and Reservations + + To move funds from an **Allocation**, there are two options: + + - **Direct Transaction** + Used when you want to actually consume the balance. This creates a definitive entry that appears in the **Statements** (transaction history). + + - **Reservation** + Used to temporarily reserve funds without consuming them immediately. Later, you can either: + + - **Confirm the reservation**, which automatically creates a **Transaction**. + + - **Delete the reservation**, which simply releases the reserved balance without generating any **Transaction** (it does not appear in the **Statements**). + + + ## Refunds + + **Transactions** cannot be deleted. If you need to undo a **Transaction**, you must create a **Refund**, which is a new **Transaction** with the type. Both the original **Transaction** and the **Refund** will appear in the **Statements**, with a net effect of zero. + + ## Transaction types + + When you get a **Budget** or **Allocation** statement, each **Transaction** contains a `type` field, which can carry two values: + + - `DEBIT`: Regular **Transactions**, subtracting funds from the **Budget** or **Allocation**. + + - `CREDIT`: Associated with **Refunds**, meaning it adds funds to the **Budget** or **Allocation**. + + + ## Typical API Call Order + + 1. Create the **Budget**. + + 2. Create one or more **Allocations**. + + 3. Perform a **Transaction** or a **Reservation**. + + 4. Retrieve the transaction history using the **Statements** endpoints. + + + > In a typical purchase flow, we do not use **Reservations**. We create direct **Transactions** and use **Refunds** when needed. + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | + | `{{environment}}` | Environment to use. Used as part of the URL. | + | `{{VtexIdclientAutCookie}}` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/Import prices.yml b/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/Import prices.yml new file mode 100644 index 0000000000..8802a30afa --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/Import prices.yml @@ -0,0 +1,118 @@ +info: + name: Import prices + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/price-importer/pvt/import/:importType" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: dolore Excepteur pariatur + type: query + disabled: true + - name: output + value: none + type: query + disabled: true + - name: importType + value: fixed-prices + type: path + body: + type: json + data: |- + { + "contentType": "text/csv", + "contentLengthBytes": 524288000 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/price-importer/pvt/import/:importType - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/price-importer/pvt/import/:importType - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/price-importer/pvt/import/:importType - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/price-importer/pvt/import/:importType - Schema is valid", function () { + const schema = {"type":"object","properties":{"batchId":{"type":"string","format":"uuid","description":"Unique identifier for the batch job."},"status":{"type":"string","description":"Initial status of the batch job. Returns `AWAITING_UPLOAD` indicating the batch was created and is waiting for the file upload."},"upload":{"type":"object","description":"Pre-signed upload details used to upload the CSV file directly to storage.","properties":{"method":{"type":"string","description":"HTTP method to use for the upload. Always `PUT`."},"url":{"type":"string","format":"uri","description":"Pre-signed URL for the CSV file upload."},"headers":{"type":"object","description":"Required headers for the upload request."},"expiresAt":{"type":"string","format":"date-time","description":"URL expiration timestamp in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Starts an asynchronous batch pricing import job. Send a request specifying the import type (`base-prices` for base prices or `fixed-prices` for fixed prices) and the file metadata. The API returns a pre-signed upload URL and a unique batch ID to track the import. + + After receiving the response, upload the CSV file directly to the pre-signed URL returned in `upload.url` using the `PUT` method. This pre-signed URL is mandatory for the upload step. Do not replace it with the API base URL or any other endpoint. + + The upload request must include the header `Content-Type: text/csv`, along with any additional headers provided in the `upload.headers` object. The maximum file size is 500 MB. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importType` | path | (Required) Type of price import. Use `base-prices` for base prices or `fixed-prices` for fixed prices. | + | `an` | query | Tenant account identifier. Can be sent as a query string or identified through the host URL. | + | `output` | query | Output notification method for when the import job finishes. The target email or webhook URL is configured separately. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "batchId": "550e8400-e29b-41d4-a716-446655440000", + "status": "AWAITING_UPLOAD", + "upload": { + "method": "PUT", + "url": "https://pricing-bucket.s3.amazonaws.com/imports/550e8400.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=600", + "headers": { + "Content-Type": "text/csv" + }, + "expiresAt": "2026-01-12T20:10:00Z" + } + } + ``` diff --git a/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/folder.yml b/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/folder.yml new file mode 100644 index 0000000000..a584650611 --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/Batch imports/folder.yml @@ -0,0 +1,4 @@ +info: + name: Batch imports + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch errors.yml b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch errors.yml new file mode 100644 index 0000000000..a1246b9c20 --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch errors.yml @@ -0,0 +1,85 @@ +info: + name: Get batch errors + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/price-importer/pvt/batches/:batchId/errors" + headers: + - name: Accept + value: application/json + params: + - name: batchId + value: a1a2b0fe-7bb9-c16d-cf17-680c13f9cbad + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/price-importer/pvt/batches/:batchId/errors - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId/errors - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId/errors - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId/errors - Schema is valid", function () { + const schema = {"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Pre-signed URL containing a CSV file with error details. The CSV includes the same columns as the import file plus `Error Code` and `Error Message`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a pre-signed URL containing a CSV file with the errors from a batch pricing import job. The CSV file has the same format as the import file, with two additional columns: `Error Code` and `Error Message`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `batchId` | path | (Required) Unique identifier of the batch job. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "url": "https://pricing-bucket.s3.amazonaws.com/errors/550e8400-e29b-41d4-a716-446655440000.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=600" + } + ``` diff --git a/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch status.yml b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch status.yml new file mode 100644 index 0000000000..c5e4e4dc51 --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/Get batch status.yml @@ -0,0 +1,107 @@ +info: + name: Get batch status + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/price-importer/pvt/batches/:batchId" + headers: + - name: Accept + value: application/json + params: + - name: batchId + value: a1a2b0fe-7bb9-c16d-cf17-680c13f9cbad + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/price-importer/pvt/batches/:batchId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/price-importer/pvt/batches/:batchId - Schema is valid", function () { + const schema = {"type":"object","properties":{"batchId":{"type":"string","format":"uuid","description":"Unique identifier for the batch job."},"type":{"type":"string","description":"Type of price import job.","enum":["base","fixed"]},"status":{"type":"string","description":"Current processing status of the batch job.","enum":["AWAITING_UPLOAD","RECEIVED","VALIDATING","PROCESSING","DOCUMENTING","COMPLETED","COMPLETED_WITH_ERRORS","FAILED"]},"stages":{"type":"array","description":"Historical information regarding the past stages and their starting times.","items":{"type":"object","description":"Stage entry with historical processing information."}},"outputs":{"type":"array","description":"List of outputs where the results should be sent after the job is finished (email, webhook, or both).","items":{"type":"string","description":"Output destination identifier."}},"bytesProcessed":{"type":"integer","description":"Amount of bytes processed so far."},"bytesTotal":{"type":"integer","description":"Total amount of bytes in the uploaded file."},"errorCount":{"type":"integer","description":"Number of rows that failed to be imported due to errors."},"createdAt":{"type":"string","format":"date-time","description":"Batch creation timestamp in ISO 8601 format."},"startedAt":{"type":"string","format":"date-time","description":"Processing batch start timestamp in ISO 8601 format."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the current status and metadata of a batch pricing import job. + + The `status` field indicates the current processing stage and can have the following values: + + - `AWAITING_UPLOAD`: Batch created, waiting for file upload. + - `RECEIVED`: Waiting for processing. + - `VALIDATING`: An initial file validation is being performed. + - `PROCESSING`: Batch is being processed. + - `DOCUMENTING`: The import results are being generated. + - `COMPLETED`: All rows processed successfully. + - `COMPLETED_WITH_ERRORS`: Processing finished with some row errors. + - `FAILED`: Processing failed. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `batchId` | path | (Required) Unique identifier of the batch job. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "batchId": "550e8400-e29b-41d4-a716-446655440000", + "type": "base", + "status": "PROCESSING", + "outputs": [ + "webhook:https://www.example.com/callback", + "email:user@example.com" + ], + "bytesProcessed": 8500000, + "bytesTotal": 13800000, + "errorCount": 0, + "createdAt": "2026-01-12T20:00:00Z", + "startedAt": "2026-01-12T20:01:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Bulk Pricing API/Batch status/folder.yml b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/folder.yml new file mode 100644 index 0000000000..6638ca53d2 --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/Batch status/folder.yml @@ -0,0 +1,4 @@ +info: + name: Batch status + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Bulk Pricing API/environments/VTEX.yml b/BrunoCollections/VTEX - Bulk Pricing API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Bulk Pricing API/opencollection.yml b/BrunoCollections/VTEX - Bulk Pricing API/opencollection.yml new file mode 100644 index 0000000000..111ac6645d --- /dev/null +++ b/BrunoCollections/VTEX - Bulk Pricing API/opencollection.yml @@ -0,0 +1,49 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Bulk Pricing API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Bulk Pricing API addresses the performance limitations of per-item API calls by implementing an asynchronous, fault-tolerant processing model optimized to maintain data consistency while maximizing throughput. + + This API enables high-throughput, asynchronous processing of large-scale pricing updates via CSV file uploads. The workflow involves three main steps: + + 1. **Start a batch import** by sending a `POST` request specifying the import type (`base-prices` or `fixed-prices`). The API returns a pre-signed upload URL and a batch ID. + 2. **Upload the CSV file** directly to the pre-signed URL using the `PUT` method and headers provided in the response. + 3. **Check batch status** to monitor processing progress and retrieve error details if needed. + + ## Index + + ### Batch imports + + - `POST` [Import prices](https://developers.vtex.com/docs/api-reference/bulk-pricing-api#post-/api/price-importer/pvt/import/-importType-) + + ### Batch status + + - `GET` [Get batch status](https://developers.vtex.com/docs/api-reference/bulk-pricing-api#get-/api/price-importer/pvt/batches/-batchId-) + - `GET` [Get batch errors](https://developers.vtex.com/docs/api-reference/bulk-pricing-api#get-/api/price-importer/pvt/batches/-batchId-/errors) + + ## Common parameters in the documentation + + | Parameter name | Description | Type | + | - | - | - | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. The default value is `vtexcommercestable`. Used in the URL. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the API key. Must be used together with `X-VTEX-API-AppToken`. | Authentication header | + | `X-VTEX-API-AppToken` | Secret token of the API key. Must be used together with `X-VTEX-API-AppKey`. | Authentication header | + | `VtexIdclientAutCookie` | User token valid for 24 hours. Alternative to `appKey` + `appToken`. | Authentication header | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Check progress.yml b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Check progress.yml new file mode 100644 index 0000000000..50090473d4 --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Check progress.yml @@ -0,0 +1,97 @@ +info: + name: Check progress + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/b2b/import/buyer-orgs/:importId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + - name: importId + value: 3c3cba0a-8355-4812-ad4d-f4c0b32e2613 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/b2b/import/buyer-orgs/:importId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/b2b/import/buyer-orgs/:importId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/b2b/import/buyer-orgs/:importId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/b2b/import/buyer-orgs/:importId - Schema is valid", function () { + const schema = {"oneOf":[{"type":"object","description":"Object containing information about bulk import state.","required":["accountName","importId","importState","percentage","lastUpdateDate","fileName"],"properties":{"accountName":{"type":"string","description":"Name of your VTEX account."},"importId":{"type":"string","description":"Unique identifier of the import."},"importState":{"type":"string","description":"Current state of the import. The possible values are:\n- `Uploaded`: The file was successfully uploaded.\n- `InValidation`: File validation is in progress.\n- `ReadyToImport`: File validation completed, ready for import.\n- `Completed`: File successfully imported.\n- `ValidationFailed`: File validation failed.\n- `CompletedWithError`: File import failed."},"percentage":{"type":"string","description":"Completion percentage of the import."},"lastUpdateDate":{"type":"string","description":"Date and time of the last update of the import, in `yyyy-mm-ddTHH:MM:SS+00:00` format."},"fileName":{"type":"string","description":"Name of the file being imported."}}},{"type":"object","description":"Object containing information about bulk import state.","required":["accountName","importId","importState","percentage","lastUpdateDate","fileName","importResult","importedAt","importedUserEmail","importedUserName"],"properties":{"accountName":{"type":"string","description":"Name of your VTEX account."},"importId":{"type":"string","description":"Unique identifier of the import."},"importState":{"type":"string","description":"Current state of the import. The possible values are:\n- `Uploaded`: The file was successfully uploaded.\n- `InValidation`: File validation is in progress.\n- `ReadyToImport`: File validation completed, ready for import.\n- `Completed`: File successfully imported.\n- `ValidationFailed`: File validation failed.\n- `CompletedWithError`: File import failed."},"percentage":{"type":"string","description":"Completion percentage of the import."},"lastUpdateDate":{"type":"string","description":"Date and time of the last update of the import, in `yyyy-mm-ddTHH:MM:SS+00:00` format."},"fileName":{"type":"string","description":"Name of the file being imported."},"importedAt":{"type":"string","description":"Date and time when the import was completed, in `yyyy-mm-ddTHH:MM:SS+00:00` format."},"importedUserEmail":{"type":"string","description":"Email address of the user who performed the import."},"importedUserName":{"type":"string","description":"Name of the user who performed the import."},"importResult":{"type":"object","description":"Information about the outcome of the bulk import operation.","properties":{"reportDownloadLink":{"type":"string","description":"A link to download a detailed report on the outcome of the bulk import."},"imports":{"type":"array","description":"Detailed information about the imported items.","items":{"type":"object","description":"Object with detailed information.","properties":{"name":{"type":"string","description":"Unique identifier associated with the imported item."},"importedRows":{"type":"integer","description":"Total number of lines successfully imported."},"rowsWithError":{"type":"integer","description":"Total number of lines that encountered errors during import."}}}}}}}},{"type":"object","description":"Object containing information about bulk import state.","required":["accountName","importId","importState","percentage","lastUpdateDate","fileName","validationResult"],"properties":{"accountName":{"type":"string","description":"Name of your VTEX account."},"importId":{"type":"string","description":"Unique identifier of the import."},"importState":{"type":"string","description":"Current state of the import. The possible values are:\n- `Uploaded`: The file was successfully uploaded.\n- `InValidation`: File validation is in progress.\n- `ReadyToImport`: File validation completed, ready for import.\n- `Completed`: File successfully imported.\n- `ValidationFailed`: File validation failed.\n- `CompletedWithError`: File import failed."},"percentage":{"type":"string","description":"Completion percentage of the import."},"lastUpdateDate":{"type":"string","description":"Date and time of the last update of the import, in `yyyy-mm-ddTHH:MM:SS+00:00` format."},"fileName":{"type":"string","description":"Name of the file being imported."},"validationResult":{"type":"object","description":"Information about the result of bulk imported data validation.","properties":{"isValid":{"type":"boolean","description":"Indicates whether the bulk import operation was successful."},"validationResult":{"type":"array","description":"Detailed information about the validation results.","items":{"type":"object","description":"Object with detailed information.","properties":{"name":{"type":"string","description":"Unique identifier associated with the imported item."},"validRows":{"type":"integer","description":"Total number of lines successfully validated."},"invalidRows":{"type":"integer","description":"Number of imported lines that failed validation."}}}}}}}}]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint applies to B2B Suite only. + + Checks the progress of a started file validation or import process. After initiating validation using [Validate file](https://developers.vtex.com/docs/api-reference/buyer-organizations#post-/api/b2b/import/buyer-orgs/validate/-importId-) or import using [Start import](https://developers.vtex.com/docs/api-reference/buyer-organizations#post-/api/b2b/import/buyer-orgs/-importId-), you can track progress by sending a request to this endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | B2B General | **B2BBulkImport** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importId` | path | (Required) Unique identifier of the import. | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "accountName": "accountName", + "importId": "3c3cba0a-8355-4812-ad4d-f4c0b32e2613", + "importState": "InValidation", + "percentage": "0", + "lastUpdateDate": "2023-10-05T16:40:11+00:00", + "fileName": "file.xlsx" + } + ``` diff --git a/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Start import.yml b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Start import.yml new file mode 100644 index 0000000000..3bd0bc2bcd --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Start import.yml @@ -0,0 +1,65 @@ +info: + name: Start import + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/b2b/import/buyer-orgs/:importId" + headers: + - name: Content-Type + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + - name: importId + value: 3c3cba0a-8355-4812-ad4d-f4c0b32e2613 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/b2b/import/buyer-orgs/:importId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/b2b/import/buyer-orgs/:importId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint applies to B2B Suite only. + + Once the file is successfully uploaded and validated, you can call this endpoint to start the import. Provide the `importId` returned by the [Validate file](https://developers.vtex.com/docs/api-reference/buyer-organizations#post-/api/b2b/import/buyer-orgs/validate/-importId-) or [Upload file](https://developers.vtex.com/docs/api-reference/buyer-organizations#post-/api/b2b/import/buyer-orgs) endpoints. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | B2B General | **B2BBulkImport** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importId` | path | (Required) Unique identifier of the import. | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Upload file.yml b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Upload file.yml new file mode 100644 index 0000000000..004dd49976 --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Upload file.yml @@ -0,0 +1,99 @@ +info: + name: Upload file + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/b2b/import/buyer-orgs" + headers: + - name: Content-Type + value: multipart/form-data + - name: Accept + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + body: + type: multipart-form + data: + - name: file + type: file + value: [] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/b2b/import/buyer-orgs - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/b2b/import/buyer-orgs - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/b2b/import/buyer-orgs - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/b2b/import/buyer-orgs - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing information about bulk import state.","required":["accountName","importId","importState","percentage","lastUpdateDate","fileName"],"properties":{"accountName":{"type":"string","description":"Name of your VTEX account."},"importId":{"type":"string","description":"Unique identifier of the import."},"importState":{"type":"string","description":"Current state of the import. The possible values are:\n- `Uploaded`: The file was successfully uploaded.\n- `InValidation`: File validation is in progress.\n- `ReadyToImport`: File validation completed, ready for import.\n- `Completed`: File successfully imported.\n- `ValidationFailed`: File validation failed.\n- `CompletedWithError`: File import failed."},"percentage":{"type":"string","description":"Completion percentage of the import."},"lastUpdateDate":{"type":"string","description":"Date and time of the last update of the import, in `yyyy-mm-ddTHH:MM:SS+00:00` format."},"fileName":{"type":"string","description":"Name of the file being imported."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint applies to B2B Suite only. + + Uploads a file for bulk import of Buyer Organizations, Cost Centers and Members. The uploaded file should be in `XLSX` format and have less than 50MB. For more information on the file structure and how to fill it out, access the [Bulk Import Spreadsheet](https://developers.vtex.com/docs/guides/bulk-import-buyer-organizations-spreadsheet) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | B2B General | **B2BBulkImport** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "accountName": "accountName", + "importId": "3c3cba0a-8355-4812-ad4d-f4c0b32e2613", + "importState": "Uploaded", + "percentage": "0", + "lastUpdateDate": "2023-10-05T16:40:11+00:00", + "fileName": "file.xlsx" + } + ``` diff --git a/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Validate file.yml b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Validate file.yml new file mode 100644 index 0000000000..ab47bc3ff7 --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/Validate file.yml @@ -0,0 +1,65 @@ +info: + name: Validate file + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/b2b/import/buyer-orgs/validate/:importId" + headers: + - name: Content-Type + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + - name: importId + value: 3c3cba0a-8355-4812-ad4d-f4c0b32e2613 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/b2b/import/buyer-orgs/validate/:importId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/b2b/import/buyer-orgs/validate/:importId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint applies to B2B Suite only. + + Starts the bulk import file content validation. Once the the file is successfully uploaded, you can start the validation using the `importId` returned by the [Upload file](https://developers.vtex.com/docs/api-reference/buyer-organizations#post-/api/b2b/import/buyer-orgs) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | B2B | B2B General | **B2BBulkImport** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importId` | path | (Required) Unique identifier of the import. | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/folder.yml b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/folder.yml new file mode 100644 index 0000000000..67a59d4639 --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/Bulk Import/folder.yml @@ -0,0 +1,4 @@ +info: + name: Bulk Import + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Buyer Organizations/environments/VTEX.yml b/BrunoCollections/VTEX - Buyer Organizations/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Buyer Organizations/opencollection.yml b/BrunoCollections/VTEX - Buyer Organizations/opencollection.yml new file mode 100644 index 0000000000..6f27de318b --- /dev/null +++ b/BrunoCollections/VTEX - Buyer Organizations/opencollection.yml @@ -0,0 +1,35 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Buyer Organizations + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + > ⚠️ This API documentation applies to B2B Suite only. + + The Buyer Organizations API facilitates the bulk import of [Buyer Organizations](https://developers.vtex.com/docs/apps/vtex.b2b-organizations), [Cost Centers](https://developers.vtex.com/docs/guides/vtex-b2b-organizations#cost-centers), and [Members](https://developers.vtex.com/docs/guides/vtex-b2b-organizations#users). By allowing spreadsheet import, this API simplifies the management of buyer organizations and allows easy updating and maintenance of information in B2B stores. + + >ℹ ️Only `.xlsx` files under 50MB in size can be imported. You can [download the template file](https://io.vtex.com.br/b2b-bulk-import/b2b-bulk-import-template.xlsx) as an example. For more information on the file structure and how to fill it out, access the [Bulk Import Buyer Organizations Spreadsheet](https://developers.vtex.com/docs/guides/bulk-import-buyer-organizations-spreadsheet) guide. + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | + | `{{environment}}` | Environment to use. Used as part of the URL. | + | `{{X-VTEX-API-AppKey}}` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + | `{{X-VTEX-API-AppToken}}` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Buying Policies API/Dimensions/Create dimension.yml b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Create dimension.yml new file mode 100644 index 0000000000..fee63a41de --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Create dimension.yml @@ -0,0 +1,354 @@ +info: + name: Create dimension + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/:accountName/authorization-dimensions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "name": "default", + "requireAllRulesAcceptance": false, + "priority": 9999, + "unitId": "654c12d6-6b22-4483-bd83-eb086c42888e", + "ruleCollection": [ + { + "name": "Approve title", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Approve condition description", + "expression": "openTextField.value = 'approved'" + }, + "effect": { + "description": "Approve condition description", + "effectType": 0 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "Deny title", + "priority": 2, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Deny condition description", + "expression": "openTextField.value = 'denied'" + }, + "effect": { + "description": "Deny condition description", + "effectType": 1 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "Pending title", + "authorizationData": { + "authorizers": [ + { + "type": "unit", + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e" + } + ] + }, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "openTextField.value = 'pending'" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "Sequential approval title", + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Sequential approval condition description", + "expression": "openTextField.value = 'sequential-approval'" + }, + "effect": { + "description": "Sequential approval condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e", + "type": "unit" + }, + { + "id": "5c969024-5c87-40f6-a89a-01172c5ae363", + "type": "unit" + } + ] + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/:accountName/authorization-dimensions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/:accountName/authorization-dimensions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/:accountName/authorization-dimensions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/:accountName/authorization-dimensions - Schema is valid", function () { + const schema = {"type":"object","description":"Response object for an authorization dimension.","properties":{"id":{"type":"string","description":"Unique identifier of the dimension."},"name":{"type":"string","description":"Name of the authorization dimension."},"unitId":{"type":"string","description":"Identifier of the business unit this dimension belongs to. If this field is not provided in the request body, the value will default to the business unit associated with the user token from the `VtexIdclientAutCookie`."},"status":{"type":["string","null"],"description":"Current status of the dimension.","enum":[null,"accepted","denied","pending","ignored"]},"priority":{"type":"integer","description":"Execution priority of the dimension. Lower numbers are evaluated first."},"requireAllRulesAcceptance":{"type":"boolean","description":"Whether all listed rules must be accepted for the dimension to be approved."},"ruleCollection":{"type":"array","description":"Collection of rules contained in this dimension.","items":{"type":"object","description":"Rule object in the response containing conditions and actions for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Evaluation priority for the rule."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}},"creationDate":{"type":"string","format":"date-time","description":"Date and time of dimension creation in the format `YYYY-MM-DDThh:mm:ssZ`."},"creationVersion":{"type":"string","description":"Version of the system that created the dimension."},"creationEnvironment":{"type":"string","description":"Environment where the dimension was created (e.g., `stable`, `beta`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new authorization dimension with its associated rules. + + Dimensions contain a `unitId` field that allows grouping of dimensions by units or business areas, enabling more granular authorization control. This field is automatically filled based on the unit relative to the user creating the dimension. + + If you make this request using an appKey/appToken pair, you must explicitly send the `unitId` field in the request body root. + + >❗ While the API supports creating multiple dimensions per unit, the Buyer's Portal frontend limits each unit to one dimension. It is recommended to maintain this structure (one dimension per unit) for consistency with the portal's design. + + ## Approval dynamic + + Rules are evaluated based on their `effectType`: + + - `effectType: 0` → Automatic approval when the expression is `true`. + - `effectType: 1` → Automatic denial when the expression is `true`. + - `effectType: 2` → Pending, requires manual authorization using the [Accept or deny rule](https://developers.vtex.com/docs/api-reference/buying-policies-api#post-/commercial-authorizations/-orderAuthId-/callback) endpoint. + + For pending rules, the `scoreInterval` defines thresholds used during manual authorization. When calling the callback endpoints with a score value, the system compares it against these thresholds: + - Scores ≥ `scoreInterval.accept` accept the rule. + - Scores ≤ `scoreInterval.deny` deny it. + - Scores in between bypass it. + + ## Hierarchical configuration + + Each organization unit has one dimension. To enforce policies from lowest to highest hierarchy levels. + + ## Dimension priority + + Controls org unit evaluation order: + + - Assign descending values by hierarchy level: top unit = 9999, child units = 9998, grandchild units = 9997. + - Sibling units share the same priority. + - System evaluates in ascending order, so lower hierarchy units are checked first. + + ## Rule priority + + Within each dimension (org unit), rules are evaluated in ascending priority order (lower numbers first). Rules must be organized in the following order, with sequential priority values: + + 1. **Bypass rules** (`effectType: 0`) — checked first, approve and stop evaluation. + 2. **Deny rules** (`effectType: 1`) — checked after all bypass rules, deny and stop evaluation. + 3. **Sequential workflow rules** (`effectType: 2`) — checked last, require manual approval. + + Priority values are not fixed to specific numbers. They must be assigned sequentially across all rules, keeping the group order above. For example, with 2 bypass rules, 3 deny rules, and 2 approval rules, priorities would be: `1` and `2` for bypass, `3`, `4`, and `5` for deny, `6` and `7` for approval. + + >❗ Set `requireAllRulesAcceptance: false` so the first matching rule executes and stops further evaluation. This enables bypass rules to immediately approve orders without checking deny or approval rules. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "c20ececf-660f-4656-a802-9ba607e3585b", + "name": "default", + "unitId": "654c12d6-6b22-4483-bd83-eb086c42888e", + "status": null, + "priority": 9999, + "requireAllRulesAcceptance": false, + "ruleCollection": [ + { + "id": "ad7742c2-8916-4bd1-86b3-b81f21f9db7e", + "name": "Approve title", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Approve condition description", + "expression": "openTextField.value = 'approved'" + }, + "effect": { + "description": "Approve condition description", + "effectType": 0 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "bf8853d3-a027-5ce2-97c4-c92032a0ec80", + "name": "Deny title", + "status": null, + "priority": 2, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Deny condition description", + "expression": "openTextField.value = 'denied'" + }, + "effect": { + "description": "Deny condition description", + "effectType": 1 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "c09964e4-b138-6df3-a8d5-da3043a1fd90", + "name": "Pending title", + "status": null, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "openTextField.value = 'pending'" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "authorizers": [ + { + "type": "unit", + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e" + } + ] + } + }, + { + "id": "d00075f5-c249-7e04-b9e6-eb4154a20e01", + "name": "Sequential approval title", + "status": null, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Sequential approval condition description", + "expression": "openTextField.value = 'sequential-approval'" + }, + "effect": { + "description": "Sequential approval condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e", + "type": "unit" + }, + { + "id": "5c969024-5c87-40f6-a89a-01172c5ae363", + "type": "unit" + } + ] + } + } + ], + "creationDate": "2025-06-10T19:11:14.7103786Z", + "creationVersion": "2.0.7", + "creationEnvironment": "stable" + } + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Dimensions/Delete dimension.yml b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Delete dimension.yml new file mode 100644 index 0000000000..d00555a275 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Delete dimension.yml @@ -0,0 +1,66 @@ +info: + name: Delete dimension + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId" + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/:accountName/authorization-dimensions/:dimensionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/:accountName/authorization-dimensions/:dimensionId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific dimension by its ID. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Buying Policies API/Dimensions/Get dimensions information.yml b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Get dimensions information.yml new file mode 100644 index 0000000000..876bd31427 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Get dimensions information.yml @@ -0,0 +1,235 @@ +info: + name: Get dimensions information + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/:accountName/authorization-dimensions" + headers: + - name: Accept + value: application/json + params: + - name: id + value: c20ececf-660f-4656-a802-9ba607e3585b + type: query + disabled: true + - name: unitId + value: 654c12d6-6b22-4483-bd83-eb086c42888e + type: query + disabled: true + - name: name + value: default + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/:accountName/authorization-dimensions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/:accountName/authorization-dimensions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/:accountName/authorization-dimensions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/:accountName/authorization-dimensions - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Authorization dimension information.","properties":{"id":{"type":"string","description":"Unique identifier of the dimension."},"name":{"type":"string","description":"Name of the authorization dimension."},"unitId":{"type":"string","description":"Identifier of the business unit this dimension belongs to."},"status":{"type":["string","null"],"description":"Current status of the dimension.","enum":[null,"accepted","denied","pending","ignored"]},"priority":{"type":"integer","description":"Execution priority of the dimension. Lower numbers are evaluated first."},"requireAllRulesAcceptance":{"type":"boolean","description":"Whether all listed rules must be accepted for the dimension to be approved."},"shouldSimulate":{"type":"boolean","description":"Indicates if the rules should be simulated instead of enforced."},"ruleCollection":{"type":"array","description":"Collection of rules contained in this dimension.","items":{"type":"object","description":"Rule object containing conditions, actions, and additional metadata for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Sequential evaluation priority for the rule. Lower numbers are evaluated first. Rules must be ordered: bypass (`effectType: 0`) first, then deny (`effectType: 1`), then sequential workflow (`effectType: 2`)."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"timeout":{"type":"number","description":"Time in milliseconds to wait for rule evaluation."},"notification":{"type":"boolean","description":"Whether a notification should be triggered (`true`) or not (`false`)."},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve (`true`) or not (`false`)."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}},"creationDate":{"type":"string","format":"date-time","description":"Date and time of dimension creation in the format `YYYY-MM-DDThh:mm:ssZ`."},"creationVersion":{"type":"string","description":"Version of the system that created the dimension."},"creationEnvironment":{"type":"string","description":"Environment where the dimension was created (e.g., `stable`, `beta`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list with dimensions information. You can optionally filter the results using query parameters. + ## Filtering behavior + - **Exact matching:** Only records with exact matches are returned (case-insensitive). + - **Multiple values:** You can pass multiple values for the same parameter by repeating it in the query string. For example, `https://api.vtexcommercestable.com.br/{accountName}/authorization-dimensions?name=Dimension name&name=Dimension other name`. + - **Combined filters:** Different filter types can be combined using AND logic. For example, `https://api.vtexcommercestable.com.br/{accountName}/authorization-dimensions?unitId=3ad21b0b-597e-4871-9ce9-9862e67012e7&name=Dimension name`. + - **No filters:** All dimensions are returned. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | View Buying Policies | OMS | **ViewBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `id` | query | Filters by dimension ID(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `id` | query | Filters by dimension ID(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `unitId` | query | Filters by organizational unit ID(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `unitId` | query | Filters by organizational unit ID(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `name` | query | Filters by dimension name(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `name` | query | Filters by dimension name(s). Supports exact matching, case-insensitive. You can pass multiple values by repeating the parameter. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "c20ececf-660f-4656-a802-9ba607e3585b", + "name": "default", + "unitId": "654c12d6-6b22-4483-bd83-eb086c42888e", + "status": null, + "priority": 9999, + "requireAllRulesAcceptance": false, + "shouldSimulate": true, + "ruleCollection": [ + { + "id": "ad7742c2-8916-4bd1-86b3-b81f21f9db7e", + "name": "Approve title", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Approve condition description", + "expression": "openTextField.value = 'approved'" + }, + "effect": { + "description": "Approve condition description", + "effectType": 0 + } + }, + "timeout": 5000, + "notification": false, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "bf8853d3-a027-5ce2-97c4-c92032a0ec80", + "name": "Deny title", + "status": null, + "priority": 2, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Deny condition description", + "expression": "openTextField.value = 'denied'" + }, + "effect": { + "description": "Deny condition description", + "effectType": 1 + } + }, + "timeout": 500, + "notification": true, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "c09964e4-b138-6df3-a8d5-da3043a1fd90", + "name": "Pending title", + "status": null, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "openTextField.value = 'pending'" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "timeout": 5000, + "notification": false, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "authorizers": [ + { + "type": "unit", + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e" + } + ] + } + }, + { + "id": "d00075f5-c249-7e04-b9e6-eb4154a20e01", + "name": "Sequential approval title", + "status": null, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Sequential approval condition description", + "expression": "openTextField.value = 'sequential-approval'" + }, + "effect": { + "description": "Sequential approval condition description", + "effectType": 2 + } + }, + "timeout": 5000, + "notification": false, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e", + "type": "unit" + }, + { + "id": "5c969024-5c87-40f6-a89a-01172c5ae363", + "type": "unit" + } + ] + } + } + ], + "creationDate": "2025-06-10T19:11:14.7103786Z", + "creationVersion": "2.0.7", + "creationEnvironment": "stable" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Dimensions/Update dimension.yml b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Update dimension.yml new file mode 100644 index 0000000000..b376867f08 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Dimensions/Update dimension.yml @@ -0,0 +1,251 @@ +info: + name: Update dimension + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + body: + type: json + data: |- + { + "name": "default", + "requireAllRulesAcceptance": false, + "priority": 9999, + "unitId": "654c12d6-6b22-4483-bd83-eb086c42888e", + "ruleCollection": [ + { + "name": "Approve title", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Approve condition description", + "expression": "openTextField.value = 'approved'" + }, + "effect": { + "description": "Approve condition description", + "effectType": 0 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "Deny title", + "priority": 2, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Deny condition description", + "expression": "openTextField.value = 'denied'" + }, + "effect": { + "description": "Deny condition description", + "effectType": 1 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "Pending title", + "authorizationData": { + "authorizers": [ + { + "type": "unit", + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e" + } + ] + }, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "openTextField.value = 'pending'" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId - Schema is valid", function () { + const schema = {"type":"object","description":"Response object for an authorization dimension.","properties":{"id":{"type":"string","description":"Unique identifier of the dimension."},"name":{"type":"string","description":"Name of the authorization dimension."},"unitId":{"type":"string","description":"Identifier of the business unit this dimension belongs to. If this field is not provided in the request body, the value will default to the business unit associated with the user token from the `VtexIdclientAutCookie`."},"status":{"type":["string","null"],"description":"Current status of the dimension.","enum":[null,"accepted","denied","pending","ignored"]},"priority":{"type":"integer","description":"Execution priority of the dimension. Lower numbers are evaluated first."},"requireAllRulesAcceptance":{"type":"boolean","description":"Whether all listed rules must be accepted for the dimension to be approved."},"ruleCollection":{"type":"array","description":"Collection of rules contained in this dimension.","items":{"type":"object","description":"Rule object in the response containing conditions and actions for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Evaluation priority for the rule."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}},"creationDate":{"type":"string","format":"date-time","description":"Date and time of dimension creation in the format `YYYY-MM-DDThh:mm:ssZ`."},"creationVersion":{"type":"string","description":"Version of the system that created the dimension."},"creationEnvironment":{"type":"string","description":"Environment where the dimension was created (e.g., `stable`, `beta`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specific authorization dimension. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "c20ececf-660f-4656-a802-9ba607e3585b", + "name": "default", + "unitId": "654c12d6-6b22-4483-bd83-eb086c42888e", + "status": null, + "priority": 9999, + "requireAllRulesAcceptance": false, + "ruleCollection": [ + { + "id": "ad7742c2-8916-4bd1-86b3-b81f21f9db7e", + "name": "Approve title", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Approve condition description", + "expression": "openTextField.value = 'approved'" + }, + "effect": { + "description": "Approve condition description", + "effectType": 0 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "bf8853d3-a027-5ce2-97c4-c92032a0ec80", + "name": "Deny title", + "status": null, + "priority": 2, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Deny condition description", + "expression": "openTextField.value = 'denied'" + }, + "effect": { + "description": "Deny condition description", + "effectType": 1 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "id": "c09964e4-b138-6df3-a8d5-da3043a1fd90", + "name": "Pending title", + "status": null, + "priority": 3, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "openTextField.value = 'pending'" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "authorizers": [ + { + "type": "unit", + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e" + } + ] + } + } + ], + "creationDate": "2025-06-10T19:11:14.7103786Z", + "creationVersion": "2.0.7", + "creationEnvironment": "stable" + } + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Dimensions/folder.yml b/BrunoCollections/VTEX - Buying Policies API/Dimensions/folder.yml new file mode 100644 index 0000000000..8c737463cd --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Dimensions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Dimensions + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Buying Policies API/Manual authorization/Accept or deny rule.yml b/BrunoCollections/VTEX - Buying Policies API/Manual authorization/Accept or deny rule.yml new file mode 100644 index 0000000000..b77ba56f4b --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Manual authorization/Accept or deny rule.yml @@ -0,0 +1,194 @@ +info: + name: Accept or deny rule + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/commercial-authorizations/:orderAuthId/callback" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderAuthId + value: 6f6d7472-e4d0-4004-a1d2-6d4ccc7e696a + type: path + body: + type: json + data: |- + { + "params": { + "score": 10, + "dimensionId": "d88e44b1-2791-4770-a9e3-d0fdc1a1c1fd", + "ruleId": "2448612d-bbbf-4bc5-8b8c-b1c3f4f638e3" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/commercial-authorizations/:orderAuthId/callback - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/commercial-authorizations/:orderAuthId/callback - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/commercial-authorizations/:orderAuthId/callback - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/commercial-authorizations/:orderAuthId/callback - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the approval request."},"orderId":{"type":"string","description":"Identifier of the order linked to this approval process."},"workflowInstanceId":{"type":"string","description":"Identifier of the workflow instance."},"status":{"type":["string","null"],"description":"Current status of the authorization.","enum":[null,"accepted","denied","pending"]},"units":{"type":"array","description":"List of unit identifiers related to the approval request.","items":{"type":"string","description":"Unit identifier."}},"callbackEndpoint":{"type":"string","description":"Callback URL for order authorization status updates."},"totalOrderValueDesiredBySeller":{"type":"number","description":"Total value of the order as expected by the seller."},"marketPlacePaymentValue":{"type":"number","description":"Value of the order payment in the marketplace."},"itemCollection":{"type":"array","description":"List of items in the order.","items":{"type":"object","description":"Item in the order authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the item in the approval process."},"sku":{"type":"string","description":"SKU identifier of the item."},"price":{"type":"number","description":"Item price."},"totalSystemDiscount":{"type":"number","description":"Discount automatically applied by the system."},"totalManualDiscount":{"type":"number","description":"Discount manually applied."},"quantity":{"type":"integer","description":"Quantity of the item."},"additionalInfo":{"type":"object","description":"Additional information about the item.","properties":{"commercialCondition":{"type":"string","description":"Commercial condition identifier."}}}}}},"additionalInfo":{"type":"object","description":"Extra information related to the request.","properties":{"userProfileId":{"type":"string","description":"Identifier of the user profile linked to this approval request."}}},"dimensionStatus":{"type":"array","description":"Approval status details per dimension.","items":{"type":"object","description":"Approval status details for a dimension.","properties":{"id":{"type":"string","description":"Unique identifier of the dimension status record."},"name":{"type":"string","description":"Dimension name."},"unitId":{"type":"string","description":"Unit identifier related to this dimension."},"userProfileId":{"type":"string","description":"User profile identifier related to this dimension."},"status":{"type":["string","null"],"description":"Current status of the dimension.","enum":[null,"accepted","denied","pending"]},"score":{"type":"integer","description":"Score assigned to the dimension."},"priority":{"type":"integer","description":"Priority of this dimension (lower = higher priority)."},"shouldSimulate":{"type":"boolean","description":"Indicates if this dimension should be simulated before application."},"ruleCollection":{"type":"array","description":"Rules applied to this dimension.","items":{"type":"object","description":"Information about a rule within a dimension.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Rule name."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"doId":{"type":["string","null"],"description":"Optional decision object identifier."},"score":{"type":"integer","description":"Score assigned to the rule."},"priority":{"type":"integer","description":"Sequential evaluation priority for the rule. Lower numbers are evaluated first. Rules must be ordered: bypass, then deny, then sequential workflow."},"trigger":{"type":"object","description":"Trigger condition and effect for the rule.","properties":{"condition":{"type":"object","description":"Condition that triggers the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Human-readable description of the condition."},"expression":{"type":"string","description":"Expression used to evaluate the condition."}}},"effect":{"type":"object","description":"Effect applied when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending)."}}}}},"timeout":{"type":"integer","description":"Timeout (in ms) for rule evaluation."},"notification":{"type":"boolean","description":"Indicates if notifications are enabled for this rule (`true`) or disabled (`false`)."},"scoreInterval":{"type":"object","description":"Score thresholds for decision making.","properties":{"accept":{"type":"integer","description":"Minimum score for acceptance."},"deny":{"type":"integer","description":"Maximum score for denial."}}},"authorizationData":{"type":"object","description":"Data related to authorization requirements.","properties":{"requireAllApprovals":{"type":"boolean","description":"If `true`, all authorizers must approve."},"authorizers":{"type":"array","description":"List of authorizers for the rule.","items":{"type":"object","description":"Authorizer information in callback response.","properties":{"id":{"type":"string","description":"Identifier of the authorizer."},"type":{"type":"string","description":"Type of authorizer (e.g., `Unit`, `user`)."},"authorizationDate":{"type":"string","format":"date-time","description":"Date when authorization occurred in the format `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"isUserAuthorized":{"type":"boolean","description":"Whether the current user is authorized."},"isUserNextAuthorizer":{"type":"boolean","description":"Whether the current user is the next required authorizer."}}}},"creationDate":{"type":"string","format":"date-time","description":"Timestamp of when the dimension status was created in the format `YYYY-MM-DDThh:mm:ssZ`."},"creationVersion":{"type":"string","description":"Version of the system at creation time."},"creationEnvironment":{"type":"string","description":"Environment in which the record was created (e.g., `stable`)."},"requireAllRulesAcceptance":{"type":"boolean","description":"If `true`, all rules must be accepted for approval."}}}},"creationVersion":{"type":"string","description":"Version of the system at creation time."},"creationEnvironment":{"type":"string","description":"Environment in which the approval request was created (e.g., `stable`)."},"userProfileId":{"type":"string","description":"Identifier of the user profile that created the approval request."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Accepts or denies a pending dimension rule, a manual approval required for rules with `effectType: 2` (pending). + + When a rule requires manual authorization, you call this endpoint with a score value that is compared against the rule's `scoreInterval` thresholds. + + The score value is configured using the [Create dimension](https://developers.vtex.com/docs/api-reference/buying-policies-api#post-/-accountName-/authorization-dimensions) and [Update dimension](https://developers.vtex.com/docs/api-reference/buying-policies-api#put-/-accountName-/authorization-dimensions/-dimensionId-) endpoints, and mean the following: + + - If score ≥ `scoreInterval.accept`, the rule is accepted. + - If score ≤ `scoreInterval.deny`, the rule is denied. + - If the score falls between these values, the rule is bypassed. + + The score is independent of the rule's expression evaluation. It's a value you provide to determine the authorization outcome. + + >ℹ️ The frontend/BFF fixes `scoreInterval` values as `accept: 10` and `deny: 5` for all rules, but these thresholds can be configured differently when creating dimensions via API. When using the standard frontend values, a score of `10` or higher will accept the rule. + + For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Approve Orders | My Account / OMS | **ApproveOrders** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderAuthId` | path | (Required) Unique identifier for the order authorization request. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "6f6d7472-e4d0-4004-a1d2-6d4ccc7e696a", + "orderId": "1557790634097-01", + "workflowInstanceId": "9f578326-ec7b-42e5-9e4f-212a07aa5697", + "status": "accepted", + "units": [ + "f9078fd1-3c6d-4103-8658-77155edaf940" + ], + "callbackEndpoint": "http://checkout.vtexcommerce.com.br/api/checkout/pvt/order-auth/1557790634097-01/callback?an=b2bfaststoredev", + "totalOrderValueDesiredBySeller": 0, + "marketPlacePaymentValue": 0, + "itemCollection": [ + { + "id": "77a7b09f-da69-4392-8ac6-7cee0acf7e0f", + "sku": "88", + "price": 33.99, + "totalSystemDiscount": -3.4, + "totalManualDiscount": 0, + "quantity": 1, + "additionalInfo": { + "commercialCondition": "1" + } + } + ], + "additionalInfo": { + "userProfileId": "69c9e480-850b-11f0-b37f-c3162b6f2b91" + }, + "dimensionStatus": [ + { + "id": "d88e44b1-2791-4770-a9e3-d0fdc1a1c1fd", + "name": "Compras faturamento B2B - vtexcommercestable", + "unitId": "f9078fd1-3c6d-4103-8658-77155edaf940", + "userProfileId": "69c9e480-850b-11f0-b37f-c3162b6f2b91", + "status": "accepted", + "score": 100, + "priority": 1, + "shouldSimulate": false, + "ruleCollection": [ + { + "id": "2448612d-bbbf-4bc5-8b8c-b1c3f4f638e3", + "name": "Pending title", + "status": "accepted", + "score": 100, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Pending condition description", + "expression": "$count(budgetData.unitAllocations.*[budgetId='0198f73a-68a1-7296-ae88-ffe9586c3528']) > 0" + }, + "effect": { + "description": "Pending condition description", + "effectType": 2 + } + }, + "timeout": 0, + "notification": false, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": false, + "authorizers": [ + { + "id": "f9078fd1-3c6d-4103-8658-77155edaf940", + "type": "Unit", + "authorizationDate": "2025-08-29T19:07:52.4705074Z" + } + ] + }, + "isUserAuthorized": true, + "isUserNextAuthorizer": false + } + ], + "creationDate": "2025-08-29T19:07:42.7281514Z", + "creationVersion": "2.1.5", + "creationEnvironment": "stable", + "requireAllRulesAcceptance": false + } + ], + "creationVersion": "2.1.5", + "creationEnvironment": "stable", + "userProfileId": "69c9e480-850b-11f0-b37f-c3162b6f2b91" + } + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Manual authorization/folder.yml b/BrunoCollections/VTEX - Buying Policies API/Manual authorization/folder.yml new file mode 100644 index 0000000000..308c98b483 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Manual authorization/folder.yml @@ -0,0 +1,4 @@ +info: + name: Manual authorization + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Buying Policies API/Rules/Create dimension rule.yml b/BrunoCollections/VTEX - Buying Policies API/Rules/Create dimension rule.yml new file mode 100644 index 0000000000..69e71661f1 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Rules/Create dimension rule.yml @@ -0,0 +1,160 @@ +info: + name: Create dimension rule + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId/rules" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + body: + type: json + data: |- + { + "name": "User Approval - Many approvers", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/:accountName/authorization-dimensions/:dimensionId/rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/:accountName/authorization-dimensions/:dimensionId/rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/:accountName/authorization-dimensions/:dimensionId/rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/:accountName/authorization-dimensions/:dimensionId/rules - Schema is valid", function () { + const schema = {"type":"object","description":"Rule object in the response containing conditions and actions for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Evaluation priority for the rule."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers a new dimension rule. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "202cd02c-e36f-4f79-85f4-91210fac8b98", + "name": "User Approval - Many approvers", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Rules/Delete dimension rule.yml b/BrunoCollections/VTEX - Buying Policies API/Rules/Delete dimension rule.yml new file mode 100644 index 0000000000..3b3bb70abc --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Rules/Delete dimension rule.yml @@ -0,0 +1,70 @@ +info: + name: Delete dimension rule + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId" + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + - name: ruleId + value: bf2ed52d-b128-4099-b3e3-43153e85b463 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific dimension rule. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `ruleId` | path | (Required) Unique identifier for the dimension rule. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Buying Policies API/Rules/Update all dimension rules.yml b/BrunoCollections/VTEX - Buying Policies API/Rules/Update all dimension rules.yml new file mode 100644 index 0000000000..203534c3e6 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Rules/Update all dimension rules.yml @@ -0,0 +1,276 @@ +info: + name: Update all dimension rules + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId/rules" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + body: + type: json + data: |- + [ + { + "name": "Accounting Limit - Max spend limit per order", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Match orders with value >= 10000 ($100)", + "expression": "$.openTextField.value = 'ODP use cases' and $.value >= 10000" + }, + "effect": { + "description": "Orders with value above $100 need to be manually approved", + "effectType": 2 + } + }, + "authorizationData": { + "authorizers": [ + { + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e", + "type": "unit" + } + ] + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "User Approval - Only one approver", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "User 8f6b3712-4c05-4ce5-8057-63fd0d69a587 needs to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 15000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "authorizationData": { + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + } + ] + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + }, + { + "name": "User Approval - Many approvers", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Rule object in the response containing conditions and actions for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Evaluation priority for the rule."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Replaces all existing rules in a dimension with the provided array of rules. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "202cd02c-e36f-4f79-85f4-91210fac8b98", + "name": "Accounting Limit - Max spend limit per order", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Match orders with value >= 10000 ($100)", + "expression": "$.openTextField.value = 'ODP use cases' and $.value >= 10000" + }, + "effect": { + "description": "Orders with value above $100 need to be manually approved", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "authorizers": [ + { + "id": "0aac12d6-6b22-4483-bd83-eb086c42888e", + "type": "unit" + } + ] + } + }, + { + "id": "303de13d-f470-5080-9605-02321abd9c09", + "name": "User Approval - Only one approver", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "User 8f6b3712-4c05-4ce5-8057-63fd0d69a587 needs to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 15000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + } + ] + } + }, + { + "id": "414ef24e-0580-6091-a706-13432ace0d10", + "name": "User Approval - Many approvers", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Rules/Update dimension rule.yml b/BrunoCollections/VTEX - Buying Policies API/Rules/Update dimension rule.yml new file mode 100644 index 0000000000..d4cd833fc6 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Rules/Update dimension rule.yml @@ -0,0 +1,164 @@ +info: + name: Update dimension rule + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: dimensionId + value: c20ececf-660f-4656-a802-9ba607e3585b + type: path + - name: ruleId + value: bf2ed52d-b128-4099-b3e3-43153e85b463 + type: path + body: + type: json + data: |- + { + "name": "User Approval - Many approvers", + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/:accountName/authorization-dimensions/:dimensionId/rules/:ruleId - Schema is valid", function () { + const schema = {"type":"object","description":"Rule object in the response containing conditions and actions for authorization.","properties":{"id":{"type":"string","description":"Unique identifier of the rule."},"name":{"type":"string","description":"Name of the rule."},"status":{"type":["string","null"],"description":"Current status of the rule.","enum":[null,"accepted","denied","pending"]},"priority":{"type":"integer","description":"Evaluation priority for the rule."},"trigger":{"type":"object","description":"Contains the trigger condition and effect logic.","properties":{"condition":{"type":"object","description":"Condition that must be met to trigger the rule.","properties":{"conditionType":{"type":"integer","description":"Type of condition, which can be `0` (bypass), `1` (deny) or `2` (sequential workflow). Type `2` defines that the rule condition is set by an expression (see field `expression`).","enum":[0,1,2]},"description":{"type":"string","description":"Description of the condition."},"expression":{"type":"string","description":"JSONata expression that defines the condition logic."}}},"effect":{"type":"object","description":"Effect to apply when the condition is met.","properties":{"description":{"type":"string","description":"Description of the effect."},"effectType":{"type":"integer","description":"Type of effect: `0` (approve), `1` (deny), or `2` (pending).","enum":[0,1,2]}}}}},"scoreInterval":{"type":"object","description":"Score range for accepting or denying the rule.","properties":{"accept":{"type":"number","description":"Minimum score required to accept the rule."},"deny":{"type":"number","description":"Maximum score to deny the rule."}}},"authorizationData":{"type":"object","description":"Defines required authorizers and whether all must approve (only present for rules with `effectType: 2`).","properties":{"requireAllApprovals":{"type":"boolean","description":"Whether all authorizers must approve."},"authorizers":{"type":"array","description":"List of entities that can authorize the action.","items":{"type":"object","description":"Entity that can authorize an action.","required":["type","id"],"properties":{"type":{"type":"string","description":"Type of authorizer. For Organization Account, it's always `unit`."},"id":{"type":"string","description":"Unique identifier of the authorizer."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specific rule within an authorization dimension. + + >ℹ️ For more information about approval dynamic, and dimension and rule priorities, see the [Buying Policies API overview](https://developers.vtex.com/docs/api-reference/buying-policies-api). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Manage Buying Policies | OMS | **ManageBuyingPolicies** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. | + | `dimensionId` | path | (Required) Unique identifier for the authorization dimension. | + | `ruleId` | path | (Required) Unique identifier for the dimension rule. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf2ed52d-b128-4099-b3e3-43153e85b463", + "name": "User Approval - Many approvers", + "status": null, + "priority": 1, + "trigger": { + "condition": { + "conditionType": 2, + "description": "Users 8f6b3712-4c05-4ce5-8057-63fd0d69a587 and 8f6b3712-4c05-4ce5-8057-63fd0d69a588 need to approve orders above $150", + "expression": "$.openTextField.value = 'ODP use cases' and $.value > 30000" + }, + "effect": { + "description": "Orders with value above $150 must be approved", + "effectType": 2 + } + }, + "scoreInterval": { + "accept": 10, + "deny": 5 + }, + "authorizationData": { + "requireAllApprovals": true, + "authorizers": [ + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a587", + "type": "unit" + }, + { + "id": "8f6b3712-4c05-4ce5-8057-63fd0d69a588", + "type": "unit" + } + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Buying Policies API/Rules/folder.yml b/BrunoCollections/VTEX - Buying Policies API/Rules/folder.yml new file mode 100644 index 0000000000..0236422a83 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/Rules/folder.yml @@ -0,0 +1,4 @@ +info: + name: Rules + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Buying Policies API/environments/VTEX.yml b/BrunoCollections/VTEX - Buying Policies API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Buying Policies API/opencollection.yml b/BrunoCollections/VTEX - Buying Policies API/opencollection.yml new file mode 100644 index 0000000000..22a14b0f1d --- /dev/null +++ b/BrunoCollections/VTEX - Buying Policies API/opencollection.yml @@ -0,0 +1,110 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Buying Policies API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Buying Policies system supports dynamic rules that merchants can configure to suit their specific authorization processes. It provides a mechanism for users to register custom rule expressions, offering greater flexibility and extensibility. + + The approval process is hierarchical and uses a priority-based evaluation system. + + ## Organization unit evaluation (dimension priority) + + - Each organization unit has one dimension containing its buying policies. + + - Dimensions are evaluated in ascending priority order (lower numbers first). + + - To enforce policies from lowest to highest hierarchy levels, assign descending priorities by hierarchy: + + - Top-level unit = 9999 (evaluated last) + - Child units = 9998 (evaluated second) + - Grandchild units = 9997 (evaluated first) + + - Sibling units share the same priority. + + - System checks lower-level org units first, then moves up the hierarchy. + + ## Policy type evaluation (rule priority) + + Within each org unit's dimension, rules are evaluated in ascending priority order (lower numbers first). Rules must be organized in the following order, with sequential priority values: + + 1. **Bypass rules** (`effectType: 0`) — checked first, approve and stop evaluation. + 2. **Deny rules** (`effectType: 1`) — checked after all bypass rules, deny and stop evaluation. + 3. **Sequential workflow rules** (`effectType: 2`) — checked last, require manual approval. + + Priority values are not fixed to specific numbers. They must be assigned sequentially across all rules, keeping the group order above. For example, with 2 bypass rules, 3 deny rules, and 2 approval rules, priorities would be: `1` and `2` for bypass, `3`, `4`, and `5` for deny, `6` and `7` for approval. + + >❗ The dimension must have `requireAllRulesAcceptance: false` so the first matching rule executes and stops further evaluation, enabling bypass functionality. + + ## Authorization dynamics and score fields + + ### Rule evaluation flow + + When an order is submitted, authorization rules are evaluated in two stages. + + #### Stage 1: Rule triggering + + - Rules are evaluated in priority order (bypass → deny → sequential workflow). + - The rule's expression is evaluated against the order data. + - If the expression is `true`, the rule is triggered and executes immediately, stopping further evaluation. + - The `effectType` determines what happens: + - `0` (bypass) → Automatic approval, order proceeds. + - `1` (deny) → Automatic denial, order is blocked. + - `2` (sequential workflow) → Pending, requires manual authorization. + - If no rules trigger, the system moves to the next org unit's dimension (if any). + + #### Stage 2: Manual authorization for pending rules + + Rules with `effectType: 2` require manual approval/denial via the [Accept or deny rule](https://developers.vtex.com/docs/api-reference/buying-policies-api#post-/commercial-authorizations/-orderAuthId-/callback) endpoint. + + ### The score system + + The `scoreInterval` object defines decision thresholds: + + ```json + "scoreInterval": { + "accept": 10, + "deny": 5 + } + ``` + + When calling the approval and denial endpoints, you provide a score value that determines the outcome: + + | Score Value | Condition | Outcome | + | :--- | :--- | :--- | + | score ≥ `scoreInterval.accept` | score ≥ 10 | Accepted | + | score ≤ `scoreInterval.deny` | score ≤ 5 | Denied | + | Between thresholds | 5 < score < 10 | Bypassed | + + >⚠️ The score is not the result of the rule's expression. It's a separate value you send when manually authorizing/denying a pending rule. + + **Example:** With `accept: 10` and `deny: 5`: + + - Sending `score: 100` → Rule accepted. + - Sending `score: 0` → Rule denied. + - Sending `score: 8` → Rule bypassed (doesn't affect authorization). + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppKey`. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - CMS API/Change URI Schema/Update all account's websites internet communication protocol.yml b/BrunoCollections/VTEX - CMS API/Change URI Schema/Update all account's websites internet communication protocol.yml new file mode 100644 index 0000000000..9b263eef27 --- /dev/null +++ b/BrunoCollections/VTEX - CMS API/Change URI Schema/Update all account's websites internet communication protocol.yml @@ -0,0 +1,76 @@ +info: + name: Update all account's websites internet communication protocol + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol" + headers: + - name: Accept + value: application/json + params: + - name: protocol + value: https + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Schema is valid", function () { + const schema = {"title":"Request Status","description":"Message indicating that the request was successful.","type":"string","example":"OK"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates all account's websites protocols to `HTTP` or `HTTPS`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `protocol` | path | (Required) Internet communication protocol, it can be `HTTP` or `HTTPS`. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. | + + ## Example response (`200`) + + ```json + "OK" + ``` diff --git a/BrunoCollections/VTEX - CMS API/Change URI Schema/Update specific website comunication protocol.yml b/BrunoCollections/VTEX - CMS API/Change URI Schema/Update specific website comunication protocol.yml new file mode 100644 index 0000000000..b5478bf16e --- /dev/null +++ b/BrunoCollections/VTEX - CMS API/Change URI Schema/Update specific website comunication protocol.yml @@ -0,0 +1,80 @@ +info: + name: Update specific website comunication protocol + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol" + headers: + - name: Accept + value: application/json + params: + - name: websiteId + value: 292c47c7-0b81-48f9-a5a0-dcf240100884 + type: path + - name: protocol + value: https + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Schema is valid", function () { + const schema = {"title":"Request Status","description":"Message indicating that the request was successful.","type":"string","example":"OK"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specific website protocol to `HTTP` or `HTTPS` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `websiteId` | path | (Required) Specific website ID. | + | `protocol` | path | (Required) Internet communication protocol, it can be `HTTP` or `HTTPS`. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. | + + ## Example response (`200`) + + ```json + "OK" + ``` diff --git a/BrunoCollections/VTEX - CMS API/Change URI Schema/folder.yml b/BrunoCollections/VTEX - CMS API/Change URI Schema/folder.yml new file mode 100644 index 0000000000..3f3f5136bf --- /dev/null +++ b/BrunoCollections/VTEX - CMS API/Change URI Schema/folder.yml @@ -0,0 +1,8 @@ +info: + name: Change URI Schema + type: folder + seq: 1 + +docs: + content: Changes CMS URI + type: text/markdown diff --git a/BrunoCollections/VTEX - CMS API/environments/VTEX.yml b/BrunoCollections/VTEX - CMS API/environments/VTEX.yml new file mode 100644 index 0000000000..9f8c78424a --- /dev/null +++ b/BrunoCollections/VTEX - CMS API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: "{accountName}" + - name: environment + value: "{environment}" + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - CMS API/opencollection.yml b/BrunoCollections/VTEX - CMS API/opencollection.yml new file mode 100644 index 0000000000..bc9a886c6f --- /dev/null +++ b/BrunoCollections/VTEX - CMS API/opencollection.yml @@ -0,0 +1,17 @@ +opencollection: 1.0.0 + +info: + name: VTEX - CMS API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import report.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import report.yml new file mode 100644 index 0000000000..a3cb40db48 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import report.yml @@ -0,0 +1,60 @@ +info: + name: Get card token import report + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/card-token-vault/tokens/import/:importId/report" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: importId + value: minim ex voluptate + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/card-token-vault/tokens/import/:importId/report - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the import report, indicating lines with issues. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Card Token Vault | **Get Import Card Tokens Report** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importId` | path | (Required) Import ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import status.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import status.yml new file mode 100644 index 0000000000..070a3afb16 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Get card token import status.yml @@ -0,0 +1,95 @@ +info: + name: Get card token import status + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/card-token-vault/tokens/import/:importId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: importId + value: minim ex voluptate + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/card-token-vault/tokens/import/:importId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/card-token-vault/tokens/import/:importId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/card-token-vault/tokens/import/:importId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/card-token-vault/tokens/import/:importId - Schema is valid", function () { + const schema = {"type":"object","description":"Status details for a submitted card token import.","properties":{"status":{"type":"string","description":"Import status value.","enum":["DONE","RUNNING","CREATED","FAILED"]},"id":{"type":"string","description":"Import ID."},"completionPercentage":{"type":"integer","description":"Importing completion percentage."},"createdDate":{"type":"string","description":"Creation date."},"updatedDate":{"type":"string","description":"Last update date."},"reportUrl":{"type":"string","description":"Report URL. This field is optional if the import process had an error."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the status and progress percentage of an import. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Card Token Vault | **Get Import Card Token Status** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `importId` | path | (Required) Import ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "status": "RUNNING", + "id": "import-123", + "completionPercentage": 42, + "createdDate": "2024-01-15T12:00:00Z", + "updatedDate": "2024-01-15T12:05:00Z", + "reportUrl": "https://example.vtexcommercestable.com.br/api/card-token-vault/tokens/import/import-123/report" + } + ``` diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token import/Import card tokens.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Import card tokens.yml new file mode 100644 index 0000000000..2efecfeb3a --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token import/Import card tokens.yml @@ -0,0 +1,100 @@ +info: + name: Import card tokens + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/card-token-vault/tokens/import" + headers: + - name: Content-Type + value: multipart/form-data + - name: Accept + value: application/json + body: + type: multipart-form + data: + - name: file + type: file + value: [] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/card-token-vault/tokens/import - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/card-token-vault/tokens/import - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/card-token-vault/tokens/import - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/card-token-vault/tokens/import - Schema is valid", function () { + const schema = {"type":"object","description":"Response payload returned after a card token import submission.","properties":{"id":{"type":"string","description":"Import ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Imports tokens in bulk using an XLSX file. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + Before starting an import process, it's important to consider the following requirements and behavioral rules: + - **File requirements:** Only `.xlsx` files up to **20 MB** are supported. + - **Simultaneous imports:** Each account can trigger only **one import operation at a time**. If an import is already in progress, you must wait for it to finish before starting a new one. + - **Auditing:** All import operations are **fully audited** for traceability. + + The request body must include your XLSX file, provided as a form-data part. The first row of the file must contain the following headers: + + | `accountName` | `providerId` | `profileId` | `paymentSystemName` | `cardFirstDigits` | `cardLastDigits` | `cardAddressType` | `cardAddressPostalCode` | `cardAddressStreet` | `cardAddressNeighborhood` | `cardAddressCity` | `cardAddressState` | `cardAddressCountry` | `cardAddressNumber` | `cardAddressComplement` | `cardHolderName` | `tokenType` | `tokenValue` | `tokenExpiration` | `tokenLabel` | `tokenProviderCardTokenId` | `tokenUseCvvForAuthorization` | `tokenHref` | `extraData` | `email` | `shopperId` | + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Card Token Vault | **Import Card Token** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + ```json + { + "id": "import-123" + } + ``` diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token import/folder.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token import/folder.yml new file mode 100644 index 0000000000..817026bea5 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token import/folder.yml @@ -0,0 +1,4 @@ +info: + name: Card token import + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token/Create card token.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token/Create card token.yml new file mode 100644 index 0000000000..19c664aead --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token/Create card token.yml @@ -0,0 +1,97 @@ +info: + name: Create card token + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/card-token-vault/tokens" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "providerId": "brpay", + "card": { + "paymentSystemName": "Visa", + "firstDigits": "000000", + "lastDigits": "0000", + "paymentSystemId": "123", + "address": { + "addressType": "Residential", + "addressId": "address-123", + "postalCode": "00000-000", + "street": "St. Example", + "neighborhood": "Centro", + "city": "Example City", + "state": "SP", + "country": "BRA", + "number": "1000", + "complement": "Apt 1" + }, + "holderName": "Shopper Example" + }, + "cardTokenData": { + "type": "TOKEN_VALUE", + "expiration": "2025-12", + "value": "token-value", + "label": "Primary card", + "providerCardTokenId": "provider-token-id", + "useCvvForAuthorization": false, + "href": "https://provider.example/token-file" + }, + "profileId": "profile-id", + "shopperId": "shopper-id", + "email": "shopper@example.com", + "orderGroup": "v71021570str", + "extraData": { + "do1": "custom-value", + "exercitation8a": "custom-value" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/card-token-vault/tokens - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers a new card token in the Card Token Vault (CTV). + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Card Token Vault | **Create Card Tokens** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token/Delete card token.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token/Delete card token.yml new file mode 100644 index 0000000000..97d8cc88d6 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token/Delete card token.yml @@ -0,0 +1,60 @@ +info: + name: Delete card token + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/payments/pvt/accounts/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: minim ex voluptate + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/payments/pvt/accounts/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a card token in the Card Token Vault (CTV). + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-MakePayments| **Process payments** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Token ID (unique identifier automatically generated during token creation and stored in the system). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token/Get card token by ID.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token/Get card token by ID.yml new file mode 100644 index 0000000000..1d0fab56f0 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token/Get card token by ID.yml @@ -0,0 +1,126 @@ +info: + name: Get card token by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/payments/pvt/accounts/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: minim ex voluptate + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/payments/pvt/accounts/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/payments/pvt/accounts/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/payments/pvt/accounts/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/payments/pvt/accounts/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Card token payload returned by the API.","properties":{"id":{"type":"string","description":"Token ID (unique identifier automatically generated during token creation and stored in the system)."},"providerId":{"type":"string","description":"Name of the payment provider responsible for the tokenized card."},"orderGroup":{"type":"string","description":"Order group ID, a segment of the order ID that groups all orders related to the same purchase. For example, in the order ID `v71021570str-02`, the order group ID is `v71021570str`."},"profileId":{"type":"string","description":"Profile ID in the Profile System (used for contract identification)."},"shopperId":{"type":"string","description":"Shopper identification."},"email":{"type":"string","description":"Email is used only if neither `profileId` nor `orderGroup` are provided."},"card":{"type":"object","description":"Card information persisted with the token.","required":["paymentSystemName","firstDigits","lastDigits"],"properties":{"paymentSystemId":{"type":"string","description":"Payment system ID in the Payment Gateway."},"paymentSystemName":{"type":"string","description":"Payment system name (card brand)."},"firstDigits":{"type":"string","description":"First six digits (BIN) of the card."},"lastDigits":{"type":"string","description":"Last four digits of the card."},"address":{"type":"object","description":"Billing address associated with the card token.","properties":{"addressType":{"type":"string","description":"Address type. Example: `Residential`."},"addressId":{"type":"string","description":"Unique identifier for the address."},"postalCode":{"type":"string","description":"Postal code (ZIP/CEP)."},"street":{"type":"string","description":"Street name."},"neighborhood":{"type":"string","description":"Neighborhood name."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State or province."},"country":{"type":"string","description":"Billing address country code (ISO 3166 alpha-3)."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Address complement (e.g., apartment, building)."}}},"holderName":{"type":"string","description":"Name of the cardholder as printed on the card."}}},"cardTokenData":{"type":"object","description":"Token-specific metadata used by the card token vault.","required":["type","expiration"],"properties":{"type":{"type":"string","description":"Token type stored in the vault.","enum":["FILE","TOKEN_CLIENT_ID","TOKEN_VALUE"]},"value":{"type":"string","description":"Token value to be used in transactions. Required when `type` is TOKEN_VALUE."},"expiration":{"type":"string","description":"Token expiration date in `YYYY-MM` format."},"label":{"type":"string","description":"Token alias (an alternative name to simplify token identification)."},"providerCardTokenId":{"type":"string","description":"Client ID used to retrieve the token from the provider. This field is required if the `type` is TOKEN_CLIENT_ID."},"useCvvForAuthorization":{"type":"boolean","default":false,"description":"Flag indicating if CVV is required (`true`) or not (`false`)."},"href":{"type":"string","description":"URL of the token file stored by the provider. This field is required if the `type` is FILE."}}},"extraData":{"type":"object","description":"Additional metadata stored with the token.","additionalProperties":{"type":"string","description":"Additional metadata value."}}},"required":["id","providerId","cardTokenData"]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves data for a specific token by its ID (unique identifier automatically generated during token creation). + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ViewPaymentData | **View Payment Data** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Token ID (unique identifier automatically generated during token creation and stored in the system). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "tok_123456789", + "providerId": "brpay", + "orderGroup": "v71021570str", + "profileId": "profile-id", + "shopperId": "shopper-id", + "email": "shopper@example.com", + "card": { + "paymentSystemId": "123", + "paymentSystemName": "Visa", + "firstDigits": "000000", + "lastDigits": "0000", + "address": { + "addressType": "Residential", + "addressId": "address-id", + "postalCode": "00000-000", + "street": "Av. Example", + "neighborhood": "Centro", + "city": "Example City", + "state": "SP", + "country": "BRA", + "number": "1000", + "complement": "Apt 1" + }, + "holderName": "Shopper Example" + }, + "cardTokenData": { + "type": "TOKEN_VALUE", + "value": "token-value", + "expiration": "2025-12", + "label": "Primary card", + "providerCardTokenId": "provider-token-id", + "useCvvForAuthorization": false, + "href": "https://provider.example/token-file" + }, + "extraData": { + "additionalProp1": "string" + } + } + ``` diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token/Update card token.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token/Update card token.yml new file mode 100644 index 0000000000..6779261563 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token/Update card token.yml @@ -0,0 +1,84 @@ +info: + name: Update card token + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/card-token-vault/tokens/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: minim ex voluptate + type: path + body: + type: json + data: |- + { + "providerId": "brpay", + "cardTokenData": { + "type": "TOKEN_VALUE", + "expiration": "2025-12", + "value": "token-value", + "label": "Primary card", + "providerCardTokenId": "provider-token-id", + "useCvvForAuthorization": false, + "href": "https://provider.example/token-file" + }, + "profileId": "profile-id", + "shopperId": "shopper-id", + "email": "shopper@example.com", + "orderGroup": "v71021570str", + "extraData": { + "additionalProp1": "custom-value" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/card-token-vault/tokens/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates data for an existing token in the Card Token Vault (CTV). + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + This endpoint requires sending the complete request body from the **Create Card Token** endpoint, except for the `card` object. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Card Token Vault | **Edit Card Tokens** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Token ID (unique identifier automatically generated during token creation and stored in the system). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Card Token Vault API/Card token/folder.yml b/BrunoCollections/VTEX - Card Token Vault API/Card token/folder.yml new file mode 100644 index 0000000000..eb35584624 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/Card token/folder.yml @@ -0,0 +1,4 @@ +info: + name: Card token + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Card Token Vault API/environments/VTEX.yml b/BrunoCollections/VTEX - Card Token Vault API/environments/VTEX.yml new file mode 100644 index 0000000000..8940d04073 --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://{{accountName}}.vtexcommercestable.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Card Token Vault API/opencollection.yml b/BrunoCollections/VTEX - Card Token Vault API/opencollection.yml new file mode 100644 index 0000000000..8e5d02847d --- /dev/null +++ b/BrunoCollections/VTEX - Card Token Vault API/opencollection.yml @@ -0,0 +1,26 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Card Token Vault API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Card Token Vault API allows VTEX merchants to manage card tokens, including creation, updates, retrieval, deletion, and bulk imports. Card tokens are unique identifiers that represent securely stored credit card data. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ The endpoints of this API can be used for personal cards (cards associated with a single buyer) and shared cards (cards used by more than one person and associated with a specific contract). However, in a scenario of operations with personal cards, the `shopperId` must be additionally sent on the **Created card token** or **Updated card token** endpoints. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Create brand.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Create brand.yml new file mode 100644 index 0000000000..521059141d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Create brand.yml @@ -0,0 +1,94 @@ +info: + name: Create brand + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog-seller-portal/brands" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "Zwilling", + "isActive": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog-seller-portal/brands - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog-seller-portal/brands - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog-seller-portal/brands - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog-seller-portal/brands - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Brand unique identifier number."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"The condition defines if the brand is active (`true`) or inactive (`false`)."},"createdAt":{"type":"string","description":"Date when the brand was created."},"updatedAt":{"type":"string","description":"Last date when the brand was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Creates a new brand. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Brand Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "863", + "name": "Zwilling", + "isActive": true, + "createdAt": "2021-05-17T15:20:36.077253+00:00", + "updatedAt": "2021-01-18T14:41:45.696488+00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get brand by ID.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get brand by ID.yml new file mode 100644 index 0000000000..866713cfd0 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get brand by ID.yml @@ -0,0 +1,92 @@ +info: + name: Get brand by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/brands/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "863" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/brands/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/brands/:brandId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/brands/:brandId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/brands/:brandId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Brand unique identifier number."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"The condition defines if the brand is active (`true`) or inactive (`false`)."},"createdAt":{"type":"string","description":"Date when the brand was created."},"updatedAt":{"type":"string","description":"Last date when the brand was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about a brand by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Brand Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "863", + "name": "Zwilling", + "isActive": false, + "createdAt": "2021-01-18T14:41:45.696488+00:00", + "updatedAt": "2021-01-18T14:41:45.696488+00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get list of brands.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get list of brands.yml new file mode 100644 index 0000000000..6d083d90ba --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Get list of brands.yml @@ -0,0 +1,130 @@ +info: + name: Get list of brands + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/brands" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: q + value: tshirt + type: query + disabled: true + - name: from + value: "1" + type: query + disabled: true + - name: to + value: "50" + type: query + disabled: true + - name: orderBy + value: status,asc;name,asc + type: query + disabled: true + - name: name + value: Zwilling + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/brands - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/brands - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/brands - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/brands - Schema is valid", function () { + const schema = {"type":"object","required":["data","_metadata"],"properties":{"data":{"type":"array","description":"List with information about the store's brands.","items":{"type":"object","description":"Brand information.","required":["id","name","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Brand unique identifier number."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"The condition defines if the brand is active (`true`) or inactive (`false`)."},"createdAt":{"type":"string","description":"Date when the brand was created."},"updatedAt":{"type":"string","description":"Last date when the brand was updated."}}}},"_metadata":{"type":"object","description":"Information about the organization and exhibition of the brand list.","required":["total","from","to","orderBy"],"properties":{"total":{"type":"integer","description":"Total of brands on the list."},"from":{"type":"integer","description":"The first page of the interval of the brand list."},"to":{"type":"integer","description":"The last page of the interval of the brand list."},"orderBy":{"type":"string","description":"The order that the list is displayed. You can select `name`, or `updated_at` to select the order criteria. Then you can add `,` , `asc` or `desc` to define the brands order."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about all brands of the store. It is mandatory to use at least one query parameter. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Brand Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `q` | query | Search word. | + | `from` | query | The first page of the interval of the brand list. | + | `to` | query | The last page of the interval of the brand list. | + | `orderBy` | query | The order that the list is displayed. You can select `name`, or `updated_at` to select the order criteria. Then you can add `,` , `asc` or `desc` to define the brands order. | + | `name` | query | Brand name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "863", + "name": "Zwilling", + "isActive": false, + "createdAt": "2021-01-18T14:41:45.696488+00:00", + "updatedAt": "2021-01-18T14:41:45.696488+00:00" + }, + { + "id": "1298", + "name": "Zooz Pets", + "isActive": false, + "createdAt": "2021-01-18T14:45:32.900176+00:00", + "updatedAt": "2021-01-18T14:45:32.900176+00:00" + } + ], + "_metadata": { + "total": 1399, + "from": 1, + "to": 10, + "orderBy": "name,desc" + } + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Update brand.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Update brand.yml new file mode 100644 index 0000000000..6a89739743 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/Update brand.yml @@ -0,0 +1,71 @@ +info: + name: Update brand + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog-seller-portal/brands/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "20" + type: path + body: + type: json + data: |- + { + "id": "20", + "name": "Zwilling", + "isActive": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog-seller-portal/brands/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog-seller-portal/brands/:brandId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Updates an existing brand. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Brand Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/folder.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/folder.yml new file mode 100644 index 0000000000..e53e402f9a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Brand/folder.yml @@ -0,0 +1,4 @@ +info: + name: Brand + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Create category.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Create category.yml new file mode 100644 index 0000000000..c06c73ac72 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Create category.yml @@ -0,0 +1,103 @@ +info: + name: Create category + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog-seller-portal/category-tree/categories" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "parentId": "567", + "Name": "Beauty" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog-seller-portal/category-tree/categories - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog-seller-portal/category-tree/categories - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog-seller-portal/category-tree/categories - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog-seller-portal/category-tree/categories - Schema is valid", function () { + const schema = {"type":"object","required":["value","children"],"properties":{"value":{"type":"object","description":"Object with values of a category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Category unique identifier number."},"name":{"type":"string","description":"Category name."},"isActive":{"type":"boolean","description":"The condition defines if the category is active (`true`) or inactive (`false`)."}}},"children":{"type":"array","description":"List of all children categories of the parent category.","items":{"type":"object","description":"Category information.","required":["value"],"properties":{"value":{"type":"object","description":"Object with values of a child category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Child category unique identifier number."},"name":{"type":"string","description":"Child category name."},"isActive":{"type":"boolean","description":"The condition defines if the child category is active (`true`) or inactive (`false`)."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Creates a new category. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Category Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": { + "id": "1", + "name": "Beauty", + "isActive": false + }, + "children": [ + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category by ID.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category by ID.yml new file mode 100644 index 0000000000..0aadbeb38f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category by ID.yml @@ -0,0 +1,101 @@ +info: + name: Get category by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/category-tree/categories/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/category-tree/categories/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/category-tree/categories/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/category-tree/categories/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/category-tree/categories/:categoryId - Schema is valid", function () { + const schema = {"type":"object","required":["value","children"],"properties":{"value":{"type":"object","description":"Object with values of a category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Category unique identifier number."},"name":{"type":"string","description":"Category name."},"isActive":{"type":"boolean","description":"The condition defines if the category is active (`true`) or inactive (`false`)."}}},"children":{"type":"array","description":"List of all children categories of the parent category.","items":{"type":"object","description":"Children category information.","required":["value"],"properties":{"value":{"type":"object","description":"Object with values of a child category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Child category unique identifier number."},"name":{"type":"string","description":"Child category name."},"isActive":{"type":"boolean","description":"The condition defines if the child category is active (`true`) or inactive (`false`)."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about a category by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Category Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": { + "id": "1", + "name": "sandboxintegracao", + "isActive": false + }, + "children": [ + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category tree.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category tree.yml new file mode 100644 index 0000000000..1933959bb5 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Get category tree.yml @@ -0,0 +1,147 @@ +info: + name: Get category tree + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/category-tree" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: depth + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/category-tree - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/category-tree - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/category-tree - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/category-tree - Schema is valid", function () { + const schema = {"type":"object","required":["roots"],"properties":{"roots":{"type":"array","description":"List of all categories of the store.","items":{"type":"object","description":"Category information.","required":["value","children"],"properties":{"value":{"type":"object","description":"Object with values of a category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Category unique identifier number."},"name":{"type":"string","description":"Category name."},"isActive":{"type":"boolean","description":"The condition defines if the category is active (`true`) or inactive (`false`)."}}},"children":{"type":"array","description":"List of all children categories of the parent category.","items":{"type":"object","description":"Child category information.","required":["value"],"properties":{"value":{"type":"object","description":"Object with values of a child category.","required":["id","name","isActive"],"properties":{"id":{"type":"string","description":"Child category unique identifier number."},"name":{"type":"string","description":"Child category name."},"isActive":{"type":"boolean","description":"The condition defines if the child category is active (`true`) or inactive (`false`)."}}}}}}}}},"createdAt":{"type":"string","description":"Date when the category tree was created."},"updatedAt":{"type":"string","description":"Last date when the category tree was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about the category tree from the store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Category Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `depth` | query | Category tree level. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "roots": [ + { + "value": { + "id": "2", + "name": "Departamento Artesanato", + "isActive": true + }, + "children": [ + { + "value": { + "id": "3", + "name": "Artesanato de Barro", + "isActive": false + }, + "children": [ + { + "value": { + "id": "4", + "name": "Artesanato de Barro Vermelho", + "isActive": false + }, + "children": [] + } + ] + } + ] + }, + { + "value": { + "id": "5", + "name": "Perfumes", + "isActive": false + }, + "children": [ + { + "value": { + "id": "6", + "name": "Perfume Feminino", + "isActive": false + }, + "children": [] + }, + { + "value": { + "id": "7", + "name": "Perfume Masculino", + "isActive": false, + "displayOnMenu": false, + "score": 0, + "filterByBrand": false, + "isClickable": false + }, + "children": [] + } + ] + } + ], + "createdAt": "2021-08-16T20:57:13.070813Z", + "updatedAt": "2022-07-07T14:24:56.416337Z" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Update category tree.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Update category tree.yml new file mode 100644 index 0000000000..8b8d782540 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/Update category tree.yml @@ -0,0 +1,111 @@ +info: + name: Update category tree + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog-seller-portal/category-tree" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "roots": [ + { + "value": { + "id": "1", + "name": "sandboxintegracao", + "isActive": false + }, + "children": [ + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + }, + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + } + ] + }, + { + "value": { + "id": "1", + "name": "sandboxintegracao", + "isActive": false + }, + "children": [ + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + }, + { + "value": { + "id": "2", + "name": "Perfumes", + "isActive": false + } + } + ] + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog-seller-portal/category-tree - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog-seller-portal/category-tree - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Updates the existing categories in the category tree. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Category Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Category/folder.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/folder.yml new file mode 100644 index 0000000000..601b87ffdd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Category/folder.yml @@ -0,0 +1,4 @@ +info: + name: Category + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Create product.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Create product.yml new file mode 100644 index 0000000000..0cdcf75e99 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Create product.yml @@ -0,0 +1,308 @@ +info: + name: Create product + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/catalog-seller-portal/products" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "status": "active", + "name": "VTEX Shirt", + "brandId": "1", + "categoryIds": [ + "732", + "421" + ], + "specs": [ + { + "name": "Color", + "values": [ + "Black", + "White" + ] + }, + { + "name": "Size", + "values": [ + "S", + "M", + "L" + ] + } + ], + "attributes": [ + { + "name": "Fabric", + "value": "Cotton" + }, + { + "name": "Gender", + "value": "Feminine" + } + ], + "slug": "/vtex-shirt", + "images": [ + { + "id": "vtex_logo.jpg", + "url": "https://mystore.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "imagem" + }, + { + "id": "vtex_logo.jpg", + "url": "https://mystore.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "imagem" + } + ], + "skus": [ + { + "name": "VTEX Shirt Black Size S", + "externalId": "1909621862", + "ean": "978-1909621862", + "manufacturerCode": "1234567", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "RealWeight": 1.6, + "RealDimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "Black" + }, + { + "name": "Size", + "value": "S" + } + ], + "images": [ + "https://mystore.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg" + ] + }, + { + "name": "VTEX Shirt White Size L", + "externalId": "1909621862", + "ean": "978-1909621862", + "manufacturerCode": "1234568", + "isActive": true, + "weight": 300, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "White" + }, + { + "name": "Size", + "value": "L" + } + ], + "images": [ + "vtex_logo.jpg" + ] + } + ], + "origin": "vtxleo7778", + "externalId": "sandboxintegracao-310117347", + "description": "VTEX Shirt Black Size S.", + "transportModal": "1", + "taxCode": "123" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog-seller-portal/products - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog-seller-portal/products - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog-seller-portal/products - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog-seller-portal/products - Schema is valid", function () { + const schema = {"type":"object","required":["status","name","brandId","brandName","categoryIds","categoryNames","specs","attributes","slug","images","skus","origin","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Product's unique identifier number."},"externalId":{"type":"string","description":"Product reference unique identifier number in the store."},"status":{"type":"string","description":"Status of the product. Its values can be `active` or `inactive`."},"name":{"type":"string","description":"Product name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit."},"brandId":{"type":"string","description":"Product's brand unique identifier number."},"brandName":{"type":"string","description":"Name of the brand associated with the product."},"description":{"type":"string","description":"Description data for product."},"categoryIds":{"type":"array","description":"Product's categories unique identifier numbers. It can have multiples IDs for each category and subcategories.","items":{"type":"string","description":"Product's category unique identifier number."}},"categoryNames":{"type":"array","description":"Names of the product's categories, displayed in a path format.","items":{"type":"string","description":"Name of the product's category."}},"specs":{"type":"array","description":"Specifications that will differentiate the possible product SKUs.","items":{"type":"object","description":"Product specification.","required":["name","values"],"properties":{"name":{"type":"string","description":"Specification name."},"values":{"type":"array","description":"Specification values.","items":{"type":"string","description":"Specification value."}}}}},"attributes":{"type":"array","description":"Array of product attributes. Attributes are additional properties used to create site browsing filters.","items":{"type":"object","description":"Product attribute information.","required":["name","value"],"properties":{"name":{"type":"string","description":"Attribute name."},"value":{"type":"string","description":"Attribute value."}}}},"slug":{"type":"string","description":"Reference of the product in the URL of the store."},"images":{"type":"array","description":"Information of the images of the product.","items":{"type":"object","description":"Image information.","required":["id","url"],"properties":{"id":{"type":"string","description":"Image ID."},"url":{"type":"string","description":"Image URL, which must be in the following format: `https://{accountName}.vtexassets.com/assets/{path}`, saved using the [Catalog Images app](https://developers.vtex.com/vtex-developer-docs/docs/vtex-catalog-images)."},"alt":{"type":"string","description":"Image alternative description."}}}},"skus":{"type":"array","description":"SKUs of the product.","items":{"type":"object","description":"SKU information.","required":["id","isActive","weight","dimensions","specs","images"],"properties":{"id":{"type":"string","description":"SKU unique identifier number."},"name":{"type":"string","description":"SKU name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit."},"externalId":{"type":"string","description":"Unique reference code created to improve the store's organization."},"ean":{"type":"string","description":"Unique SKU identification code (barcode), composed of up to 13 numeric characters."},"manufacturerCode":{"type":"string","description":"SKU reference code in the store."},"isActive":{"type":"boolean","description":"If the SKU is active (`true`) or inactive (`false`)."},"weight":{"type":"integer","description":"SKU weight. It can be lighter than 1000 g."},"dimensions":{"type":"object","description":"SKU dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"SKU width."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."}}},"RealWeight":{"type":"number","description":"The product's real weight."},"RealDimensions":{"type":"object","description":"The product's real dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"The product's real width."},"height":{"type":"number","description":"The product's real height."},"length":{"type":"number","description":"The product's real length."}}},"specs":{"type":["array","null"],"description":"SKU specifications. This field is mandatory, but nullable if there is only one SKU.","items":{"type":"object","description":"SKU specification.","required":["name","value"],"properties":{"name":{"type":"string","description":"SKU's specification name."},"value":{"type":"string","description":"SKU's specification values."}}}},"images":{"type":"array","description":"SKU's images IDs.","items":{"description":"SKU image ID.","type":"string"}}}}},"origin":{"type":"string","description":"Origin account of the product. It is not possible to alter products where the origin is `marketplace`."},"transportModal":{"type":["string","null"],"description":"Transport modal of the product."},"taxCode":{"type":["string","null"],"description":"Product tax code."},"createdAt":{"type":"string","description":"Date when the product was created."},"updatedAt":{"type":"string","description":"Last date when the product was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Creates a new product and its SKUs. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "189371", + "status": "active", + "name": "VTEX 10 Shirt", + "brandId": "1", + "brandName": "AOC", + "categoryIds": [ + "732" + ], + "categoryNames": [ + "/sandboxintegracao/Acessórios/" + ], + "specs": [ + { + "name": "Color", + "values": [ + "Black", + "White" + ] + }, + { + "name": "Size", + "values": [ + "S", + "M", + "L" + ] + } + ], + "attributes": [ + { + "name": "Fabric", + "value": "Cotton" + }, + { + "name": "Gender", + "value": "Feminine" + } + ], + "slug": "/vtex-shirt", + "transportModal": null, + "taxCode": null, + "images": [ + { + "id": "vtex_logo.jpg", + "url": "https://vtxleo7778.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "VTEX" + } + ], + "skus": [ + { + "id": "182907", + "externalId": "1909621862", + "manufacturerCode": "1234567", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "RealWeight": 1.6, + "RealDimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "Black" + }, + { + "name": "Size", + "value": "S" + } + ], + "images": [ + "vtex_logo.jpg" + ] + }, + { + "id": "182908", + "externalId": "1909621862", + "manufacturerCode": "1234568", + "isActive": true, + "weight": 300, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "White" + }, + { + "name": "Size", + "value": "L" + } + ], + "images": [ + "vtex_logo.jpg" + ] + } + ], + "origin": "vtxleo7778", + "createdAt": "2021-01-18T14:41:45.696488+00:00", + "updatedAt": "2021-01-18T14:41:45.696488+00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by ID.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by ID.yml new file mode 100644 index 0000000000..dda359f952 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by ID.yml @@ -0,0 +1,197 @@ +info: + name: Get product by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/products/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "189371" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/products/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId - Schema is valid", function () { + const schema = {"type":"object","required":["status","name","brandId","brandName","categoryIds","categoryNames","specs","attributes","slug","images","skus","origin","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Product's unique identifier number."},"externalId":{"type":"string","description":"Product reference unique identifier number in the store."},"status":{"type":"string","description":"Status of the product. Its values can be `active` or `inactive`."},"name":{"type":"string","description":"Product name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit."},"brandId":{"type":"string","description":"Product's brand unique identifier number."},"description":{"type":"string","description":"Description data for product."},"brandName":{"type":"string","description":"Name of the brand associated with the product."},"categoryIds":{"type":"array","description":"Product's categories unique identifier numbers. It can have multiples IDs for each category and subcategories.","items":{"type":"string","description":"Product's category unique identifier number."}},"categoryNames":{"type":"array","description":"Names of the product's categories, displayed in a path format.","items":{"type":"string","description":"Name of the product's category."}},"specs":{"type":"array","description":"Specifications that will differentiate the possible product SKUs.","items":{"type":"object","description":"SKU specifications.","required":["name","values"],"properties":{"name":{"type":"string","description":"Specification name."},"values":{"type":"array","description":"Specification values.","items":{"type":"string","description":"Specification value."}}}}},"attributes":{"type":"array","description":"Attributes of the product. Attributes are additional properties used to create site browsing filters.","items":{"type":"object","description":"Product attribute.","required":["name","value"],"properties":{"name":{"type":"string","description":"Attribute name."},"value":{"type":"string","description":"Attribute value."}}}},"slug":{"type":"string","description":"Reference of the product in the URL of the store."},"images":{"type":"array","description":"Information of the images of the product.","items":{"type":"object","description":"Information of the images of the product.","required":["id","url"],"properties":{"id":{"type":"string","description":"Image ID."},"url":{"type":"string","description":"Image URL, which must be in the following format: `https://{accountName}.vtexassets.com/assets/{path}`, saved using the [Catalog Images app](https://developers.vtex.com/vtex-developer-docs/docs/vtex-catalog-images)."},"alt":{"type":"string","description":"Image alternative description."}}}},"skus":{"type":"array","description":"SKUs of the product.","items":{"type":"object","description":"Informations about an SKU.","required":["id","isActive","weight","dimensions","specs","images"],"properties":{"id":{"type":"string","description":"SKU unique identifier number."},"externalId":{"type":"string","description":"Unique reference code created to improve the store's organization."},"ean":{"type":"string","description":"Unique SKU identification code (barcode), composed of up to 13 numeric characters."},"manufacturerCode":{"type":"string","description":"SKU reference code in the store."},"isActive":{"type":"boolean","description":"If the SKU is active (`true`) or inactive (`false`)."},"weight":{"type":"integer","description":"SKU weight. It can be lighter than 1000 g."},"dimensions":{"type":"object","description":"SKU dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"SKU width."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."}}},"RealWeight":{"type":"number","description":"The product's real weight."},"RealDimensions":{"type":"object","description":"The product's real dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"The product's real width."},"height":{"type":"number","description":"The product's real height."},"length":{"type":"number","description":"The product's real length."}}},"specs":{"type":["array","null"],"description":"SKU specifications. This field is mandatory, but nullable if there is only one SKU.","items":{"type":"object","description":"SKU specification.","required":["name","value"],"properties":{"name":{"type":"string","description":"SKU's specification name."},"value":{"type":"string","description":"SKU's specification values."}}}},"images":{"type":"array","description":"SKU's images IDs.","items":{"description":"SKU image ID.","type":"string"}}}}},"transportModal":{"type":["string","null"],"description":"Transport modal of the product."},"taxCode":{"type":["string","null"],"description":"Product tax code."},"origin":{"type":"string","description":"Origin account of the product. It is not possible to alter products where the origin is `marketplace`."},"createdAt":{"type":"string","description":"Date when the product was created."},"updatedAt":{"type":"string","description":"Last date when the product was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about a product by its ID. The response also has information about the product's SKUs. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "189371", + "status": "active", + "name": "VTEX 10 Shirt", + "brandId": "1", + "description": "Description data for product.", + "brandName": "AOC", + "categoryIds": [ + "732" + ], + "categoryNames": [ + "/sandboxintegracao/Acessórios/" + ], + "specs": [ + { + "name": "Color", + "values": [ + "Black", + "White" + ] + }, + { + "name": "Size", + "values": [ + "S", + "M", + "L" + ] + } + ], + "attributes": [ + { + "name": "Fabric", + "value": "Cotton" + }, + { + "name": "Gender", + "value": "Feminine" + } + ], + "slug": "/vtex-shirt", + "images": [ + { + "id": "vtex_logo.jpg", + "url": "https://vtxleo7778.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "VTEX" + } + ], + "skus": [ + { + "id": "182907", + "externalId": "1909621862", + "manufacturerCode": "1234567", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "RealWeight": 300, + "RealDimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "Black" + }, + { + "name": "Size", + "value": "S" + } + ], + "images": [ + "vtex_logo.jpg" + ] + }, + { + "id": "182908", + "externalId": "1909621862", + "manufacturerCode": "1234568", + "isActive": true, + "weight": 300, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "White" + }, + { + "name": "Size", + "value": "L" + } + ], + "images": [ + "vtex_logo.jpg" + ] + } + ], + "transportModal": "123", + "taxCode": "100", + "origin": "vtxleo7778", + "createdAt": "2022-10-31T16:28:25.578067Z", + "updatedAt": "2022-10-31T17:09:12.639088Z" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by external ID, SKU ID, SKU external ID or slug.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by external ID, SKU ID, SKU external ID or slug.yml new file mode 100644 index 0000000000..3c8c9389bd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product by external ID, SKU ID, SKU external ID or slug.yml @@ -0,0 +1,198 @@ +info: + name: Get product by external ID, SKU ID, SKU external ID or slug + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/products/:param" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: param + value: external-id=189371 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/products/:param - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/products/:param - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/products/:param - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/products/:param - Schema is valid", function () { + const schema = {"type":"object","required":["status","name","brandId","brandName","categoryIds","categoryNames","specs","attributes","slug","images","skus","origin","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"Product's unique identifier number."},"externalId":{"type":"string","description":"Product reference unique identifier number in the store."},"description":{"type":"string","description":"Description data for product."},"status":{"type":"string","description":"Status of the product. Its values can be `active` or `inactive`."},"name":{"type":"string","description":"Product name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit."},"brandId":{"type":"string","description":"Product's brand unique identifier number."},"brandName":{"type":"string","description":"Name of the brand associated with the product."},"categoryIds":{"type":"array","description":"Product's categories unique identifier numbers. It can have multiples IDs for each category and subcategories.","items":{"type":"string","description":"Product's category unique identifier number."}},"categoryNames":{"type":"array","description":"Names of the product's categories, displayed in a path format.","items":{"type":"string","description":"Name of the product's category."}},"specs":{"type":"array","description":"Specifications that will differentiate the possible product SKUs.","items":{"type":"object","description":"SKU specification.","required":["name","values"],"properties":{"name":{"type":"string","description":"Specification name."},"values":{"type":"array","description":"Specification values.","items":{"type":"string","description":"Specification value."}}}}},"attributes":{"type":"array","description":"Attributes of the product. Attributes are additional properties used to create site browsing filters.","items":{"type":"object","description":"Product attribute.","required":["name","value"],"properties":{"name":{"type":"string","description":"Attribute name."},"value":{"type":"string","description":"Attribute value."}}}},"slug":{"type":"string","description":"Reference of the product in the URL of the store."},"images":{"type":"array","description":"Information of the images of the product.","items":{"type":"object","description":"Image informations.","required":["id","url"],"properties":{"id":{"type":"string","description":"Image ID."},"url":{"type":"string","description":"Image URL, which must be in the following format: `https://{accountName}.vtexassets.com/assets/{path}`, saved using the [Catalog Images app](https://developers.vtex.com/vtex-developer-docs/docs/vtex-catalog-images)."},"alt":{"type":"string","description":"Image alternative description."}}}},"skus":{"type":"array","description":"SKUs of the product.","items":{"type":"object","description":"SKU information.","required":["id","isActive","weight","dimensions","specs","images"],"properties":{"id":{"type":"string","description":"SKU unique identifier number."},"externalId":{"type":"string","description":"Unique reference code created to improve the store's organization."},"description":{"type":"string","description":"Description data for product."},"ean":{"type":"string","description":"Unique SKU identification code (barcode), composed of up to 13 numeric characters."},"manufacturerCode":{"type":"string","description":"SKU reference code in the store."},"isActive":{"type":"boolean","description":"If the SKU is active (`true`) or inactive (`false`)."},"weight":{"type":"integer","description":"SKU weight. It can be lighter than 1000 g."},"dimensions":{"type":"object","description":"SKU dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"SKU width."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."}}},"RealWeight":{"type":"number","description":"The product's real weight."},"RealDimensions":{"type":"object","description":"The product's real dimensions.","required":["width","height","length"],"properties":{"width":{"type":"number","description":"The product's real width."},"height":{"type":"number","description":"The product's real height."},"length":{"type":"number","description":"The product's real length."}}},"specs":{"type":["array","null"],"description":"SKU specifications. This field is mandatory, but nullable if there is only one SKU.","items":{"type":"object","description":"SKU specification.","required":["name","value"],"properties":{"name":{"type":"string","description":"SKU's specification name."},"value":{"type":"string","description":"SKU's specification values."}}}},"images":{"type":"array","description":"SKU's images IDs.","items":{"type":"string","description":"SKU image ID."}}}}},"transportModal":{"type":"string","description":"Transport modal of the product."},"taxCode":{"type":"string","description":"Product tax code."},"origin":{"type":"string","description":"Origin account of the product. It is not possible to alter products where the origin is `marketplace`."},"createdAt":{"type":"string","description":"Date when the product was created."},"updatedAt":{"type":"string","description":"Last date when the product was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about a product by its external ID, SKU ID, SKU external ID or product slug. The response also has information about the product's SKUs. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `param` | path | (Required) This part of the path must follow this format: `{param}={value}`. Replace `{param}` with the name of the parameter used to fetch a product, which can be one of the following: `external-id` (product reference unique identifier number in the store), `sku-id` (SKU unique identifier number), `sku-external-id` (SKU reference unique identifier number in the store) or `slug` (reference of the product in the URL of the store). Replace `{value}` with the value of the selected param. Make sure there is a `=` between them. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "189371", + "status": "active", + "name": "VTEX 10 Shirt", + "brandId": "1", + "brandName": "AOC", + "categoryIds": [ + "732" + ], + "categoryNames": [ + "/Men/Acessories/" + ], + "specs": [ + { + "name": "Color", + "values": [ + "Black", + "White" + ] + }, + { + "name": "Size", + "values": [ + "S", + "M", + "L" + ] + } + ], + "attributes": [ + { + "name": "Fabric", + "value": "Cotton" + }, + { + "name": "Gender", + "value": "Feminine" + } + ], + "slug": "/vtex-shirt", + "images": [ + { + "id": "vtex_logo.jpg", + "url": "https://vtxleo7778.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "VTEX" + } + ], + "skus": [ + { + "id": "182907", + "name": "VTEX Shirt Black Size S", + "externalId": "1909621862", + "manufacturerCode": "1234567", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "RealWeight": 1.6, + "RealDimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "Black" + }, + { + "name": "Size", + "value": "S" + } + ], + "images": [ + "vtex_logo.jpg" + ] + }, + { + "id": "182908", + "name": "VTEX Shirt White Size L", + "externalId": "1909621862", + "manufacturerCode": "1234568", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "White" + }, + { + "name": "Size", + "value": "L" + } + ], + "images": [ + "vtex_logo.jpg" + ] + } + ], + "transportModal": "123", + "taxCode": "100", + "origin": "vtxleo7778", + "createdAt": "2022-10-31T16:28:25.578067Z", + "updatedAt": "2022-10-31T16:28:25.578067Z" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product description by product ID.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product description by product ID.yml new file mode 100644 index 0000000000..06cc699723 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Get product description by product ID.yml @@ -0,0 +1,91 @@ +info: + name: Get product description by product ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/products/:productId/description" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "189371" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/products/:productId/description - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId/description - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId/description - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/products/:productId/description - Schema is valid", function () { + const schema = {"type":"object","required":["productId","createdAt","updatedAt"],"properties":{"productId":{"type":"string","description":"Product's unique identifier number."},"createdAt":{"type":"string","description":"Date when the brand was created."},"updatedAt":{"type":"string","description":"Last date when the brand was updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center.](https://support.vtex.com/hc/en-us/requests) + + Retrieves the description of a product given a product ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "productId": "61", + "description": "Beautifully handmade laptop case/sleeve made in the Nepal Himalaya. It can be slipped inside your backpack or carried alone with space for all your work bits and pieces!", + "createdAt": "2022-10-10T19:18:45.612317Z", + "updatedAt": "2022-10-11T18:12:58.825544Z" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product description by product ID.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product description by product ID.yml new file mode 100644 index 0000000000..a6873f0784 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product description by product ID.yml @@ -0,0 +1,70 @@ +info: + name: Update product description by product ID + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog-seller-portal/products/:productId/description" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "71" + type: path + body: + type: json + data: |- + { + "productId": "71", + "description": "White shirt." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog-seller-portal/products/:productId/description - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog-seller-portal/products/:productId/description - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Updates the description of a product given a product ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product.yml new file mode 100644 index 0000000000..e2f4a8c451 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/Update product.yml @@ -0,0 +1,181 @@ +info: + name: Update product + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog-seller-portal/products/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "189371" + type: path + body: + type: json + data: |- + { + "status": "active", + "name": "Camiseta VTEX 10", + "brandId": "1", + "categoryIds": [ + "732", + "412" + ], + "specs": [ + { + "name": "Color", + "values": [ + "Black", + "White" + ] + }, + { + "name": "Size", + "values": [ + "S", + "M", + "L" + ] + } + ], + "attributes": [ + { + "name": "Fabric", + "value": "Cotton" + }, + { + "name": "Gender", + "value": "Feminine" + } + ], + "slug": "/vtex-shirt", + "images": [ + { + "id": "vtex_logo.jpg", + "url": "https://mystore.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "imagem" + }, + { + "id": "vtex_logo.jpg", + "url": "https://mystore.vtexassets.com/assets/vtex.catalog-images/products/vtex_logo.jpg", + "alt": "imagem" + } + ], + "skus": [ + { + "name": "VTEX Shirt Black Size S", + "externalId": "1909621862", + "ean": "978-1909621862", + "manufacturerCode": "1234567", + "isActive": true, + "weight": 12, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "RealWeight": 1.6, + "RealDimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "Black" + }, + { + "name": "Size", + "value": "S" + } + ], + "images": [ + "vtex_logo.jpg" + ] + }, + { + "name": "VTEX Shirt White Size L", + "externalId": "1909621862", + "ean": "978-1909621862", + "manufacturerCode": "1234568", + "isActive": true, + "weight": 300, + "dimensions": { + "width": 1.5, + "height": 2.1, + "length": 1.6 + }, + "specs": [ + { + "name": "Color", + "value": "White" + }, + { + "name": "Size", + "value": "L" + } + ], + "images": [ + "vtex_logo.jpg" + ] + } + ], + "origin": "vtxleo7778", + "id": "189371", + "externalId": "sandboxintegracao-310117347", + "description": "VTEX Shirt Black Size S Long Sleeze.", + "transportModal": "1", + "taxCode": "123" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog-seller-portal/products/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog-seller-portal/products/:productId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Updates an existing product and its SKUs. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/Product/folder.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/folder.yml new file mode 100644 index 0000000000..6f1b047102 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/Product/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Get list of SKUs.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Get list of SKUs.yml new file mode 100644 index 0000000000..cfc2ed718b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Get list of SKUs.yml @@ -0,0 +1,102 @@ +info: + name: Get list of SKUs + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/skus/ids" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: from + value: "1" + type: query + disabled: true + - name: to + value: "50" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/skus/ids - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/skus/ids - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/skus/ids - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/skus/ids - Schema is valid", function () { + const schema = {"type":"object","properties":{"data":{"type":"array","description":"List with information about the SKU.","items":{"type":"string","description":"SKU unique identifier number."}},"_metadata":{"type":"object","description":"Information about the organization and exhibition of the SKU list.","properties":{"total":{"type":"integer","description":"Total of SKUs on the list."},"from":{"type":"integer","description":"The first page of the interval of the SKU list."},"to":{"type":"integer","description":"The last page of the interval of the SKU list."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about all SKUs. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Write** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `from` | query | The first page of the interval of the product list. | + | `to` | query | The last page of the interval of the product list. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + "1", + "2" + ], + "_metadata": { + "total": 2, + "from": 1, + "to": 5 + } + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Search for SKU.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Search for SKU.yml new file mode 100644 index 0000000000..f969048317 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/Search for SKU.yml @@ -0,0 +1,115 @@ +info: + name: Search for SKU + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog-seller-portal/skus/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: from + value: "1" + type: query + disabled: true + - name: to + value: "50" + type: query + disabled: true + - name: id + value: "1" + type: query + disabled: true + - name: externalid + value: "123456789" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog-seller-portal/skus/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog-seller-portal/skus/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog-seller-portal/skus/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog-seller-portal/skus/_search - Schema is valid", function () { + const schema = {"type":"object","properties":{"data":{"type":"array","description":"List with information about the SKUs.","items":{"type":"object","description":"SKU information","properties":{"id":{"type":"string","description":"SKU unique identifier number."},"productId":{"type":"string","description":"Product unique identifier number."},"externalId":{"type":"string","description":"Unique identifier number of the association of the SKU with a Franchise Account."}}}},"_metadata":{"type":"object","description":"Information about the organization and exhibition of the SKU list.","properties":{"total":{"type":"integer","description":"Total of SKUs on the list."},"from":{"type":"integer","description":"The first page of the interval of the SKU list."},"to":{"type":"integer","description":"The last page of the interval of the SKU list."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the Beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves general information about an SKU taking into consideration the defined search criteria. It is mandatory to use at least one query parameter. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CatalogV2 | Management | **Product Read** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `from` | query | The first page of the interval of the product list. | + | `to` | query | The last page of the interval of the product list. | + | `id` | query | SKU unique idenfier number. | + | `externalid` | query | SKU reference unique identifier number in the store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "2", + "productId": "2", + "externalId": "1909621862" + } + ], + "_metadata": { + "total": 1, + "from": 1, + "to": 15 + } + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/folder.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/folder.yml new file mode 100644 index 0000000000..0c581e9081 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/SKU/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/environments/VTEX.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Catalog API Seller Portal/opencollection.yml b/BrunoCollections/VTEX - Catalog API Seller Portal/opencollection.yml new file mode 100644 index 0000000000..76a95e75b5 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API Seller Portal/opencollection.yml @@ -0,0 +1,24 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Catalog API Seller Portal + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + With the Catalog API for Seller Portal, you will be able to create, edit and consult products and their variations, brands, and categories. + + >ℹ️ This API is part of the [Seller Portal Catalog](https://help.vtex.com/en/tutorial/how-the-seller-portal-catalog-works--7pMB6YOt6YQDQQbzFB4Pxp). This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Add excluded collection to product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Add excluded collection to product assortment.yml new file mode 100644 index 0000000000..976d98395b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Add excluded collection to product assortment.yml @@ -0,0 +1,94 @@ +info: + name: Add excluded collection to product assortment + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + - name: collectionID + value: "149" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about the association between an assortment and a collection.","properties":{"assortmentId":{"type":"integer","description":"Assortment's unique identifier."},"collectionId":{"type":"integer","description":"Collection's unique identifier associated with the assortment."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a collection as an excluded collection of the specified product assortment. Excluded collections define the SKUs that must be hidden when the exclusion model is applied to the catalog segmentation. + + The same collection cannot be associated twice with the same assortment. In that case, the request will return a status code `409` error. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `collectionID` | path | (Required) Collection's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "assortmentId": 13, + "collectionId": 149 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Add included collection to product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Add included collection to product assortment.yml new file mode 100644 index 0000000000..3768145cdd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Add included collection to product assortment.yml @@ -0,0 +1,94 @@ +info: + name: Add included collection to product assortment + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + - name: collectionID + value: "149" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about the association between an assortment and a collection.","properties":{"assortmentId":{"type":"integer","description":"Assortment's unique identifier."},"collectionId":{"type":"integer","description":"Collection's unique identifier associated with the assortment."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a collection as an included collection of the specified product assortment. Included collections define the SKUs that must be explicitly allowed when the inclusion model is applied to the catalog segmentation. + + The same collection cannot be associated twice with the same assortment. In that case, the request will return a status code `409` error. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `collectionID` | path | (Required) Collection's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "assortmentId": 13, + "collectionId": 149 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Create product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Create product assortment.yml new file mode 100644 index 0000000000..1a1ed4c892 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Create product assortment.yml @@ -0,0 +1,98 @@ +info: + name: Create product assortment + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/assortment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "Stationery" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/assortment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/assortment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/assortment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/assortment - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about a product assortment.","properties":{"Id":{"type":"integer","description":"Assortment's unique numerical identifier."},"Name":{"type":"string","description":"Assortment's unique name."},"CreatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was created, in UTC format."},"UpdatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was last updated, in UTC format."},"IncludedCollections":{"type":"array","description":"List of collection IDs explicitly allowed by the assortment.","items":{"type":"integer","description":"Included collection's unique numerical identifier."}},"ExcludedCollections":{"type":"array","description":"List of collection IDs explicitly restricted by the assortment.","items":{"type":"integer","description":"Excluded collection's unique numerical identifier."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new product assortment at the merchant level. The `name` field must be unique across the merchant's assortments. + + The assortment is created empty, without included or excluded collections, which can later be added through the [Add included collection to product assortment](https://developers.vtex.com/docs/api-reference/assortments-api#post-/api/catalog/pvt/assortment/-productAssortmentID-/included-collections/-collectionID-) and [Add excluded collection to product assortment](https://developers.vtex.com/docs/api-reference/assortments-api#post-/api/catalog/pvt/assortment/-productAssortmentID-/excluded-collections/-collectionID-) endpoints. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": 5, + "Name": "Stationery", + "CreatedAt": "2026-03-02T13:57:37.313", + "UpdatedAt": "2026-03-02T13:57:37.313", + "IncludedCollections": [], + "ExcludedCollections": [] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Delete product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Delete product assortment.yml new file mode 100644 index 0000000000..036ecd43ad --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Delete product assortment.yml @@ -0,0 +1,87 @@ +info: + name: Delete product assortment + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID - Schema is valid", function () { + const schema = {"type":"object","description":"Empty response body returned upon successful deletion."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a product assortment given its unique identifier. + + >❗ Deleting an assortment does not automatically remove its reference from contracts or Organizational Unit scopes (`assortmentIds`). Make sure to remove those references before or after deletion to avoid orphaned references. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Get all product assortments.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Get all product assortments.yml new file mode 100644 index 0000000000..4c4b7561f3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Get all product assortments.yml @@ -0,0 +1,143 @@ +info: + name: Get all product assortments + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/assortment" + headers: + - name: Accept + value: application/json + params: + - name: name + value: Stationery + type: query + disabled: true + - name: after + value: "20" + type: query + disabled: true + - name: size + value: "20" + type: query + disabled: true + - name: collectionId + value: "158" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/assortment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/assortment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/assortment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/assortment - Schema is valid", function () { + const schema = {"type":"object","properties":{"TotalRows":{"type":"integer","description":"Total number of assortments available at the merchant level."},"Data":{"type":"array","description":"List of assortments returned in the current page.","items":{"type":"object","description":"Object with information about an assortment.","properties":{"Id":{"type":"integer","description":"Assortment's unique numerical identifier."},"Name":{"type":"string","description":"Assortment's unique name."},"CreatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was created, in UTC format."},"UpdatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was last updated, in UTC format."},"IncludedCollections":{"type":"array","description":"List of collection IDs explicitly allowed by the assortment.","items":{"type":"integer","description":"Included collection's unique numerical identifier."}},"ExcludedCollections":{"type":"array","description":"List of collection IDs explicitly restricted by the assortment.","items":{"type":"integer","description":"Excluded collection's unique numerical identifier."}}}}},"Size":{"type":"integer","description":"Number of assortments returned in the current page."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of product assortments registered at the merchant level. + + Assortments are used to segment the catalog for specific business contexts (for example, B2B contracts or Organization Units) based on the inclusion and exclusion of collection IDs: + + - **Inclusion model:** All products are restricted by default, and only SKUs that belong to the included collections are visible. + - **Exclusion model:** All products are available by default, and SKUs that belong to the excluded collections are hidden. + + The list returned contains both the included and excluded collections associated with an assortment. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `name` | query | Assortment name. | + | `after` | query | Cursor indicating the assortment ID after which the next page of results must start. Useful for cursor-based pagination. | + | `size` | query | Maximum number of assortments returned in the response when using cursor-based pagination. | + | `collectionId` | query | Filters the result to return only assortments that reference the specified collection ID, either as an included or as an excluded collection. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "TotalRows": 23, + "Data": [ + { + "Id": 1, + "Name": "Stationery", + "CreatedAt": "2026-03-17T13:50:12.853", + "UpdatedAt": "2026-03-19T17:16:27.652", + "IncludedCollections": [ + 157 + ], + "ExcludedCollections": [ + 158 + ] + }, + { + "Id": 2, + "Name": "Electronics", + "CreatedAt": "2026-03-17T13:51:09.817", + "UpdatedAt": "2026-03-17T13:51:09.817", + "IncludedCollections": [ + 158 + ], + "ExcludedCollections": [] + }, + { + "Id": 3, + "Name": "Furniture", + "CreatedAt": "2026-03-17T14:28:46.503", + "UpdatedAt": "2026-03-17T14:28:46.503", + "IncludedCollections": [], + "ExcludedCollections": [] + } + ], + "Size": 20 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Get product assortment by ID.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Get product assortment by ID.yml new file mode 100644 index 0000000000..b6580e0c0d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Get product assortment by ID.yml @@ -0,0 +1,96 @@ +info: + name: Get product assortment by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/assortment/:productAssortmentID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/assortment/:productAssortmentID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/assortment/:productAssortmentID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/assortment/:productAssortmentID - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about a product assortment.","properties":{"Id":{"type":"integer","description":"Assortment's unique numerical identifier."},"Name":{"type":"string","description":"Assortment's unique name."},"CreatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was created, in UTC format."},"UpdatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was last updated, in UTC format."},"IncludedCollections":{"type":"array","description":"List of collection IDs explicitly allowed by the assortment.","items":{"type":"integer","description":"Included collection's unique numerical identifier."}},"ExcludedCollections":{"type":"array","description":"List of collection IDs explicitly restricted by the assortment.","items":{"type":"integer","description":"Excluded collection's unique numerical identifier."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the details of a product assortment given its unique identifier, including the list of included and excluded collections. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 3, + "Name": "Electronics", + "CreatedAt": "2026-03-02T13:15:30.63", + "UpdatedAt": "2026-03-02T13:15:30.63", + "IncludedCollections": [ + 149 + ], + "ExcludedCollections": [ + 150 + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Remove excluded collection from product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Remove excluded collection from product assortment.yml new file mode 100644 index 0000000000..d6bb1d4df6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Remove excluded collection from product assortment.yml @@ -0,0 +1,89 @@ +info: + name: Remove excluded collection from product assortment + type: http + seq: 9 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + - name: collectionID + value: "149" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/excluded-collections/:collectionID - Schema is valid", function () { + const schema = {"type":"object","description":"Empty response body returned upon successful removal."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a collection from the excluded collections list of the specified product assortment. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `collectionID` | path | (Required) Collection's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Remove included collection from product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Remove included collection from product assortment.yml new file mode 100644 index 0000000000..fe0588edaa --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Remove included collection from product assortment.yml @@ -0,0 +1,89 @@ +info: + name: Remove included collection from product assortment + type: http + seq: 7 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID" + headers: + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + - name: collectionID + value: "149" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/catalog/pvt/assortment/:productAssortmentID/included-collections/:collectionID - Schema is valid", function () { + const schema = {"type":"object","description":"Empty response body returned upon successful removal."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a collection from the included collections list of the specified product assortment. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `collectionID` | path | (Required) Collection's unique numerical identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/Update product assortment.yml b/BrunoCollections/VTEX - Catalog API/Assortment/Update product assortment.yml new file mode 100644 index 0000000000..829c5e4117 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/Update product assortment.yml @@ -0,0 +1,101 @@ +info: + name: Update product assortment + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/assortment/:productAssortmentID" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productAssortmentID + value: "1" + type: path + body: + type: json + data: |- + { + "name": "Low-cost electronics" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/assortment/:productAssortmentID - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/assortment/:productAssortmentID - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/assortment/:productAssortmentID - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/assortment/:productAssortmentID - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about a product assortment.","properties":{"Id":{"type":"integer","description":"Assortment's unique numerical identifier."},"Name":{"type":"string","description":"Assortment's unique name."},"CreatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was created, in UTC format."},"UpdatedAt":{"type":"string","format":"date-time","description":"Date and time when the assortment was last updated, in UTC format."},"IncludedCollections":{"type":"array","description":"List of collection IDs explicitly allowed by the assortment.","items":{"type":"integer","description":"Included collection's unique numerical identifier."}},"ExcludedCollections":{"type":"array","description":"List of collection IDs explicitly restricted by the assortment.","items":{"type":"integer","description":"Excluded collection's unique numerical identifier."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the `name` of an existing product assortment given its unique identifier. The new `name` must be unique across the merchant's assortments. + + >⚠️ This feature is only available for stores using the B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --- | ----- | ----- | + | Catalog | Content | **Product and SKU Management** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productAssortmentID` | path | (Required) Product assortment's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 5, + "Name": "Low-cost electronics", + "CreatedAt": "2026-03-02T13:57:37.313", + "UpdatedAt": "2026-03-02T13:58:26.537", + "IncludedCollections": [], + "ExcludedCollections": [] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Assortment/folder.yml b/BrunoCollections/VTEX - Catalog API/Assortment/folder.yml new file mode 100644 index 0000000000..0c810d88cf --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Assortment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Assortment + type: folder + seq: 26 diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/Create attachment.yml b/BrunoCollections/VTEX - Catalog API/Attachment/Create attachment.yml new file mode 100644 index 0000000000..96d057b1a9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/Create attachment.yml @@ -0,0 +1,117 @@ +info: + name: Create attachment + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/attachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Shirt customization", + "IsRequired": false, + "IsActive": false, + "Domains": [ + { + "FieldName": "Number", + "MaxCaracters": "1", + "DomainValues": "7,9,10" + }, + { + "FieldName": "Number", + "MaxCaracters": "1", + "DomainValues": "7,9,10" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/attachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/attachment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/attachment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/attachment - Schema is valid", function () { + const schema = {"type":"object","description":"Attachment response object.","required":["Id","Name","IsRequired","IsActive","Domains"],"properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"Domains":{"type":"array","description":"List of characteristics related to the attachment.","items":{"type":"object","description":"Attachment object.","properties":{"FieldName":{"type":"string","description":"Attachment key name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters in the attachment key."},"DomainValues":{"type":"string","description":"Allowed key values."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new SKU attachment. + >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 8, + "Name": "Ingredients", + "IsRequired": true, + "IsActive": true, + "Domains": [ + { + "FieldName": "Sauce", + "MaxCaracters": "15", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, + { + "FieldName": "Toppings", + "MaxCaracters": "11", + "DomainValues": "0,1,2,3,4,5,6,7,8,9" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/Delete attachment.yml b/BrunoCollections/VTEX - Catalog API/Attachment/Delete attachment.yml new file mode 100644 index 0000000000..a01f5bbe32 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/Delete attachment.yml @@ -0,0 +1,56 @@ +info: + name: Delete attachment + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/attachment/:attachmentid" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentid + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/attachment/:attachmentid - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a previously existing SKU attachment. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentid` | path | (Required) Attachment ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/Get all attachments.yml b/BrunoCollections/VTEX - Catalog API/Attachment/Get all attachments.yml new file mode 100644 index 0000000000..9208eafa7f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/Get all attachments.yml @@ -0,0 +1,118 @@ +info: + name: Get all attachments + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/attachments" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/attachments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/attachments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/attachments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/attachments - Schema is valid", function () { + const schema = {"type":"object","properties":{"Page":{"type":"integer","description":"Current page of results."},"Size":{"type":"integer","description":"Total number of results in the current page."},"TotalRows":{"type":"integer","description":"Total number of rows with results."},"TotalPage":{"type":"integer","description":"Total number of pages with results."},"Data":{"type":"array","description":"Array containing attachments data.","items":{"type":"object","description":"Attachment object.","required":["Id","Name","IsRequired","IsActive","Domains"],"properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"Domains":{"type":"array","description":"List of characteristics related to the attachment.","items":{"type":"object","description":"Attachment details.","properties":{"FieldName":{"type":"string","description":"Attachment key name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters in the attachment key."},"DomainValues":{"type":"string","description":"Allowed key values."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about all registered attachments. + >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Page": 1, + "Size": 2, + "TotalRows": 2, + "TotalPage": 1, + "Data": [ + { + "Id": 4, + "Name": "Customization", + "IsRequired": true, + "IsActive": true, + "Domains": [ + { + "FieldName": "Basic Toppings", + "MaxCaracters": "25", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, + { + "FieldName": "TSpecial Toppings", + "MaxCaracters": "22", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + } + ] + }, + { + "Id": 7, + "Name": "vtex.subscription.testeappsubscription", + "IsRequired": false, + "IsActive": true, + "Domains": [ + { + "FieldName": "vtex.subscription.key.frequency", + "MaxCaracters": "10", + "DomainValues": "1 month" + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/Get attachment by ID.yml b/BrunoCollections/VTEX - Catalog API/Attachment/Get attachment by ID.yml new file mode 100644 index 0000000000..bec4bcd671 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/Get attachment by ID.yml @@ -0,0 +1,102 @@ +info: + name: Get attachment by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/attachment/:attachmentid" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentid + value: "8" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentid - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentid - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentid - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentid - Schema is valid", function () { + const schema = {"type":"object","description":"Attachment response object.","required":["Id","Name","IsRequired","IsActive","Domains"],"properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"Domains":{"type":"array","description":"List of characteristics related to the attachment.","items":{"type":"object","description":"Attachment object.","properties":{"FieldName":{"type":"string","description":"Attachment key name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters in the attachment key."},"DomainValues":{"type":"string","description":"Allowed key values."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets information about a registered attachment. + >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentid` | path | (Required) Attachment ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 8, + "Name": "Ingredients", + "IsRequired": true, + "IsActive": true, + "Domains": [ + { + "FieldName": "Sauce", + "MaxCaracters": "15", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, + { + "FieldName": "Toppings", + "MaxCaracters": "11", + "DomainValues": "0,1,2,3,4,5,6,7,8,9" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/Update attachment.yml b/BrunoCollections/VTEX - Catalog API/Attachment/Update attachment.yml new file mode 100644 index 0000000000..bbb44fd227 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/Update attachment.yml @@ -0,0 +1,122 @@ +info: + name: Update attachment + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/attachment/:attachmentid" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentid + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "Name": "Shirt customization", + "IsRequired": false, + "IsActive": false, + "Domains": [ + { + "FieldName": "Number", + "MaxCaracters": "1", + "DomainValues": "7,9,10" + }, + { + "FieldName": "Number", + "MaxCaracters": "1", + "DomainValues": "7,9,10" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/attachment/:attachmentid - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/attachment/:attachmentid - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/attachment/:attachmentid - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/attachment/:attachmentid - Schema is valid", function () { + const schema = {"type":"object","description":"Attachment response object.","required":["Id","Name","IsRequired","IsActive","Domains"],"properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"Domains":{"type":"array","description":"List of characteristics related to the attachment.","items":{"type":"object","description":"Attachment object.","properties":{"FieldName":{"type":"string","description":"Attachment key name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters in the attachment key."},"DomainValues":{"type":"string","description":"Allowed key values."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a previously existing SKU attachment with new information. + >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentid` | path | (Required) Attachment ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 8, + "Name": "Ingredients", + "IsRequired": true, + "IsActive": true, + "Domains": [ + { + "FieldName": "Sauce", + "MaxCaracters": "15", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, + { + "FieldName": "Toppings", + "MaxCaracters": "11", + "DomainValues": "0,1,2,3,4,5,6,7,8,9" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Attachment/folder.yml b/BrunoCollections/VTEX - Catalog API/Attachment/folder.yml new file mode 100644 index 0000000000..5434cacdc0 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Attachment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Attachment + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Create brand.yml b/BrunoCollections/VTEX - Catalog API/Brand/Create brand.yml new file mode 100644 index 0000000000..72575d329e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Create brand.yml @@ -0,0 +1,107 @@ +info: + name: Create brand + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/brand" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Id": 2000003, + "Name": "Adidas", + "Text": "Adidas", + "Keywords": "adidas", + "SiteTitle": "Adidas", + "AdWordsRemarketingCode": null, + "LomadeeCampaignCode": null, + "Score": 10, + "MenuHome": true, + "Active": true, + "LinkId": "adidas-sports" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/brand - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/brand - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/brand - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/brand - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing brand information.","required":["Id","Name"],"properties":{"Id":{"type":"integer","description":"Brand's unique numerical identifier."},"Name":{"type":"string","description":"Brand name."},"Text":{"type":"string","description":"Meta description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"Keywords":{"type":"string","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Alternative search terms that will lead to the specific brand. The user can find the desired brand even when misspelling it. Used especially when words are of foreign origin and have a distinct spelling that is transcribed into a generic one, or when small spelling mistakes occur."},"SiteTitle":{"type":"string","description":"Meta title for the brand page."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":["integer","null"],"description":"Store Framework - Deprecated\r\nLegacy CMS Portal - Value used to set the priority on the search result page."},"MenuHome":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Defines if the brand appears in the Department Menu control (``)."},"Active":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"LinkId":{"type":["string","null"],"description":"Brand page slug. Only lowercase letters and hyphens (`-`) are allowed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new brand. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brands Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2000013, + "Name": "Orma Carbon", + "Text": "Orma Carbon", + "Keywords": "orma", + "SiteTitle": "Orma Carbon", + "Active": true, + "MenuHome": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": null, + "LinkId": "orma-carbon" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Delete brand.yml b/BrunoCollections/VTEX - Catalog API/Brand/Delete brand.yml new file mode 100644 index 0000000000..fe798af881 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Delete brand.yml @@ -0,0 +1,56 @@ +info: + name: Delete brand + type: http + seq: 7 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/brand/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "123" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/brand/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing brand. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brand Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Get brand and context.yml b/BrunoCollections/VTEX - Catalog API/Brand/Get brand and context.yml new file mode 100644 index 0000000000..bc816ae6f9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Get brand and context.yml @@ -0,0 +1,96 @@ +info: + name: Get brand and context + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/brand/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "123" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/brand/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing brand information.","required":["Id","Name"],"properties":{"Id":{"type":"integer","description":"Brand's unique numerical identifier."},"Name":{"type":"string","description":"Brand name."},"Text":{"type":"string","description":"Meta description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"Keywords":{"type":"string","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Alternative search terms that will lead to the specific brand. The user can find the desired brand even when misspelling it. Used especially when words are of foreign origin and have a distinct spelling that is transcribed into a generic one, or when small spelling mistakes occur."},"SiteTitle":{"type":"string","description":"Meta title for the brand page."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":["integer","null"],"description":"Store Framework - Deprecated\r\nLegacy CMS Portal - Value used to set the priority on the search result page."},"MenuHome":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Defines if the brand appears in the Department Menu control (``)."},"Active":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"LinkId":{"type":["string","null"],"description":"Brand page slug. Only lowercase letters and hyphens (`-`) are allowed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a specific brand and its context. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brand Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2000013, + "Name": "Orma Carbon", + "Text": "Orma Carbon", + "Keywords": "orma", + "SiteTitle": "Orma Carbon", + "Active": true, + "MenuHome": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": null, + "LinkId": "orma-carbon" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Get brand by ID.yml b/BrunoCollections/VTEX - Catalog API/Brand/Get brand by ID.yml new file mode 100644 index 0000000000..b6b3b0692c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Get brand by ID.yml @@ -0,0 +1,91 @@ +info: + name: Get brand by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/brand/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "123" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/brand/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/brand/:brandId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/brand/:brandId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/brand/:brandId - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing brand information.","required":["id","name","isActive","imageUrl","title","metaTagDescription"],"properties":{"id":{"type":"integer","description":"Brand's unique numerical identifier."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"title":{"type":"string","description":"Meta title for the brand page."},"metaTagDescription":{"type":"string","description":"Meta Description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"imageUrl":{"type":["string","null"],"description":"URL of the brand's image."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific brand by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brands** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": 7000000, + "name": "Pedigree", + "isActive": true, + "metaTagDescription": "Pedigree", + "imageUrl": null, + "title": "Cat food" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Get brand list.yml b/BrunoCollections/VTEX - Catalog API/Brand/Get brand list.yml new file mode 100644 index 0000000000..2bb97af295 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Get brand list.yml @@ -0,0 +1,105 @@ +info: + name: Get brand list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/brand/list" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/brand/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/brand/list - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/brand/list - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/brand/list - Schema is valid", function () { + const schema = {"type":"array","description":"An array with all brands registered in the store.","items":{"type":"object","description":"Object containing brand information.","required":["id","name","isActive","imageUrl","title","metaTagDescription"],"properties":{"id":{"type":"integer","description":"Brand's unique numerical identifier."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"title":{"type":"string","description":"Meta title for the brand page."},"metaTagDescription":{"type":"string","description":"Meta Description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"imageUrl":{"type":["string","null"],"description":"URL of the brand's image."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all brands registered in the store's Catalog. + >⚠️ This route's response is limited to 20k results. If you need to obtain more results, please use the [Get paginated brand list](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-brand-list) endpoint instead to get a paginated response. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brands** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": 9280, + "name": "Brand", + "isActive": true, + "title": "Vertical brand", + "metaTagDescription": "Brand", + "imageUrl": null + }, + { + "id": 2000000, + "name": "Orma Carbon", + "isActive": true, + "title": "Orma Carbon S.A.", + "metaTagDescription": "Orma Carbon", + "imageUrl": null + }, + { + "id": 2000001, + "name": "Pedigree", + "isActive": true, + "title": "Pedrigree brand", + "metaTagDescription": "pedigree", + "imageUrl": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Get paginated brand list.yml b/BrunoCollections/VTEX - Catalog API/Brand/Get paginated brand list.yml new file mode 100644 index 0000000000..b70090f421 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Get paginated brand list.yml @@ -0,0 +1,121 @@ +info: + name: Get paginated brand list + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/brand/pagedlist?pageSize=5&page=1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pageSize + value: "5" + type: query + - name: page + value: "1" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/brand/pagedlist - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/brand/pagedlist - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/brand/pagedlist - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/brand/pagedlist - Schema is valid", function () { + const schema = {"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","description":"Array of objects with information of the store's brands.","items":{"type":"object","description":"Object containing brand information.","required":["id","name","isActive","imageUrl","title","metaTagDescription"],"properties":{"id":{"type":"integer","description":"Brand's unique numerical identifier."},"name":{"type":"string","description":"Brand name."},"isActive":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"title":{"type":"string","description":"Meta title for the brand page."},"metaTagDescription":{"type":"string","description":"Meta Description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"imageUrl":{"type":["string","null"],"description":"URL of the brand's image."}}}},"paging":{"type":"object","description":"Object with pagination information.","required":["page","perPage","total","pages"],"properties":{"page":{"type":"integer","description":"Page number of the brand list."},"perPage":{"type":"integer","description":"Quantity of brands per page."},"total":{"type":"integer","description":"Total of brands in the store."},"pages":{"type":"integer","description":"Total number of pages."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all brands registered in the store's Catalog by page number. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brands** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `pageSize` | query | (Required) Quantity of brands per page. | + | `page` | query | (Required) Page number of the brand list. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "id": 2000003, + "name": "AOC", + "isActive": true, + "title": "AOC", + "metaTagDescription": "AOC", + "imageUrl": null + }, + { + "id": 2000004, + "name": "Calvin Klein", + "isActive": true, + "title": "", + "metaTagDescription": "", + "imageUrl": null + }, + { + "id": 2000005, + "name": "Pets", + "isActive": true, + "title": "Pets", + "metaTagDescription": "Pets", + "imageUrl": null + } + ], + "paging": { + "page": 1, + "perPage": 20000, + "total": 201, + "pages": 1 + } + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/Update brand.yml b/BrunoCollections/VTEX - Catalog API/Brand/Update brand.yml new file mode 100644 index 0000000000..6148b549cd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/Update brand.yml @@ -0,0 +1,114 @@ +info: + name: Update brand + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/brand/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "123" + type: path + body: + type: json + data: |- + { + "Id": 2000003, + "Name": "Adidas", + "Text": "Adidas", + "Keywords": "adidas", + "SiteTitle": "Adidas", + "AdWordsRemarketingCode": null, + "LomadeeCampaignCode": null, + "Score": 10, + "MenuHome": true, + "Active": true, + "LinkId": "adidas-sports" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/brand/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/brand/:brandId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/brand/:brandId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/brand/:brandId - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing brand information.","required":["Id","Name"],"properties":{"Id":{"type":"integer","description":"Brand's unique numerical identifier."},"Name":{"type":"string","description":"Brand name."},"Text":{"type":"string","description":"Meta description for the brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description."},"Keywords":{"type":"string","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Alternative search terms that will lead to the specific brand. The user can find the desired brand even when misspelling it. Used especially when words are of foreign origin and have a distinct spelling that is transcribed into a generic one, or when small spelling mistakes occur."},"SiteTitle":{"type":"string","description":"Meta title for the brand page."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":["integer","null"],"description":"Store Framework - Deprecated\r\nLegacy CMS Portal - Value used to set the priority on the search result page."},"MenuHome":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - Defines if the brand appears in the Department Menu control (``)."},"Active":{"type":"boolean","description":"Defines if the brand is active (`true`) or not (`false`)."},"LinkId":{"type":["string","null"],"description":"Brand page slug. Only lowercase letters and hyphens (`-`) are allowed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a previously existing brand. + + >❗ Although some fields are not required to get a response `200 OK`, if you don't send a field or send its value as empty or `null`, all previously configured information will be deleted, and boolean fields will turn to `false`. So, to update a product, you should get its data using the [Get brand by ID](https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pvt/brand/-brandId-) endpoint and use it as a template for the current request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Brand Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Brand's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2000013, + "Name": "Orma Carbon", + "Text": "Orma Carbon", + "Keywords": "orma", + "SiteTitle": "Orma Carbon", + "Active": true, + "MenuHome": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": null, + "LinkId": "orma-carbon" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Brand/folder.yml b/BrunoCollections/VTEX - Catalog API/Brand/folder.yml new file mode 100644 index 0000000000..97bfd455ea --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Brand/folder.yml @@ -0,0 +1,4 @@ +info: + name: Brand + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications by category ID.yml b/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications by category ID.yml new file mode 100644 index 0000000000..58d505d80d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications by category ID.yml @@ -0,0 +1,106 @@ +info: + name: Get specifications by category ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/specification/field/listByCategoryId/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/specification/field/listByCategoryId/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listByCategoryId/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listByCategoryId/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listByCategoryId/:categoryId - Schema is valid", function () { + const schema = {"required":["Name","CategoryId","FieldId","IsActive","IsStockKeepingUnit"],"type":"array","description":"Array of objects.","items":{"type":"object","description":"Object containing specification information.","properties":{"Name":{"type":"string","description":"Specification name. Limited to 100 characters."},"CategoryId":{"type":"integer","description":"Category ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"IsActive":{"type":"boolean","description":"Defines if the specification is active."},"IsStockKeepingUnit":{"type":"boolean","description":"Defines if it is an SKU specification."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all specifications from a category by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Name": "Specification A", + "CategoryId": 1, + "FieldId": 33, + "IsActive": true, + "IsStockKeepingUnit": false + }, + { + "Name": "Specification B", + "CategoryId": 1, + "FieldId": 34, + "IsActive": true, + "IsStockKeepingUnit": false + }, + { + "Name": "Specification C", + "CategoryId": 1, + "FieldId": 35, + "IsActive": false, + "IsStockKeepingUnit": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications tree by category ID.yml b/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications tree by category ID.yml new file mode 100644 index 0000000000..d5cdbec8d3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category specification/Get specifications tree by category ID.yml @@ -0,0 +1,106 @@ +info: + name: Get specifications tree by category ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId - Schema is valid", function () { + const schema = {"required":["Name","CategoryId","FieldId","IsActive","IsStockKeepingUnit"],"type":"array","description":"Array of objects.","items":{"type":"object","description":"Object containing specification information.","properties":{"Name":{"type":"string","description":"Specification name. Limited to 100 characters."},"CategoryId":{"type":"integer","description":"Category ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"IsActive":{"type":"boolean","description":"Defines if the specification is active."},"IsStockKeepingUnit":{"type":"boolean","description":"Defines if it is an SKU specification."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all specifications including the current category and the level zero specifications from a category by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Name": "Specification A", + "CategoryId": 1, + "FieldId": 33, + "IsActive": true, + "IsStockKeepingUnit": false + }, + { + "Name": "Specification B", + "CategoryId": 1, + "FieldId": 34, + "IsActive": true, + "IsStockKeepingUnit": false + }, + { + "Name": "Specification C", + "CategoryId": 1, + "FieldId": 35, + "IsActive": false, + "IsStockKeepingUnit": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category specification/folder.yml b/BrunoCollections/VTEX - Catalog API/Category specification/folder.yml new file mode 100644 index 0000000000..bb21b4e604 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Category specification + type: folder + seq: 23 diff --git a/BrunoCollections/VTEX - Catalog API/Category/Create category.yml b/BrunoCollections/VTEX - Catalog API/Category/Create category.yml new file mode 100644 index 0000000000..46460d988b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category/Create category.yml @@ -0,0 +1,131 @@ +info: + name: Create category + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/category" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Home Appliances", + "Keywords": "Kitchen, Laundry, Appliances", + "Title": "Home Appliances", + "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + "AdWordsRemarketingCode": "Sale", + "LomadeeCampaignCode": "Sale", + "FatherCategoryId": 2, + "GlobalCategoryId": 222, + "ShowInStoreFront": true, + "IsActive": true, + "ActiveStoreFrontLink": true, + "ShowBrandFilter": true, + "Score": 3, + "StockKeepingUnitSelectionMode": "SPECIFICATION", + "Id": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/category - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/category - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/category - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/category - Schema is valid", function () { + const schema = {"required":["Id","Name","FatherCategoryId","Title","Description","Keywords","IsActive","LomadeeCampaignCode","AdWordsRemarketingCode","ShowInStoreFront","ShowBrandFilter","ActiveStoreFrontLink","GlobalCategoryId","StockKeepingUnitSelectionMode","Score","LinkId","HasChildren","TreePath","TreePathIds","TreePathLinkIds"],"type":"object","description":"Object with the category details.","properties":{"Id":{"type":"integer","description":"Category ID."},"Name":{"type":"string","description":"Category name."},"FatherCategoryId":{"type":["integer","null"],"description":"ID of the father category, apply in case of category and subcategory."},"Title":{"type":"string","description":"Category page title."},"Description":{"type":"string","description":"Describes details about the category."},"Keywords":{"type":"string","description":"Substitutes words for the category."},"IsActive":{"type":"boolean","description":"Shows if the category is active (`true`) or not (`false`)."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"ShowInStoreFront":{"type":"boolean","description":"Defines if the category is shown on side and upper menu (`true`) or not (`false`)."},"ShowBrandFilter":{"type":"boolean","description":"Defines if the category has brand filter (`true`) or not (`false`)."},"ActiveStoreFrontLink":{"type":"boolean","description":"Defines if the category has an active link on the website (`true`) or not (`false`)."},"GlobalCategoryId":{"type":"integer","description":"Google global category ID."},"StockKeepingUnitSelectionMode":{"type":"string","description":"Defines how the SKU will be exhibited."},"Score":{"type":["integer","null"],"description":"Score for search ordination."},"LinkId":{"type":"string","description":"Category text link ID. This field value is automatically generated when you create or update a category, and it corresponds to the category `name`. Once the category `linkId` is generated, it cannot be modified directly, but you can change it by updating the category with a new `name`."},"HasChildren":{"type":"boolean","description":"Defines if the category has child categories (`true`) or not (`false`)."},"TreePath":{"type":["array","null"],"description":"Category tree path, which corresponds to the category name as it is.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path."}},"TreePathIds":{"type":["array","null"],"description":"All of the category tree path IDs. Every nested category would correspond to a path ID.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"integer","description":"Category tree path ID."}},"TreePathLinkIds":{"type":["array","null"],"description":"List of category tree path link IDs. A link ID is the identifier that forms the last part of the category URL, normalizing special characters.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path link ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new category. + + If there is a need to create a new category with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Categories Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 100055, + "Name": "Accessories", + "FatherCategoryId": 100003, + "Title": "Fashion", + "Description": "Discover our range of amazing clothes and accessories.", + "Keywords": "Fashion, Women, Accessories", + "IsActive": true, + "LomadeeCampaignCode": "", + "AdWordsRemarketingCode": "", + "ShowInStoreFront": true, + "ShowBrandFilter": true, + "ActiveStoreFrontLink": true, + "GlobalCategoryId": 166, + "StockKeepingUnitSelectionMode": "LIST", + "Score": null, + "LinkId": "Accessories", + "HasChildren": true, + "TreePath": [ + "Women Fashion", + "Accessories" + ], + "TreePathIds": [ + 100003, + 100055 + ], + "TreePathLinkIds": [ + "Women-Fashion", + "Accessories" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category/Get category by ID.yml b/BrunoCollections/VTEX - Catalog API/Category/Get category by ID.yml new file mode 100644 index 0000000000..3641f57089 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category/Get category by ID.yml @@ -0,0 +1,119 @@ +info: + name: Get category by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/category/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: includeTreePath + value: "true" + type: query + disabled: true + - name: categoryId + value: "9289" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/category/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId - Schema is valid", function () { + const schema = {"required":["Id","Name","FatherCategoryId","Title","Description","Keywords","IsActive","LomadeeCampaignCode","AdWordsRemarketingCode","ShowInStoreFront","ShowBrandFilter","ActiveStoreFrontLink","GlobalCategoryId","StockKeepingUnitSelectionMode","Score","LinkId","HasChildren","TreePath","TreePathIds","TreePathLinkIds"],"type":"object","description":"Object with the category details.","properties":{"Id":{"type":"integer","description":"Category ID."},"Name":{"type":"string","description":"Category name."},"FatherCategoryId":{"type":["integer","null"],"description":"ID of the father category, apply in case of category and subcategory."},"Title":{"type":"string","description":"Category page title."},"Description":{"type":"string","description":"Describes details about the category."},"Keywords":{"type":"string","description":"Substitutes words for the category."},"IsActive":{"type":"boolean","description":"Shows if the category is active (`true`) or not (`false`)."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"ShowInStoreFront":{"type":"boolean","description":"Defines if the category is shown on side and upper menu (`true`) or not (`false`)."},"ShowBrandFilter":{"type":"boolean","description":"Defines if the category has brand filter (`true`) or not (`false`)."},"ActiveStoreFrontLink":{"type":"boolean","description":"Defines if the category has an active link on the website (`true`) or not (`false`)."},"GlobalCategoryId":{"type":"integer","description":"Google global category ID."},"StockKeepingUnitSelectionMode":{"type":"string","description":"Defines how the SKU will be exhibited."},"Score":{"type":["integer","null"],"description":"Score for search ordination."},"LinkId":{"type":"string","description":"Category text link ID. This field value is automatically generated when you create or update a category, and it corresponds to the category `name`. Once the category `linkId` is generated, it cannot be modified directly, but you can change it by updating the category with a new `name`."},"HasChildren":{"type":"boolean","description":"Defines if the category has child categories (`true`) or not (`false`)."},"TreePath":{"type":["array","null"],"description":"Category tree path, which corresponds to the category name as it is.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path."}},"TreePathIds":{"type":["array","null"],"description":"All of the category tree path IDs. Every nested category would correspond to a path ID.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"integer","description":"Category tree path ID."}},"TreePathLinkIds":{"type":["array","null"],"description":"List of category tree path link IDs. A link ID is the identifier that forms the last part of the category URL, normalizing special characters.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path link ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about a category. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Categories Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category's unique numerical identifier. | + | `includeTreePath` | query | When you use the `includeTreePath` query param set as `true`, the response body returns the existing values for the following fields: - `TreePath` - `TreePathIds` - `TreePathLinkIds` Using this param is optional. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 100055, + "Name": "Accessories", + "FatherCategoryId": 100003, + "Title": "Fashion", + "Description": "Discover our range of amazing clothes and accessories.", + "Keywords": "Fashion, Women, Accessories", + "IsActive": true, + "LomadeeCampaignCode": "", + "AdWordsRemarketingCode": "", + "ShowInStoreFront": true, + "ShowBrandFilter": true, + "ActiveStoreFrontLink": true, + "GlobalCategoryId": 166, + "StockKeepingUnitSelectionMode": "LIST", + "Score": null, + "LinkId": "Accessories", + "HasChildren": true, + "TreePath": [ + "Women Fashion", + "Accessories" + ], + "TreePathIds": [ + 100003, + 100055 + ], + "TreePathLinkIds": [ + "Women-Fashion", + "Accessories" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category/Get category tree.yml b/BrunoCollections/VTEX - Catalog API/Category/Get category tree.yml new file mode 100644 index 0000000000..7b0642637f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category/Get category tree.yml @@ -0,0 +1,189 @@ +info: + name: Get category tree + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/category/tree/:categoryLevels" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryLevels + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/category/tree/:categoryLevels - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/category/tree/:categoryLevels - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/category/tree/:categoryLevels - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/category/tree/:categoryLevels - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["id","name","hasChildren","url","children","Title","MetaTagDescription"],"type":"object","description":"Object with the response.","properties":{"id":{"type":"integer","format":"int32","description":"Category ID."},"name":{"type":"string","description":"Category name."},"hasChildren":{"type":"boolean","description":"If the category has a category child (`true`) or not (`false`)."},"url":{"type":"string","description":"Category URL."},"children":{"type":"array","items":{"required":["id","name","hasChildren","url","children","Title","MetaTagDescription"],"type":"object","description":"Object with category children information.","properties":{"id":{"type":"integer","format":"int32","description":"Category ID."},"name":{"type":"string","description":"Category name."},"hasChildren":{"type":"boolean","description":"If the category has a category child (`true`) or not (`false`)."},"url":{"type":"string","description":"Category URL."},"children":{"type":"array","description":"Array with information about the category's children.","items":{"type":"string","description":"Category children ID."}},"Title":{"type":"string","description":"Category page title."},"MetaTagDescription":{"type":"string","description":"Category page Meta tag description."}}},"description":"Array with information about the category's children."},"Title":{"type":"string","description":"Category page title."},"MetaTagDescription":{"type":"string","description":"Category page Meta tag description."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the category tree of your store. Get all the category levels registered in the Catalog or define the level up to which you want to get. + > 📘 Onboarding guide + > + > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Category** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryLevels` | path | (Required) Value of the category level you need to retrieve. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": 1, + "name": "Alimentação", + "hasChildren": true, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao", + "children": [ + { + "id": 6, + "name": "Bebedouro", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/bebedouro", + "children": [], + "Title": "Bebedouro para Gatos", + "MetaTagDescription": "" + }, + { + "id": 7, + "name": "Comedouro", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/comedouro", + "children": [], + "Title": "Comedouro para Gatos", + "MetaTagDescription": "" + }, + { + "id": 8, + "name": "Biscoitos", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/biscoitos", + "children": [], + "Title": "Biscoitos para Gatos", + "MetaTagDescription": "" + }, + { + "id": 9, + "name": "Petiscos", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/petiscos", + "children": [], + "Title": "Petiscos para Gatos", + "MetaTagDescription": "" + }, + { + "id": 10, + "name": "Ração Seca", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-seca", + "children": [], + "Title": "Ração Seca para Gatos", + "MetaTagDescription": "" + }, + { + "id": 11, + "name": "Ração Úmida", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-umida", + "children": [], + "Title": "Ração Úmida para Gatos", + "MetaTagDescription": "" + } + ], + "Title": "Alimentação para Gatos", + "MetaTagDescription": "" + }, + { + "id": 2, + "name": "Brinquedos", + "hasChildren": true, + "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos", + "children": [ + { + "id": 12, + "name": "Bolinhas", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/bolinhas", + "children": [], + "Title": "Bolinhas para Gatos", + "MetaTagDescription": "" + }, + { + "id": 13, + "name": "Ratinhos", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/ratinhos", + "children": [], + "Title": "Ratinhos", + "MetaTagDescription": "" + }, + { + "id": 19, + "name": "Arranhador para gato", + "hasChildren": false, + "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/arranhador-para-gato", + "children": [], + "Title": "Brinquedo Arranhador para gatos", + "MetaTagDescription": "Arranhador gatos é indispensável no lar com felinos. Ideais para afiar as unhas e garantir a diversão" + } + ], + "Title": "Brinquedos para Gatos", + "MetaTagDescription": "" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category/Update category.yml b/BrunoCollections/VTEX - Catalog API/Category/Update category.yml new file mode 100644 index 0000000000..70aa91478b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category/Update category.yml @@ -0,0 +1,133 @@ +info: + name: Update category + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/category/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "9289" + type: path + body: + type: json + data: |- + { + "Name": "Home Appliances", + "Keywords": "Kitchen, Laundry, Appliances", + "Title": "Home Appliances", + "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + "AdWordsRemarketingCode": "Sale", + "LomadeeCampaignCode": "Sale", + "FatherCategoryId": 2, + "GlobalCategoryId": 222, + "ShowInStoreFront": true, + "IsActive": true, + "ActiveStoreFrontLink": true, + "ShowBrandFilter": true, + "Score": 3, + "StockKeepingUnitSelectionMode": "SPECIFICATION" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/category/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/category/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/category/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/category/:categoryId - Schema is valid", function () { + const schema = {"required":["Id","Name","FatherCategoryId","Title","Description","Keywords","IsActive","LomadeeCampaignCode","AdWordsRemarketingCode","ShowInStoreFront","ShowBrandFilter","ActiveStoreFrontLink","GlobalCategoryId","StockKeepingUnitSelectionMode","Score","LinkId","HasChildren","TreePath","TreePathIds","TreePathLinkIds"],"type":"object","description":"Object with the category details.","properties":{"Id":{"type":"integer","description":"Category ID."},"Name":{"type":"string","description":"Category name."},"FatherCategoryId":{"type":["integer","null"],"description":"ID of the father category, apply in case of category and subcategory."},"Title":{"type":"string","description":"Category page title."},"Description":{"type":"string","description":"Describes details about the category."},"Keywords":{"type":"string","description":"Substitutes words for the category."},"IsActive":{"type":"boolean","description":"Shows if the category is active (`true`) or not (`false`)."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"ShowInStoreFront":{"type":"boolean","description":"Defines if the category is shown on side and upper menu (`true`) or not (`false`)."},"ShowBrandFilter":{"type":"boolean","description":"Defines if the category has brand filter (`true`) or not (`false`)."},"ActiveStoreFrontLink":{"type":"boolean","description":"Defines if the category has an active link on the website (`true`) or not (`false`)."},"GlobalCategoryId":{"type":"integer","description":"Google global category ID."},"StockKeepingUnitSelectionMode":{"type":"string","description":"Defines how the SKU will be exhibited."},"Score":{"type":["integer","null"],"description":"Score for search ordination."},"LinkId":{"type":"string","description":"Category text link ID. This field value is automatically generated when you create or update a category, and it corresponds to the category `name`. Once the category `linkId` is generated, it cannot be modified directly, but you can change it by updating the category with a new `name`."},"HasChildren":{"type":"boolean","description":"Defines if the category has child categories (`true`) or not (`false`)."},"TreePath":{"type":["array","null"],"description":"Category tree path, which corresponds to the category name as it is.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path."}},"TreePathIds":{"type":["array","null"],"description":"All of the category tree path IDs. Every nested category would correspond to a path ID.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"integer","description":"Category tree path ID."}},"TreePathLinkIds":{"type":["array","null"],"description":"List of category tree path link IDs. A link ID is the identifier that forms the last part of the category URL, normalizing special characters.\r\n\r\nUnless your request includes the query param `includeTreePath` set as `true`, this field will return `null`.","items":{"type":"string","description":"Category tree path link ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a previously existing category. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Categories Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 100055, + "Name": "Accessories", + "FatherCategoryId": 100003, + "Title": "Fashion", + "Description": "Discover our range of amazing clothes and accessories.", + "Keywords": "Fashion, Women, Accessories", + "IsActive": true, + "LomadeeCampaignCode": "", + "AdWordsRemarketingCode": "", + "ShowInStoreFront": true, + "ShowBrandFilter": true, + "ActiveStoreFrontLink": true, + "GlobalCategoryId": 166, + "StockKeepingUnitSelectionMode": "LIST", + "Score": null, + "LinkId": "Accessories", + "HasChildren": true, + "TreePath": [ + "Women Fashion", + "Accessories" + ], + "TreePathIds": [ + 100003, + 100055 + ], + "TreePathLinkIds": [ + "Women-Fashion", + "Accessories" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Category/folder.yml b/BrunoCollections/VTEX - Catalog API/Category/folder.yml new file mode 100644 index 0000000000..8181b3dc65 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Category/folder.yml @@ -0,0 +1,4 @@ +info: + name: Category + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Add products to collection by imported file.yml b/BrunoCollections/VTEX - Catalog API/Collection/Add products to collection by imported file.yml new file mode 100644 index 0000000000..a7e1bb8d06 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Add products to collection by imported file.yml @@ -0,0 +1,62 @@ +info: + name: Add products to collection by imported file + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/stockkeepingunit/importinsert" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "1" + type: path + body: + type: multipart-form + data: + - name: file + type: text + value: "[object Object]" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog/pvt/collection/:collectionId/stockkeepingunit/importinsert - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds products to a collection from the request body file. The file must be an imported template. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Marketing | **Product Collections XML** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Create collection.yml b/BrunoCollections/VTEX - Catalog API/Collection/Create collection.yml new file mode 100644 index 0000000000..13630adea8 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Create collection.yml @@ -0,0 +1,104 @@ +info: + name: Create collection + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/collection" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Halloween costumes", + "Description": "HomeHalloween", + "Searchable": false, + "Highlight": false, + "DateFrom": "2025-11-26T15:23:00", + "DateTo": "2069-11-26T15:23:00", + "TotalProducts": 21711792, + "Type": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/collection - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/collection - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/collection - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/collection - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Collection's ID."},"Name":{"type":"string","description":"Collection's name."},"Description":{"type":"string","description":"Collection's description for internal use, with the collection's details. It will not be used for search engines."},"Searchable":{"type":"boolean","description":"Option making the collection searchable in the store."},"Highlight":{"type":"boolean","description":"Option if you want the collection to highlight specific products using a tag."},"DateFrom":{"type":"string","description":"Collection start date and time. If a future date and time are set, the collection will have a scheduled status."},"DateTo":{"type":"string","description":"Collection end date and time."},"TotalProducts":{"type":"integer","description":"Number of products contained in the collection."},"Type":{"type":"string","description":"[Type of the collection](https://help.vtex.com/en/tutorial/collection-types--5tKnhh8tMGIrVL7Fqirq7n)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new collection. + + >⚠️ This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 160, + "Name": "Halloween costumes", + "Description": "HomeHalloween", + "Searchable": true, + "Highlight": false, + "DateFrom": "2025-11-26T15:23:00", + "DateTo": "2069-11-26T15:23:00", + "TotalProducts": 0, + "Type": "Manual" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Delete collection.yml b/BrunoCollections/VTEX - Catalog API/Collection/Delete collection.yml new file mode 100644 index 0000000000..cf426cc7a0 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Delete collection.yml @@ -0,0 +1,58 @@ +info: + name: Delete collection + type: http + seq: 9 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "151" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/collection/:collectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Deletes a previously existing Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Get all inactive collections.yml b/BrunoCollections/VTEX - Catalog API/Collection/Get all inactive collections.yml new file mode 100644 index 0000000000..c7a48fe4d1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Get all inactive collections.yml @@ -0,0 +1,83 @@ +info: + name: Get all inactive collections + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/inactive" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/collection/inactive - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/inactive - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/collection/inactive - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/collection/inactive - Schema is valid", function () { + const schema = {"type":"array","description":"Array with inactive collections ID.","items":{"type":"integer","description":"Inactive collection ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of Collection IDs of the inactive collections. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + 153, + 155, + 157 + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Get collection by ID.yml b/BrunoCollections/VTEX - Catalog API/Collection/Get collection by ID.yml new file mode 100644 index 0000000000..5147aab1a1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Get collection by ID.yml @@ -0,0 +1,96 @@ +info: + name: Get collection by ID + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "151" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/collection/:collectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Collection name."},"Description":{"type":["string","null"],"description":"Collection description."},"Searchable":{"type":"boolean","description":"Defines if the collection is searchable or not."},"Highlight":{"type":"boolean","description":"Defines if the collection is highlighted or not."},"DateFrom":{"type":"string","description":"Initial value date for the collection."},"DateTo":{"type":"string","description":"Final value date for the collection."},"TotalProducts":{"type":"integer","description":"Total quantity of products in the collection."},"Type":{"type":"string","description":"[Type of the collection](https://help.vtex.com/en/tutorial/collection-types--5tKnhh8tMGIrVL7Fqirq7n)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Retrieves general information of a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 150, + "Name": "Test", + "Description": "Winter outfits.", + "Searchable": true, + "Highlight": false, + "DateFrom": "2017-09-27T10:47:00", + "DateTo": "2017-09-27T10:47:00", + "TotalProducts": 150, + "Type": "Manual" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Get products from a collection.yml b/BrunoCollections/VTEX - Catalog API/Collection/Get products from a collection.yml new file mode 100644 index 0000000000..8000bf7b36 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Get products from a collection.yml @@ -0,0 +1,172 @@ +info: + name: Get products from a collection + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/products" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: page + value: "2" + type: query + disabled: true + - name: pageSize + value: "15" + type: query + disabled: true + - name: Filter + value: Pre launch + type: query + disabled: true + - name: Active + value: "true" + type: query + disabled: true + - name: Visible + value: "true" + type: query + disabled: true + - name: CategoryId + value: "12" + type: query + disabled: true + - name: BrandId + value: "3" + type: query + disabled: true + - name: SupplierId + value: "1" + type: query + disabled: true + - name: SalesChannelId + value: "1" + type: query + disabled: true + - name: ReleaseFrom + value: 2069-11-26T15:23:00 + type: query + disabled: true + - name: ReleaseTo + value: 2069-11-26T15:23:00 + type: query + disabled: true + - name: SpecificationProduct + value: M + type: query + disabled: true + - name: SpecificationFieldId + value: "40" + type: query + disabled: true + - name: collectionId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/products - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/products - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/products - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/products - Schema is valid", function () { + const schema = {"type":"object","properties":{"Page":{"description":"Page number.","type":"integer"},"Size":{"description":"Page list size.","type":"integer"},"TotalRows":{"description":"Total rows.","type":"integer"},"TotalPage":{"description":"Total pages.","type":"integer"},"Data":{"description":"Array of object with information about the products of the collection.","type":"array","items":{"description":"Product information.","type":"object","properties":{"ProductId":{"description":"Product ID.","type":"integer"},"SkuId":{"description":"SKU ID.","type":"integer"},"SubCollectionId":{"description":"Subcollection ID.","type":"integer"},"Position":{"description":"Position of the product in the collection.","type":"integer"},"ProductName":{"description":"Product name.","type":"string"},"SkuImageUrl":{"description":"SKU image URL.","type":"string"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the products from a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique identifier. | + | `page` | query | Page number. | + | `pageSize` | query | Number of the items of the page. | + | `Filter` | query | Filter used to refine the collection's products. | + | `Active` | query | Defines if the status of the product is active or not. | + | `Visible` | query | Defines if the product is visible on the store or not. | + | `CategoryId` | query | Product's category unique identifier. | + | `BrandId` | query | Product's brand unique identifier. | + | `SupplierId` | query | Product's supplier unique identifier. | + | `SalesChannelId` | query | Product's sales channel unique identifier. | + | `ReleaseFrom` | query | Product past release date. | + | `ReleaseTo` | query | Product future release date. | + | `SpecificationProduct` | query | Product specification field Value. You must also fill in `SpecificationFieldId` to use this parameter. | + | `SpecificationFieldId` | query | Product specification field unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Page": 1, + "Size": 2, + "TotalRows": 2, + "TotalPage": 1, + "Data": [ + { + "ProductId": 1, + "SkuId": 1, + "SubCollectionId": 24, + "Position": 1, + "ProductName": "Ração Royal Canin Feline Urinary", + "SkuImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155450" + }, + { + "ProductId": 2, + "SkuId": 3, + "SubCollectionId": 24, + "Position": 2, + "ProductName": "Caixa de Areia Azul Petmate", + "SkuImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Import collection file example.yml b/BrunoCollections/VTEX - Catalog API/Collection/Import collection file example.yml new file mode 100644 index 0000000000..a9ca4e9fa3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Import collection file example.yml @@ -0,0 +1,58 @@ +info: + name: Import collection file example + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/stockkeepingunit/importfileexample" + headers: + - name: Accept + value: "*/*" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/catalog/pvt/collection/stockkeepingunit/importfileexample - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/stockkeepingunit/importfileexample - Content-Type is */*", function () { + expect(String(res.getHeader("content-type"))).to.include("*/*"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Imports a sample of the imported XLS file. You need to save the response file to your device. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```text + {File in XLS format that should be saved by the client} + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Remove products from collection by imported file.yml b/BrunoCollections/VTEX - Catalog API/Collection/Remove products from collection by imported file.yml new file mode 100644 index 0000000000..4bf0a80162 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Remove products from collection by imported file.yml @@ -0,0 +1,62 @@ +info: + name: Remove products from collection by imported file + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/stockkeepingunit/importexclude" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "1" + type: path + body: + type: multipart-form + data: + - name: file + type: text + value: "[object Object]" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog/pvt/collection/:collectionId/stockkeepingunit/importexclude - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes products from a collection from the request body file. The file must be an imported template. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Collection/Update collection.yml b/BrunoCollections/VTEX - Catalog API/Collection/Update collection.yml new file mode 100644 index 0000000000..5ebd0d0104 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/Update collection.yml @@ -0,0 +1,106 @@ +info: + name: Update collection + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "151" + type: path + body: + type: json + data: |- + { + "Name": "Test", + "Searchable": true, + "Highlight": false, + "DateFrom": "2017-09-27T10:47:00", + "DateTo": "2017-09-27T10:47:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/collection/:collectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/collection/:collectionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/collection/:collectionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/collection/:collectionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Collection name."},"Description":{"type":["string","null"],"description":"Collection description."},"Searchable":{"type":"boolean","description":"Defines if the collection is searchable or not."},"Highlight":{"type":"boolean","description":"Defines if the collection is highlighted or not."},"DateFrom":{"type":"string","description":"Initial value date for the collection."},"DateTo":{"type":"string","description":"Final value date for the collection."},"TotalProducts":{"type":"integer","description":"Total quantity of products in the collection."},"Type":{"type":"string","description":"[Type of the collection](https://help.vtex.com/en/tutorial/collection-types--5tKnhh8tMGIrVL7Fqirq7n)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Updates a previously created Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 150, + "Name": "Test", + "Description": "Winter outfits.", + "Searchable": true, + "Highlight": false, + "DateFrom": "2017-09-27T10:47:00", + "DateTo": "2017-09-27T10:47:00", + "TotalProducts": 150, + "Type": "Manual" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Collection/folder.yml b/BrunoCollections/VTEX - Catalog API/Collection/folder.yml new file mode 100644 index 0000000000..a383c59c1a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Collection/folder.yml @@ -0,0 +1,4 @@ +info: + name: Collection + type: folder + seq: 27 diff --git a/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get all commercial conditions.yml b/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get all commercial conditions.yml new file mode 100644 index 0000000000..4c333266a4 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get all commercial conditions.yml @@ -0,0 +1,95 @@ +info: + name: Get all commercial conditions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/commercialcondition/list" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/list - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/list - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/list - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with information of the commercial condition.","properties":{"Id":{"type":"integer","description":"Commercial condition ID."},"Name":{"type":"string","description":"Commercial condition name."},"IsDefault":{"type":"boolean","description":"Defines if the commercial condition is default (`true`) or not (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all commercial conditions on the store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Name": "Standard", + "IsDefault": true + }, + { + "Id": 2, + "Name": "Secondary", + "IsDefault": false + }, + { + "Id": 3, + "Name": "Stallments 18x", + "IsDefault": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get commercial condition.yml b/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get commercial condition.yml new file mode 100644 index 0000000000..b29edac8f6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Commercial conditions/Get commercial condition.yml @@ -0,0 +1,88 @@ +info: + name: Get commercial condition + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/commercialcondition/:commercialConditionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: commercialConditionId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/:commercialConditionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/:commercialConditionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/:commercialConditionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/commercialcondition/:commercialConditionId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information of the commercial condition.","properties":{"Id":{"type":"integer","description":"Commercial condition ID."},"Name":{"type":"string","description":"Commercial condition name."},"IsDefault":{"type":"boolean","description":"Defines if the commercial condition is default (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a commercial condition by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `commercialConditionId` | path | (Required) Commercial condition unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "Name": "Default", + "IsDefault": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Commercial conditions/folder.yml b/BrunoCollections/VTEX - Catalog API/Commercial conditions/folder.yml new file mode 100644 index 0000000000..702f01278a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Commercial conditions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Commercial conditions + type: folder + seq: 41 diff --git a/BrunoCollections/VTEX - Catalog API/Gift list/Get gift list.yml b/BrunoCollections/VTEX - Catalog API/Gift list/Get gift list.yml new file mode 100644 index 0000000000..15742990df --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Gift list/Get gift list.yml @@ -0,0 +1,121 @@ +info: + name: Get gift list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/addon/pvt/giftlist/get/:listId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: listId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/addon/pvt/giftlist/get/:listId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/addon/pvt/giftlist/get/:listId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/addon/pvt/giftlist/get/:listId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/addon/pvt/giftlist/get/:listId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about the gift list.","properties":{"giftListId":{"type":"integer","description":"Gift list ID."},"name":{"type":"string","description":"Gift list name."},"userId":{"type":"string","description":"User ID."},"fileId":{"type":["integer","null"],"description":"File ID."},"giftListTypeId":{"type":"integer","description":"Gift list Type ID."},"giftListTypeName":{"type":"string","description":"Gift list Type name."},"giftCardId":{"type":"integer","description":"Gift card ID."},"message":{"type":"string","description":"Gift list message."},"urlFolder":{"type":"string","description":"Slug of the gift list that will be part of its URL."},"dateCreated":{"type":"string","description":"Date when the gift list was created."},"profileSystemUserAddressName":{"type":"string","description":"Name of the user's address."},"profileSystemUserId":{"type":"string","description":"User ID on Profile System."},"eventDate":{"type":"string","description":"Date of the event associated with the Gift list."},"eventLocation":{"type":"string","description":"Location of the event associated with the Gift list."},"eventCity":{"type":"string","description":"City of the event associated with the Gift list."},"eventState":{"type":"string","description":"State of the event associated with the Gift list."},"telemarketingId":{"type":["integer","null"],"description":"Telemarketing ID."},"telemarketingObservation":{"type":["string","null"],"description":"Telemarketing observation."},"IsPublic":{"type":"boolean","description":"Defines if the gift list is public."},"isActive":{"type":"boolean","description":"Defines if the gift list is active."},"shipsToOwner":{"type":"boolean","description":"Defines if items purchased from the gift list will be shipped to the owner of the gift list."},"isAddressOk":{"type":"boolean","description":"Validates the address of the gift list."},"version":{"type":"integer","description":"Version of the gift list."},"giftCardRechargeSkuId":{"type":["integer","null"],"description":"ID of the SKU that recharges the gift card."},"memberNames":{"type":"string","description":"Name of the members of the gift list."},"giftListMembers":{"type":"array","description":"Array of members of the gift list.","items":{"type":"object","description":"Object with information about each gift list member.","properties":{"giftListMemberId":{"type":"integer","description":"Gift list member ID."},"giftListId":{"type":"integer","description":"Gift list ID."},"userId":{"type":"string","description":"User ID."},"clientId":{"type":["string","null"],"description":"Client ID."},"title":{"type":["string","null"],"description":"Title of the Gift list member."},"name":{"type":"string","description":"Name of the Gift list member."},"surname":{"type":"string","description":"Surname of the Gift list member."},"isAdmin":{"type":"boolean","description":"Defines if the Gift list member is an administrator of the Gift list or not."},"isActive":{"type":"boolean","description":"Defines if the Gift list user is active or not."},"text1":{"type":["string","null"],"description":"Complementary text."},"text2":{"type":["string","null"],"description":"Complementary text."}}}},"giftListSkuIds":{"type":["array","null"],"description":"Array with the IDs of SKUs that are part of the gift list.","items":{"type":"string","description":"SKU ID."}},"address":{"type":["string","null"],"description":"Address of the gift list."},"fileUrl":{"type":["string","null"],"description":"File URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a gift list by its ID. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `listId` | path | (Required) Gift list unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "giftListId": 1, + "name": "My list", + "userId": "010956A4-A74A-4375-8B7B-3B3B7B89B483", + "clientId": 3, + "fileId": 155233, + "giftListTypeId": 1, + "giftListTypeName": "Weddingg list", + "giftCardId": 2, + "message": "This is a gift list for my wedding.", + "urlFolder": "myweddinglist", + "dateCreated": "2025-05-04T13:23:00", + "profileSystemUserAddressName": "HOME", + "profileSystemUserId": "010956A4-A74A-4375-8B7B-3B3B7B89B483", + "eventDate": "2025-06-21T00:00:00", + "eventLocation": "Barra da Tijuca", + "eventCity": "Rio de Janeiro", + "eventState": "RJ", + "telemarketingId": 1, + "telemarketingObservation": null, + "IsPublic": false, + "isActive": true, + "shipsToOwner": false, + "isAddressOk": true, + "version": 1, + "giftCardRechargeSkuId": 1, + "memberNames": "Rafael Villa-Verde", + "giftListMembers": [ + { + "giftListMemberId": 1, + "giftListId": 2, + "userId": "010956A4-A74A-4375-8B7B-3B3B7B89B483", + "clientId": null, + "title": null, + "name": "Rafael", + "surname": "Villa-Verde", + "isAdmin": true, + "isActive": true, + "text1": null, + "text2": null + } + ], + "giftListSkuIds": null, + "address": "Botafogo", + "fileUrl": "/file/ids/155233-800-800/gl-0_635266293044683588.jpg" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Gift list/folder.yml b/BrunoCollections/VTEX - Catalog API/Gift list/folder.yml new file mode 100644 index 0000000000..3edcb9ab22 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Gift list/folder.yml @@ -0,0 +1,4 @@ +info: + name: Gift list + type: folder + seq: 42 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU attribute translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU attribute translation by SKU ID.yml new file mode 100644 index 0000000000..9f498b2f84 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU attribute translation by SKU ID.yml @@ -0,0 +1,67 @@ +info: + name: Create or update SKU attribute translation by SKU ID + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + - name: skuAttributeId + value: "38" + type: path + body: + type: json + data: |- + { + "Id": 1, + "Locale": "en-US", + "AttributeName": "Size", + "AttributeValue": "38" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU attribute searching by SKU ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `skuAttributeId` | path | (Required) Unique identifier of the SKU attribute. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU file translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU file translation by SKU ID.yml new file mode 100644 index 0000000000..4cd48778da --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU file translation by SKU ID.yml @@ -0,0 +1,67 @@ +info: + name: Create or update SKU file translation by SKU ID + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + - name: skuFileId + value: "47" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Label": "Front view", + "Name": "Product image - front", + "Text": "Front of the tshirt" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU file searching by SKU ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `skuFileId` | path | (Required) Unique identifier of the SKU file. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU translation by SKU ID.yml new file mode 100644 index 0000000000..a6f08443df --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Create or update SKU translation by SKU ID.yml @@ -0,0 +1,62 @@ +info: + name: Create or update SKU translation by SKU ID + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Classic Blue T-Shirt - Size M", + "MeasurementUnit": "un" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU attribute translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU attribute translation by SKU ID.yml new file mode 100644 index 0000000000..c7ff28e3fc --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU attribute translation by SKU ID.yml @@ -0,0 +1,97 @@ +info: + name: Get SKU attribute translation by SKU ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + - name: skuAttributeId + value: "38" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU attribute.","properties":{"Id":{"type":"integer","description":"SKU specification attribute unique identifier."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"AttributeName":{"type":"string","description":"Translated SKU attribute name."},"AttributeValue":{"type":"string","description":"Translated SKU attribute value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a SKU attribute searching by SKU ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `skuAttributeId` | path | (Required) Unique identifier of the SKU attribute. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Locale": "en-US", + "AttributeName": "Size", + "AttributeValue": "38" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU file translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU file translation by SKU ID.yml new file mode 100644 index 0000000000..65f68d9d00 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU file translation by SKU ID.yml @@ -0,0 +1,99 @@ +info: + name: Get SKU file translation by SKU ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + - name: skuFileId + value: "47" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU file.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association between the SKU file and the SKU."},"FileId":{"type":["integer","null"],"description":"Unique identifier of the SKU file."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Label":{"type":["string","null"],"description":"Translated label for the SKU file."},"Text":{"type":["string","null"],"description":"Translated text description of the file."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a SKU file searching by SKU ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `skuFileId` | path | (Required) Unique identifier of the SKU file. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 459, + "FileId": null, + "Locale": "en-US", + "Label": "Front view", + "Name": "Product image - front", + "Text": "Front of the tshirt" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU translation by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU translation by SKU ID.yml new file mode 100644 index 0000000000..9242d96fd1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/Get SKU translation by SKU ID.yml @@ -0,0 +1,182 @@ +info: + name: Get SKU translation by SKU ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "35" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU.","properties":{"Id":{"type":"integer","description":"Unique identifier of the SKU."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the SKU."},"MeasurementUnit":{"type":"string","description":"Measurement unit for the SKU. The acceptables values are:\n\r- `un`: Unit\n\r- `kg`: Kilogram\n\r- `g`: Gram\n\r- `mg`: Milligram\n\r- `m`: Meter\n\r- `m²`: Square meter\n\r- `m³`: Cubic meter\n\r- `cm`: Centimeter\n\r- `cm²`: Square centimeter\n\r- `cm³`: Cubic centimeter\n\r- `mm`: Millimeter\n\r- `mm²`: Square millimeter\n\r- `mm³`: Cubic millimeter\n\r- `oz`: Ounce\n\r- `lb`: Pound\n\r- `ft`: Foot\n\r- `ft²`: Square foot\n\r- `ft³`: Cubic foot\n\r- `in`: Inch\n\r- `in²`: Square inch\n\r- `in³`: Cubic inch"},"Attributes":{"type":["array","null"],"description":"Array of SKU attributes translations.","items":{"type":["object","null"],"description":"Object containing language-specific information for a SKU attribute.","properties":{"Id":{"type":"integer","description":"SKU attribute ID."},"Locale":{"type":"string","description":"Locale code."},"AttributeName":{"type":"string","description":"SKU attribute name."},"AttributeValue":{"type":"string","description":"SKU attribute value."}}}},"Attachments":{"type":["array","null"],"description":"Array of SKU attachments translations.","items":{"type":["object","null"],"description":"Object containing language-specific information for a SKU attachment.","properties":{"Id":{"type":"integer","description":"SKU attachment ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU attachment name."},"Domains":{"type":"array","description":"Array with SKU attachment domains translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU attachment domain.","properties":{"OriginalFieldName":{"type":"string","description":"Domain original field name."},"FieldName":{"type":"string","description":"Domain field name."},"DomainValues":{"type":"string","description":"Domain values."}}}}}}},"Services":{"type":["array","null"],"description":"Array with SKU services translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU service.","properties":{"Id":{"type":"integer","description":"SKU service ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU service name."},"Text":{"type":"string","description":"SKU service text."},"SkuServiceType":{"type":"object","description":"Object with SKU service type translations.","properties":{"Id":{"type":"integer","description":"SKU service type ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU service type name."},"Values":{"type":"array","description":"Array with the SKU service type values translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU service type value.","properties":{"Id":{"type":"integer","description":"Service type value ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Service type value name."}}}},"Attachments":{"type":"array","description":"Array with the translations of the SKU service type attachments.","items":{"type":"object","description":"Object containing language-specific information for a SKU service type attachment.","properties":{"Id":{"type":"integer","description":"Attachment ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Attachment name."},"Domains":{"type":"array","description":"Array with the domains translations of the SKU service type attachment.","items":{"type":"object","description":"Object containing language-specific information for a domain of the SKU service type attachment.","properties":{"OriginalFieldName":{"type":"string","description":"Original field name."},"FieldName":{"type":"string","description":"Translated field name."},"DomainValues":{"type":"string","description":"Domain value."}}}}}}}}}}}},"SpecificationGroups":{"type":["array","null"],"description":"Array of the SKU specification groups translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU specification group.","properties":{"Id":{"type":"integer","description":"SKU specification group ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU specification group name."},"Specifications":{"type":"array","description":"Array of specifications translations of the SKU specification group.","items":{"type":"object","description":"Object containing language-specific information for specifications of the SKU specification group.","properties":{"Id":{"type":"integer","description":"Specification ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification name."},"Description":{"type":"string","description":"Specification description."},"Value":{"type":"array","description":"Array of specification values translations of the SKU specification group.","items":{"type":"object","description":"Object containing language-specific information for a SKU specification group value.","properties":{"Id":{"type":"integer","description":"Specification value ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification value name."},"IsCustomValue":{"type":"boolean","description":"Defines whether the specification value is custom (`true`) or not (`false`)."}}}}}}}}}},"Files":{"type":["array","null"],"description":"Array with SKU files translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU file.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association between the SKU and the file."},"FileId":{"type":"integer","description":"File ID."},"Locale":{"type":"string","description":"Locale code."},"Label":{"type":"string","description":"File label."},"Name":{"type":"string","description":"File name."},"Text":{"type":["string","null"],"description":"File text."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a SKU by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 21, + "Locale": "es-ES", + "Name": "Camiseta clásica azul", + "MeasurementUnit": "un", + "Attributes": [ + { + "Id": 17, + "Locale": "es-ES", + "AttributeName": "Color", + "AttributeValue": "Rojo" + } + ], + "Attachments": [ + { + "Id": 4, + "Locale": "es-ES", + "Name": "Customización", + "Domains": [ + { + "OriginalFieldName": "Customização", + "FieldName": "Customización", + "DomainValues": "Special" + } + ] + } + ], + "Services": [ + { + "Id": 8, + "Locale": "es-ES", + "Name": "Paquete de regalo", + "Text": "Paquete de regalo para dar como regalo", + "SkuServiceType": { + "Id": 34, + "Locale": "es-ES", + "Name": "Paquete pequeño", + "Values": [ + { + "Id": 1, + "Locale": "es-ES", + "Name": "Paquete premium" + } + ], + "Attachments": [ + { + "Id": 4, + "Locale": "es-ES", + "Name": "Escritura personalizada en la tarjeta de regalo", + "Domains": [ + { + "OriginalFieldName": "Tipografía moderna", + "FieldName": "Fuente moderna", + "DomainValues": "Arial" + } + ] + } + ] + } + } + ], + "SpecificationGroups": [ + { + "Id": 8, + "Locale": "es-ES", + "Name": "Ropa masculina", + "Specifications": [ + { + "Id": 36, + "Locale": "es-ES", + "Name": "Tipo de tejido", + "Description": "Tipos de tejido de los que está hecho el producto.", + "Values": [ + { + "Id": 146, + "Locale": "es-ES", + "Name": "Algodón, lana y tejidos sintéticos", + "IsCustomValue": false + } + ] + } + ] + } + ], + "Files": [ + { + "Id": 8, + "FileId": 197, + "Locale": "es-ES", + "Label": "vista-frontal", + "Name": "Vista frontal del producto", + "Text": null + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language SKU/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/folder.yml new file mode 100644 index 0000000000..0ecf7013ce --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language SKU/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language SKU + type: folder + seq: 34 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service translation.yml new file mode 100644 index 0000000000..418438c48c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service translation.yml @@ -0,0 +1,62 @@ +info: + name: Create or update SKU service translation + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservice/:skuserviceId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuserviceId + value: "10" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Extended warranty", + "Text": "1 year" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/skuservice/:skuserviceId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU service by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuserviceId` | path | (Required) Unique identifier of the SKU service. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service type translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service type translation.yml new file mode 100644 index 0000000000..3d0cc7b7b7 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service type translation.yml @@ -0,0 +1,61 @@ +info: + name: Create or update SKU service type translation + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeId + value: "1" + type: path + body: + type: json + data: |- + { + "Locale": "pt-BR", + "Name": "Garantia estendida" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU service type by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeId` | path | (Required) Unique identifier of the SKU service type. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service value translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service value translation.yml new file mode 100644 index 0000000000..5ecc3c500f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update SKU service value translation.yml @@ -0,0 +1,61 @@ +info: + name: Create or update SKU service value translation + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceValueId + value: "5" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Extended warranty 1 year" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a SKU service value by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceValueId` | path | (Required) Unique identifier of the SKU service value. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update attachment translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update attachment translation.yml new file mode 100644 index 0000000000..5b1e306283 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Create or update attachment translation.yml @@ -0,0 +1,61 @@ +info: + name: Create or update attachment translation + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/attachment/:attachmentId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentId + value: "19" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Customize your tshirt" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/attachment/:attachmentId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for an attachment by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentId` | path | (Required) Unique identifier of the attachment. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service translation.yml new file mode 100644 index 0000000000..0586e70713 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service translation.yml @@ -0,0 +1,94 @@ +info: + name: Get SKU service translation + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservice/:skuserviceId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuserviceId + value: "10" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservice/:skuserviceId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuserviceId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuserviceId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuserviceId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU service.","properties":{"Id":{"type":"integer","description":"Unique identifier of the SKU service."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the SKU service."},"Text":{"type":["string","null"],"description":"Translated description of the SKU service."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a given SKU service by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuserviceId` | path | (Required) Unique identifier of the SKU service. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 3, + "Locale": "en-US", + "Name": "Extended warranty", + "Text": "1 year", + "SkuServiceType": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service type translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service type translation.yml new file mode 100644 index 0000000000..533420e39e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service type translation.yml @@ -0,0 +1,94 @@ +info: + name: Get SKU service type translation + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeId + value: "1" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU service type.","properties":{"Id":{"type":"integer","description":"Unique identifier of the SKU service type."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the SKU service type."},"Values":{"type":["array","null"],"description":"List of values related to the SKU service type.","items":{"type":"string","description":"SKU service type value."}},"Attachments":{"type":["array","null"],"description":"List of attachments related to the SKU service type.","items":{"type":"string","description":"SKU service type attachment name."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a SKU service type by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeId` | path | (Required) Unique identifier of the SKU service type. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Locale": "pt-BR", + "Name": "Garantia estendida", + "Values": null, + "Attachments": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service value translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service value translation.yml new file mode 100644 index 0000000000..b7a317e9ff --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get SKU service value translation.yml @@ -0,0 +1,92 @@ +info: + name: Get SKU service value translation + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceValueId + value: "5" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a SKU service value.","properties":{"Id":{"type":"integer","description":"Unique identifier of the SKU service value."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the SKU service value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a SKU service value by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceValueId` | path | (Required) Unique identifier of the SKU service value. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Locale": "en-US", + "Name": "Extended warranty 1 year" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get attachment translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get attachment translation.yml new file mode 100644 index 0000000000..4270c14b68 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/Get attachment translation.yml @@ -0,0 +1,93 @@ +info: + name: Get attachment translation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/attachment/:attachmentId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentId + value: "19" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/attachment/:attachmentId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for an attachment.","properties":{"Id":{"type":"integer","description":"Unique identifier of the attachment."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the attachment."},"Domains":{"type":["array","null"],"description":"List of domains related to the attachment.","items":{"type":"string","description":"Attachment domain value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for an attachment by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentId` | path | (Required) Unique identifier of the attachment. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 2, + "Locale": "en-US", + "Name": "Customize your tshirt", + "Domains": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/folder.yml new file mode 100644 index 0000000000..c739530efd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language attachment and service/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language attachment and service + type: folder + seq: 38 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language brand/Create or update brand translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language brand/Create or update brand translation.yml new file mode 100644 index 0000000000..a0a2160e13 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language brand/Create or update brand translation.yml @@ -0,0 +1,65 @@ +info: + name: Create or update brand translation + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/brand/:brandId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "12" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Premium Apparel Co.", + "Text": "Leading manufacturer of premium clothing", + "Keywords": "premium, apparel, clothing, brand", + "SiteTitle": "Premium Apparel Co. | Quality Clothing", + "LinkId": "premium-apparel-co" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/brand/:brandId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a brand by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Unique identifier of the brand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language brand/Get brand translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language brand/Get brand translation.yml new file mode 100644 index 0000000000..2819a4da3f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language brand/Get brand translation.yml @@ -0,0 +1,96 @@ +info: + name: Get brand translation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/brand/:brandId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: brandId + value: "12" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/brand/:brandId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/brand/:brandId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a brand.","properties":{"Id":{"type":"integer","description":"Unique identifier of the brand."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the brand."},"Text":{"type":["string","null"],"description":"Translated text description of the brand."},"Keywords":{"type":["string","null"],"description":"Brand translated keywords for SEO."},"SiteTitle":{"type":["string","null"],"description":"Translated site title for the brand."},"LinkId":{"type":["string","null"],"description":"Translated URL-friendly identifier for the brand."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a brand by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `brandId` | path | (Required) Unique identifier of the brand. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Locale": "en-US", + "Name": "Premium Apparel Co.", + "Text": "Leading manufacturer of premium clothing", + "Keywords": "premium, apparel, clothing, brand", + "SiteTitle": "Premium Apparel Co. | Quality Clothing", + "LinkId": "premium-apparel-co" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language brand/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language brand/folder.yml new file mode 100644 index 0000000000..469af49126 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language brand/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language brand + type: folder + seq: 37 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language category/Create or update category translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language category/Create or update category translation.yml new file mode 100644 index 0000000000..cf86efcb8f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language category/Create or update category translation.yml @@ -0,0 +1,65 @@ +info: + name: Create or update category translation + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/category/:categoryId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "10" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Men's Clothing", + "Title": "Men's Clothing Fashion Store", + "Description": "Discover our collection of men's clothing", + "Keywords": "men, clothing, fashion, apparel", + "LinkId": "mens-clothing" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/category/:categoryId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a category by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Unique identifier of the category. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language category/Get category translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language category/Get category translation.yml new file mode 100644 index 0000000000..816862cf83 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language category/Get category translation.yml @@ -0,0 +1,96 @@ +info: + name: Get category translation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/category/:categoryId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "10" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/category/:categoryId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/category/:categoryId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a category.","properties":{"Id":{"type":"integer","description":"Unique identifier of the category."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the category."},"Title":{"type":["string","null"],"description":"Translated title of the category for SEO purposes."},"Description":{"type":["string","null"],"description":"Translated description of the category."},"Keywords":{"type":["string","null"],"description":"Category translated keywords for SEO."},"LinkId":{"type":["string","null"],"description":"Translated URL-friendly identifier for the category."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a given category. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Unique identifier of the category. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 12, + "Locale": "en-US", + "Name": "Men's Clothing", + "Title": "Men's Clothing Fashion Store", + "Description": "Discover our collection of men's clothing", + "Keywords": "men, clothing, fashion, apparel", + "LinkId": "mens-clothing" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language category/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language category/folder.yml new file mode 100644 index 0000000000..c84ae1ce3e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language category/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language category + type: folder + seq: 36 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language collection/Create or update collection translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language collection/Create or update collection translation.yml new file mode 100644 index 0000000000..322c1c00c6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language collection/Create or update collection translation.yml @@ -0,0 +1,63 @@ +info: + name: Create or update collection translation + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "7" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Summer Collection", + "Description": "Discover our latest summer styles", + "LinkId": "summer-collection" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/collection/:collectionId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a collection by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Unique identifier of the collection. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language collection/Get collection translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language collection/Get collection translation.yml new file mode 100644 index 0000000000..59fc35d3dc --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language collection/Get collection translation.yml @@ -0,0 +1,94 @@ +info: + name: Get collection translation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "7" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a collection.","properties":{"Id":{"type":"integer","description":"Unique identifier of the collection."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the collection."},"Description":{"type":["string","null"],"description":"Translated description of the collection."},"LinkId":{"type":["string","null"],"description":"Translated URL-friendly identifier for the collection."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a collection by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Unique identifier of the collection. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1139, + "Locale": "en-US", + "Name": "Summer Collection", + "Description": "Discover our latest summer styles", + "LinkId": "summer-collection" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language collection/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language collection/folder.yml new file mode 100644 index 0000000000..810c7e6466 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language collection/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language collection + type: folder + seq: 39 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification group translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification group translation.yml new file mode 100644 index 0000000000..067a58df88 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification group translation.yml @@ -0,0 +1,61 @@ +info: + name: Create or update specification group translation + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specificationgroup/:specificationGroupId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationGroupId + value: "11" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Product Specifications" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/specificationgroup/:specificationGroupId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a specification group by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationGroupId` | path | (Required) Unique identifier of the specification group. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification translation.yml new file mode 100644 index 0000000000..49a24c31f4 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification translation.yml @@ -0,0 +1,62 @@ +info: + name: Create or update specification translation + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specification/:specificationId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationId + value: "7" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Color", + "Description": "Navy blue" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/specification/:specificationId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a specification by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationId` | path | (Required) Unique identifier of the specification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification value translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification value translation.yml new file mode 100644 index 0000000000..b0260fc572 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Create or update specification value translation.yml @@ -0,0 +1,61 @@ +info: + name: Create or update specification value translation + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specificationvalue/:valueId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: valueId + value: "15" + type: path + body: + type: json + data: |- + { + "Locale": "es-ES", + "Name": "Talla grande" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/specificationvalue/:valueId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a specification value by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `valueId` | path | (Required) Unique identifier of the specification value. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification group translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification group translation.yml new file mode 100644 index 0000000000..5de104f561 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification group translation.yml @@ -0,0 +1,93 @@ +info: + name: Get specification group translation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specificationgroup/:specificationGroupId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationGroupId + value: "11" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specificationgroup/:specificationGroupId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specificationgroup/:specificationGroupId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specificationgroup/:specificationGroupId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specificationgroup/:specificationGroupId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a specification group.","properties":{"Id":{"type":"integer","description":"Unique identifier of the specification group."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated specification group name."},"Specifications":{"type":["array","null"],"description":"List of translated specifications group values.","items":{"type":"string","description":"Specification group value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a specification group by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationGroupId` | path | (Required) Unique identifier of the specification group. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Locale": "en-US", + "Name": "Fabric", + "Specifications": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification translation.yml new file mode 100644 index 0000000000..adba9da9f2 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification translation.yml @@ -0,0 +1,94 @@ +info: + name: Get specification translation + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specification/:specificationId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationId + value: "7" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specification/:specificationId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a specification.","properties":{"Id":{"type":"integer","description":"Unique identifier of the specification."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the specification."},"Description":{"type":["string","null"],"description":"Translated description of the specification."},"Values":{"type":["array","null"],"description":"List of the translated specification values.","items":{"type":"string","description":"Translated specification value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a specification by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationId` | path | (Required) Unique identifier of the specification. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 59, + "Locale": "en-US", + "Name": "Color", + "Description": "Navy blue", + "Values": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification value translation.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification value translation.yml new file mode 100644 index 0000000000..8586064a1b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/Get specification value translation.yml @@ -0,0 +1,93 @@ +info: + name: Get specification value translation + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specificationvalue/:valueId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: valueId + value: "15" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specificationvalue/:valueId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:valueId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:valueId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:valueId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a specification value.","properties":{"Id":{"type":"integer","description":"Unique identifier of the specification value."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the specification value."},"IsCustomValue":{"type":["boolean","null"],"description":"Indicates wether the value is a customization (`true`) or not (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a specification value by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `valueId` | path | (Required) Unique identifier of the specification value. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 60, + "Locale": "es-ES", + "Name": "Talla grande", + "IsCustomValue": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language specification/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language specification/folder.yml new file mode 100644 index 0000000000..5c3fc50902 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language specification + type: folder + seq: 35 diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product specification translation by product ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product specification translation by product ID.yml new file mode 100644 index 0000000000..2a5e869c73 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product specification translation by product ID.yml @@ -0,0 +1,68 @@ +info: + name: Create or update product specification translation by product ID + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/products/:productId/specification/:specificationId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "18" + type: path + - name: specificationId + value: "7" + type: path + body: + type: json + data: |- + { + "ProductId": 2, + "SpecificationId": 23, + "Locale": "pt-BR", + "Value": "100% Algodão", + "Values": null + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/products/:productId/specification/:specificationId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a given product specification searching by product ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Unique identifier of the product. | + | `specificationId` | path | (Required) Unique identifier of the specification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product translation by product ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product translation by product ID.yml new file mode 100644 index 0000000000..7405be2ffb --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language/Create or update product translation by product ID.yml @@ -0,0 +1,67 @@ +info: + name: Create or update product translation by product ID + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/language" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "18" + type: path + body: + type: json + data: |- + { + "Locale": "en-US", + "Name": "Classic Blue T-Shirt", + "Title": "Classic Blue Tshirt", + "Description": "A comfortable cotton t-shirt in classic blue color", + "MetaTagDescription": "Buy the best classic blue t-shirt made with premium cotton", + "DescriptionShort": "Comfortable cotton t-shirt", + "Keywords": "t-shirt, blue, cotton, casual", + "LinkId": "classic-blue-tshirt" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/product/:productId/language - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts or updates language-specific information for a product by its ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Unique identifier of the product. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language/Get product specification translation by product ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language/Get product specification translation by product ID.yml new file mode 100644 index 0000000000..44316736a6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language/Get product specification translation by product ID.yml @@ -0,0 +1,99 @@ +info: + name: Get product specification translation by product ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/products/:productId/specification/:specificationId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "18" + type: path + - name: specificationId + value: "7" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/products/:productId/specification/:specificationId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/products/:productId/specification/:specificationId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/products/:productId/specification/:specificationId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/products/:productId/specification/:specificationId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a product specification.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association between the specification and the product."},"ProductId":{"type":"integer","description":"Product unique identifier."},"SpecificationId":{"type":"integer","description":"Specification unique identifier."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Value":{"type":"string","description":"Translated value of the product specification."},"Values":{"type":["array","null"],"description":"List of the translated product specification values. Valid for combo, radio and checkbox specification types; nullable for text, multi-line text, number, indexed text and indexed multi-line text specification types.","items":{"type":"string","description":"Translated product specification value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a product specification searching by product ID. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Unique identifier of the product. | + | `specificationId` | path | (Required) Unique identifier of the specification. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 349, + "ProductId": 10, + "SpecificationId": 23, + "Locale": "en-US", + "Value": "100% Cotton", + "Values": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language/Get product translation by product ID.yml b/BrunoCollections/VTEX - Catalog API/Multi-language/Get product translation by product ID.yml new file mode 100644 index 0000000000..33c024633b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language/Get product translation by product ID.yml @@ -0,0 +1,86 @@ +info: + name: Get product translation by product ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/language/:locale" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "18" + type: path + - name: locale + value: en-US + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/product/:productId/language/:locale - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/language/:locale - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/language/:locale - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/product/:productId/language/:locale - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing language-specific information for a product.","properties":{"Id":{"type":"integer","description":"Product unique identifier."},"Locale":{"type":"string","description":"The locale code for this translation. It follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil)."},"Name":{"type":"string","description":"Translated name of the product."},"Description":{"type":["string","null"],"description":"Translated description of the product."},"Title":{"type":["string","null"],"description":"Translated title of the product."},"MetaTagDescription":{"type":["string","null"],"description":"Translated meta tag description for SEO."},"DescriptionShort":{"type":["string","null"],"description":"Translated short description of the product."},"Keywords":{"type":"string","description":"Product translated keywords for SEO."},"LinkId":{"type":["string","null"],"description":"Translated URL-friendly identifier for the product."},"Category":{"type":"object","description":"Main category translation information.","properties":{"Id":{"type":"integer","description":"Category ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Category name."},"Title":{"type":"string","description":"Category title."},"Description":{"type":"string","description":"Category description."},"Keywords":{"type":"string","description":"Category keywords."},"LinkId":{"type":"string","description":"Category link ID."}}},"Categories":{"type":"array","description":"Array of subcategories translations, when applicable.","items":{"type":"object","description":"Object containing language-specific information for a subcategory.","properties":{"Id":{"type":"integer","description":"Subcategory ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Subcategory name."},"Title":{"type":"string","description":"Subcategory title."},"Description":{"type":"string","description":"Subcategory description."},"Keywords":{"type":"string","description":"Subcategory keywords."},"LinkId":{"type":["string","null"],"description":"Subcategory link ID."}}}},"SimilarCategories":{"type":["array","null"],"description":"Array with similar categories translations.","items":{"type":"object","description":"Object containing language-specific information for a similar category.","properties":{"Id":{"type":"integer","description":"Similar category ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Similar category name."},"Title":{"type":"string","description":"Similar category title."},"Description":{"type":"string","description":"Similar category description."},"Keywords":{"type":"string","description":"Similar category keywords."},"LinkId":{"type":"string","description":"Similar category link ID."}}}},"Brand":{"type":["object","null"],"description":"Object containing language-specific information for a brand.","properties":{"Id":{"type":"integer","description":"Brand ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Brand name."},"Text":{"type":"string","description":"Brand text."},"Keywords":{"type":"string","description":"Brand keywords."},"SiteTitle":{"type":"string","description":"Brand site title."},"LinkId":{"type":"string","description":"Brand link ID."}}},"Skus":{"type":"array","description":"List of SKUs translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU.","properties":{"Id":{"type":"integer","description":"SKU ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU name."},"MeasurementUnit":{"type":"string","description":"SKU measurement unit."},"Attributes":{"type":["array","null"],"description":"Array of SKU attributes translations.","items":{"type":["object","null"],"description":"Object containing language-specific information for a SKU attribute.","properties":{"Id":{"type":"integer","description":"SKU attribute ID."},"Locale":{"type":"string","description":"Locale code."},"AttributeName":{"type":"string","description":"SKU attribute name."},"AttributeValue":{"type":"string","description":"SKU attribute value."}}}},"Attachments":{"type":["array","null"],"description":"Array of SKU attachments translations.","items":{"type":["object","null"],"description":"Object containing language-specific information for a SKU attachment.","properties":{"Id":{"type":"integer","description":"SKU attachment ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU attachment name."},"Domains":{"type":"array","description":"Array with SKU attachment domains translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU attachment domain.","properties":{"OriginalFieldName":{"type":"string","description":"Domain original field name."},"FieldName":{"type":"string","description":"Domain field name."},"DomainValues":{"type":"string","description":"Domain values."}}}}}}},"Services":{"type":["array","null"],"description":"Array with SKU services translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU service.","properties":{"Id":{"type":"integer","description":"SKU service ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU service name."},"Text":{"type":"string","description":"SKU service text."},"SkuServiceType":{"type":"object","description":"Object with SKU service type translations.","properties":{"Id":{"type":"integer","description":"SKU service type ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU service type name."},"Values":{"type":"array","description":"Array with the SKU service type values translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU service type value.","properties":{"Id":{"type":"integer","description":"Service type value ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Service type value name."}}}},"Attachments":{"type":"array","description":"Array with the translations of the SKU service type attachments.","items":{"type":"object","description":"Object containing language-specific information for a SKU service type attachment.","properties":{"Id":{"type":"integer","description":"Attachment ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Attachment name."},"Domains":{"type":"array","description":"Array with the domains translations of the SKU service type attachment.","items":{"type":"object","description":"Object containing language-specific information for a domain of the SKU service type attachment.","properties":{"OriginalFieldName":{"type":"string","description":"Original field name."},"FieldName":{"type":"string","description":"Translated field name."},"DomainValues":{"type":"string","description":"Domain value."}}}}}}}}}}}},"SpecificationGroups":{"type":["array","null"],"description":"Array of the SKU specification groups translations.","items":{"type":["object","null"],"description":"Object containing language-specific information for a SKU specification group.","properties":{"Id":{"type":"integer","description":"SKU specification group ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"SKU specification group name."},"Specifications":{"type":"array","description":"Array of specifications translations of the SKU specification group.","items":{"type":"object","description":"Object containing language-specific information for specifications of the SKU specification group.","properties":{"Id":{"type":"integer","description":"Specification ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification name."},"Description":{"type":"string","description":"Specification description."},"Value":{"type":"array","description":"Array of specification values translations of the SKU specification group.","items":{"type":"object","description":"Object containing language-specific information for a SKU specification group value.","properties":{"Id":{"type":"integer","description":"Specification value ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification value name."},"IsCustomValue":{"type":"boolean","description":"Defines whether the specification value is custom (`true`) or not (`false`)."}}}}}}}}}},"Files":{"type":["array","null"],"description":"Array with SKU files translations.","items":{"type":"object","description":"Object containing language-specific information for a SKU file.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association between the SKU and the file."},"FileId":{"type":"integer","description":"File ID."},"Locale":{"type":"string","description":"Locale code."},"Label":{"type":"string","description":"File label."},"Name":{"type":"string","description":"File name."},"Text":{"type":["string","null"],"description":"File text."}}}}}}},"SpecificationGroups":{"type":["array","null"],"description":"Array with the product specification groups translations.","items":{"type":"object","description":"Object containing language-specific information for a product specification group.","properties":{"Id":{"type":"integer","description":"Product specification group ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Product specification group name."},"Specifications":{"type":"array","description":"Array with the specifications translations of the product specification group.","items":{"type":"object","description":"Object containing language-specific information for a specification of the product specification group.","properties":{"Id":{"type":"integer","description":"Specification ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification name."},"Description":{"type":"string","description":"Specification description."},"Values":{"type":"array","description":"Array with the specification values of the product specification group.","items":{"type":"object","description":"Object containing language-specific information for a specification value of the product specification group.","properties":{"Id":{"type":"integer","description":"Specification value ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Specification value name."},"IsCustomValue":{"type":"boolean","description":"Defines whether the specification value is custom (`true`) or not (`false`)."}}}}}}}}}},"Collections":{"type":"array","description":"Array with the product collections translations.","items":{"type":"object","description":"Object containing language-specific information for a collection.","properties":{"Id":{"type":"integer","description":"Collection ID."},"Locale":{"type":"string","description":"Locale code."},"Name":{"type":"string","description":"Collection name."},"Description":{"type":"string","description":"Collection description."},"LinkId":{"type":["string","null"],"description":"Collection link ID."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves language-specific information for a product and its associated entities, including categories, brand information, and specifications. Only fields and entities that have valid translations in the requested language are returned. + + To get translations for a given language, you can filter results using the `locale` query parameter. + + > ℹ️ Learn more in the [Catalog multi-language integration guide](https://developers.vtex.com/docs/guides/catalog-multi-language-integration-guide). + + ## Permissions + + Any 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: + + | **Product** | **Category** | **Resource** | + | - | - | - | + | Catalog | Content | Categories Management | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Unique identifier of the product. | + | `locale` | path | (Required) Code used to filter translations by a given language. The format follows the IETF BCP 47 standard, such as 'en-US' for English (United States), 'en-ES' for Spanish (Spain), or 'pt-BR' for Portuguese (Brazil). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Catalog API/Multi-language/folder.yml b/BrunoCollections/VTEX - Catalog API/Multi-language/folder.yml new file mode 100644 index 0000000000..2859a19e8a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Multi-language/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multi-language + type: folder + seq: 33 diff --git a/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification by SKU ID.yml new file mode 100644 index 0000000000..1074b48b31 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification by SKU ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete non-structured specification by SKU ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/specification/nonstructured?skuId=1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/specification/nonstructured - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes unmapped specifications of a seller'S SKU in a marketplace by SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | query | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification.yml b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification.yml new file mode 100644 index 0000000000..6509437018 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Delete non-structured specification.yml @@ -0,0 +1,56 @@ +info: + name: Delete non-structured specification + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/specification/nonstructured/:Id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: Id + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/specification/nonstructured/:Id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes unmapped specifications of a seller'S SKU in a marketplace by its unique ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Id` | path | (Required) Non-structured specification's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by ID.yml b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by ID.yml new file mode 100644 index 0000000000..e3ccdc8335 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by ID.yml @@ -0,0 +1,91 @@ +info: + name: Get non-structured specification by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specification/nonstructured/:Id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: Id + value: "1010" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specification/nonstructured/:Id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured/:Id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured/:Id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured/:Id - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with non-structured specification details.","properties":{"Id":{"type":"integer","description":"Non-structured specification's unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the non-structured specification."},"SpecificationValue":{"type":"string","description":"Value of the non-structured specification."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about unmapped specifications of a seller's SKU in a Marketplace. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Id` | path | (Required) Non-structured specification's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1010, + "SkuId": 310119072, + "SpecificationName": "size", + "SpecificationValue": "Small" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by SKU ID.yml new file mode 100644 index 0000000000..d212dba79f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Non-structured specification/Get non-structured specification by SKU ID.yml @@ -0,0 +1,91 @@ +info: + name: Get non-structured specification by SKU ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specification/nonstructured?skuId=1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specification/nonstructured - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specification/nonstructured - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Non-structured specification details.","properties":{"Id":{"type":"integer","description":"Non-structured specification's unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the non-structured specification."},"SpecificationValue":{"type":"string","description":"Value of the non-structured specification."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets general information about unmapped specifications of a seller's SKU in a marketplace by SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | query | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1010, + "SkuId": 310119072, + "SpecificationName": "size", + "SpecificationValue": "Small" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Non-structured specification/folder.yml b/BrunoCollections/VTEX - Catalog API/Non-structured specification/folder.yml new file mode 100644 index 0000000000..73ae3c5f3f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Non-structured specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Non-structured specification + type: folder + seq: 18 diff --git a/BrunoCollections/VTEX - Catalog API/Product indexing/Get product indexed information.yml b/BrunoCollections/VTEX - Catalog API/Product indexing/Get product indexed information.yml new file mode 100644 index 0000000000..08496e3227 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product indexing/Get product indexed information.yml @@ -0,0 +1,91 @@ +info: + name: Get product indexed information + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/products/GetIndexedInfo/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/xml + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/catalog_system/pvt/products/GetIndexedInfo/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/products/GetIndexedInfo/:productId - Content-Type is application/xml", function () { + expect(String(res.getHeader("content-type"))).to.include("application/xml"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves product indexed data in `XML` format searching by product ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```xml + + + + + true + 0 + 1 + + * + + instanceId:394dbdc8-b1f4-4dea-adfa-1ec104f3bfe1 + productId:310117603 + + + + + + + + + + + + + + + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product indexing/folder.yml b/BrunoCollections/VTEX - Catalog API/Product indexing/folder.yml new file mode 100644 index 0000000000..d9774b9705 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product indexing/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product indexing + type: folder + seq: 40 diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification using specification name and group name.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification using specification name and group name.yml new file mode 100644 index 0000000000..e03b03862c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification using specification name and group name.yml @@ -0,0 +1,104 @@ +info: + name: Associate product specification using specification name and group name + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + body: + type: json + data: |- + { + "FieldName": "Material", + "GroupName": "Composition", + "RootLevelSpecification": true, + "FieldValues": [ + "Cotton", + "Polyester" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/product/:productId/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/product/:productId/specificationvalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/product/:productId/specificationvalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/product/:productId/specificationvalue - Schema is valid", function () { + const schema = {"type":"array","description":"Array with information of all product specifications.","items":{"type":"object","description":"Object with information of the specification.","properties":{"Id":{"type":"integer","description":"ID of the association of the product and the specification."},"ProductId":{"type":"integer","description":"Product ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Current specification value ID."},"Text":{"type":"string","description":"Current specification value text."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a specification to a product using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 239, + "ProductId": 1, + "FieldId": 85, + "FieldValueId": 193, + "Text": "Value123" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification.yml new file mode 100644 index 0000000000..8ab8a7aeaf --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Associate product specification.yml @@ -0,0 +1,97 @@ +info: + name: Associate product specification + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + body: + type: json + data: |- + { + "FieldId": 19, + "FieldValueId": 12, + "Text": "Metal" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/product/:productId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/product/:productId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/product/:productId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/product/:productId/specification - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"ID of the association of the specification and the product. This ID is used to update or delete the specification."},"ProductId":{"type":"integer","description":"Product ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Specification value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types."},"Text":{"type":"string","description":"Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a previously defined specification to a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 41, + "FieldId": 19, + "FieldValueId": 1, + "Text": "test" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Delete a product specification.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Delete a product specification.yml new file mode 100644 index 0000000000..eecbf56dbc --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Delete a product specification.yml @@ -0,0 +1,60 @@ +info: + name: Delete a product specification + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/specification/:specificationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + - name: specificationId + value: "7" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/product/:productId/specification/:specificationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a product specification given a product ID (`productId`) and a specification ID (`specificationId`). For specifications with predefined values (such as radio, checkbox, or combo), you must use the specification field ID (`specificationFieldId`) instead. Otherwise, the request will return a `404 Not Found` status code. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `specificationId` | path | (Required) Product specification's unique numerical identifier. For radio, checkbox, or combo specifications, use the specification field ID (`specificationFieldId`) instead. You can retrieve these values using the endpoint [Get product specifications and their information by product ID](https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog/pvt/product/-productId-/specification). They correspond to the `Id` and `FieldId` values, respectively. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Delete all product specifications by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Delete all product specifications by product ID.yml new file mode 100644 index 0000000000..c19629973c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Delete all product specifications by product ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete all product specifications by product ID + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/product/:productId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all product specifications given a specific product ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications and their information by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications and their information by product ID.yml new file mode 100644 index 0000000000..801df837a6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications and their information by product ID.yml @@ -0,0 +1,99 @@ +info: + name: Get product specifications and their information by product ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/product/:productId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/product/:productId/specification - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with the product specification information.","properties":{"Id":{"type":"integer","description":"ID of the association of the specification and the product. This ID is used to update or delete the specification."},"ProductId":{"type":"integer","description":"Product ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Current specification value ID."},"Text":{"type":"string","description":"Current specification value text."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of all specifications of a product by the product's ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 227, + "ProductId": 1, + "FieldId": 33, + "FieldValueId": 135, + "Text": "ValueA" + }, + { + "Id": 228, + "ProductId": 1, + "FieldId": 34, + "FieldValueId": 1, + "Text": "Giant" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications by product ID.yml new file mode 100644 index 0000000000..657ff586c9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Get product specifications by product ID.yml @@ -0,0 +1,96 @@ +info: + name: Get product specifications by product ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/products/:productId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/products/:productId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/products/:productId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/products/:productId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/products/:productId/specification - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["Value"],"type":"object","description":"Object with specification values information.","properties":{"Value":{"type":"array","description":"Array with specification values.","items":{"type":"string","description":"Specification value."}},"Id":{"type":"integer","description":"Specification field ID, which is the same as `FieldId` in other specification endpoints."},"Name":{"type":"string","description":"Name of the specification."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all specifications of a product by the product's ID. + > 📘 Onboarding guide + > + > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Value": [ + "Iron", + "Plastic" + ], + "Id": 30, + "Name": "Material" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/Update product specification by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product specification/Update product specification by product ID.yml new file mode 100644 index 0000000000..297b6cd88d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/Update product specification by product ID.yml @@ -0,0 +1,77 @@ +info: + name: Update product specification by product ID + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/products/:productId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + body: + type: json + data: |- + [ + { + "Value": [ + "Cotton", + "Cotton" + ], + "Id": 7, + "Name": "Fabric" + }, + { + "Value": [ + "Cotton", + "Cotton" + ], + "Id": 7, + "Name": "Fabric" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog_system/pvt/products/:productId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the value of a product specification by the product's ID. The specification's ID or name can be used to identify what product specification will be updated. specification fields must be previously created in your Catalog. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Product specification/folder.yml b/BrunoCollections/VTEX - Catalog API/Product specification/folder.yml new file mode 100644 index 0000000000..15544bb57d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product specification + type: folder + seq: 9 diff --git a/BrunoCollections/VTEX - Catalog API/Product/Create product with category and brand.yml b/BrunoCollections/VTEX - Catalog API/Product/Create product with category and brand.yml new file mode 100644 index 0000000000..373b0dc99d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Create product with category and brand.yml @@ -0,0 +1,132 @@ +info: + name: Create product with category and brand + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/product" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Id": 42, + "Name": "Black T-Shirt", + "CategoryPath": "Mens/Clothing/T-Shirts", + "DepartmentId": 1, + "BrandName": "Acme", + "RefId": "31011706925", + "Title": "Black T-Shirt", + "LinkId": "tshirt-black", + "Description": "A classic black t-shirt made from soft, breathable cotton", + "ReleaseDate": "2025-07-01T00:00:00", + "IsVisible": true, + "IsActive": true, + "TaxCode": "12345", + "MetaTagDescription": "tshirt black", + "ShowWithoutStock": true, + "LomadeeCampaignCode": null, + "Score": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/product - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/product - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/product - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/product - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Product's unique numerical identifier."},"Name":{"type":"string","description":"Product's name. Limited to 150 characters."},"DepartmentId":{"type":"integer","description":"Department ID according to the product's category."},"CategoryId":{"type":"integer","description":"Category ID associated with this product."},"BrandId":{"type":"integer","description":"Brand ID associated with this product."},"LinkId":{"type":"string","description":"Slug that will be used to build the product page URL. If it not informed, it will be generated according to the product's name replacing spaces and special characters by hyphens (`-`)."},"RefId":{"type":"string","description":"Product Reference Code."},"IsVisible":{"type":"boolean","description":"Shows (`true`) or hides (`false`) the product in search result and product pages, but the product can still be added to the shopping cart. Usually applicable for gifts."},"Description":{"type":"string","description":"Product description."},"DescriptionShort":{"type":"string","description":"Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``."},"ReleaseDate":{"type":"string","description":"Used to assist in the ordering of the search result of the site. Using the `O=OrderByReleaseDateDESC` query string, you can pull this value and show the display order by release date. This attribute is also used as a condition for dynamic collections."},"KeyWords":{"type":"string","description":"Store Framework: Deprecated. \r\nLegacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). \"Television\", for example, can have a substitute word like \"TV\". This field is important to make your searches more comprehensive."},"Title":{"type":"string","description":"Product's title tag, which corresponds to the title of the product page, presented in the browser tab. This field is important for SEO. Limited to 150 characters."},"IsActive":{"type":"boolean","description":"Activate (`true`) or inactivate (`false`) product."},"TaxCode":{"type":"string","description":"Product tax code, used for tax calculation."},"MetaTagDescription":{"type":"string","description":"Brief description of the product for SEO. It's recommended that you don't exceed 150 characters."},"SupplierId":{"type":["integer","null"],"description":"Supplier unique identifier."},"ShowWithoutStock":{"type":"boolean","description":"If `true`, activates the [Notify Me](https://help.vtex.com/en/tutorial/setting-up-the-notify-me-option--2VqVifQuf6Co2KG048Yu6e) option when the product is out of stock."},"AdWordsRemarketingCode":{"type":["string","null"],"description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":["string","null"],"description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":"integer","description":"Value used to set the priority on the search result page."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows two types of request: + + **Type 1:** Creating a new product as well as a new category path (including subcategories) and a new brand by using `CategoryPath` and `BrandName` parameters. + + **Type 2:** Creating a new product given an existing `BrandId` and an existing `CategoryId`. + + When creating a product, regardless of the type of request, if there is a need to create a new product with a specific custom product ID, specify the `Id` (integer) in the request body. Otherwise, VTEX will generate the ID automatically. + > 📘 Onboarding guide + > + > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 42, + "Name": "Black T-Shirt", + "DepartmentId": 1, + "CategoryId": 2, + "BrandId": 2000000, + "LinkId": "premium-tshirt-cotton", + "RefId": "310117869", + "IsVisible": true, + "Description": "A classic black t-shirt made from soft, breathable cotton", + "DescriptionShort": "Great premium cotton t-shirt", + "ReleaseDate": "2025-07-01T00:00:00", + "KeyWords": "Blouse", + "Title": "Premium black t-shirt", + "IsActive": true, + "TaxCode": "12345", + "MetaTagDescription": "Very cool t-shirt for sports", + "SupplierId": 1, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": null, + "LomadeeCampaignCode": null, + "Score": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product and SKU IDs.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product and SKU IDs.yml new file mode 100644 index 0000000000..fce27ff1cc --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product and SKU IDs.yml @@ -0,0 +1,154 @@ +info: + name: Get product and SKU IDs + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/products/GetProductAndSkuIds" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "1" + type: query + disabled: true + - name: _from + value: "1" + type: query + disabled: true + - name: _to + value: "10" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/products/GetProductAndSkuIds - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/products/GetProductAndSkuIds - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/products/GetProductAndSkuIds - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/products/GetProductAndSkuIds - Schema is valid", function () { + const schema = {"type":"object","properties":{"data":{"type":"object","description":"Object composed of product IDs and SKU IDs, where the parent ID is from products and the children IDs are from SKUs.","properties":{"Product ID":{"type":"array","description":"Array with SKU IDs of a certain product.","items":{"type":"integer","description":"Product SKU ID."}}}},"range":{"type":"object","description":"Object with information about the product and SKUs list.","properties":{"total":{"type":"integer","description":"Total quantity of products."},"from":{"type":"integer","description":"Initial product ID."},"to":{"type":"integer","description":"Final product ID."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the IDs of products and SKUs. + + >⚠️ The response body is limited to 250 records, but you can use the query params `_from` and `_to`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | query | ID of the category from which you need to retrieve products and SKUs. | + | `_from` | query | Insert the ID that will start the request result. | + | `_to` | query | Insert the ID that will end the request result. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": { + "1": [ + 1, + 123456, + 310118449, + 310118489, + 7, + 2 + ], + "2": [ + 3, + 310118450, + 310118451, + 4, + 8 + ], + "3": [ + 5 + ], + "4": [ + 310118448 + ], + "5": [ + 310118465 + ], + "6": [], + "7": [ + 310118452 + ], + "8": [ + 310118453, + 310118459, + 310118463 + ], + "9": [ + 310118454, + 310118455, + 310118456, + 310118457, + 310118458, + 310118460, + 310118461, + 310118462, + 310118464 + ], + "10": [], + "11": [], + "12": [ + 310118490 + ] + }, + "range": { + "total": 12, + "from": 1, + "to": 20 + } + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product and its general context.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product and its general context.yml new file mode 100644 index 0000000000..1411930c23 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product and its general context.yml @@ -0,0 +1,110 @@ +info: + name: Get product and its general context + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/products/productget/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/products/productget/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/products/productget/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/products/productget/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/products/productget/:productId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Product ID."},"Name":{"type":"string","description":"Product's name. Limited to 150 characters."},"DepartmentId":{"type":"integer","description":"Product department ID."},"CategoryId":{"type":"integer","description":"Product category ID."},"BrandId":{"type":"integer","description":"Product brand ID."},"LinkId":{"type":"string","description":"Product text link."},"RefId":{"type":"string","description":"Product reference code."},"IsVisible":{"type":"boolean","description":"If the product is visible on the store."},"Description":{"type":"string","description":"Product description."},"DescriptionShort":{"type":"string","description":"Product complement name."},"ReleaseDate":{"type":"string","description":"Product release date."},"KeyWords":{"type":"string","description":"Substitutes words for the product."},"Title":{"type":"string","description":"Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"IsActive":{"type":"boolean","description":"If the product is active (`true`) or not (`false`) at the store."},"TaxCode":{"type":"string","description":"Product fiscal code."},"MetaTagDescription":{"type":"string","description":"Product meta tag description."},"SupplierId":{"type":"integer","description":"Product supplier ID."},"ShowWithoutStock":{"type":"boolean","description":"Defines if the product will be shown in the store even if it's out of stock (`true`) or not (`false`)."},"ListStoreId":{"type":"array","description":"List with the IDs of sales channels where the product is included.","items":{"type":"integer","description":"Sales channel ID."}},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific product's general information as name, description and the sales channels where it is included. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product Form** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "Name": "Ração Royal Canin Feline Urinary", + "DepartmentId": 1, + "CategoryId": 10, + "BrandId": 2000000, + "LinkId": "racao-royal-canin-feline-urinary", + "RefId": "", + "IsVisible": true, + "Description": "Descrição.", + "DescriptionShort": "", + "ReleaseDate": "2020-01-06T00:00:00", + "KeyWords": "bbbbbbbbbbbb*, a@", + "Title": "Ração Royal Canin Feline Urinary", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "Descrição.", + "SupplierId": 1, + "ShowWithoutStock": true, + "ListStoreId": [ + 1, + 2, + 3 + ], + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product by ID.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product by ID.yml new file mode 100644 index 0000000000..81bafc40e5 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product by ID.yml @@ -0,0 +1,109 @@ +info: + name: Get product by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/product/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/product/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/product/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/product/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/product/:productId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Product's unique numerical identifier."},"Name":{"type":"string","description":"Product's name. Limited to 150 characters."},"DepartmentId":{"type":"integer","description":"Department ID according to the product's category."},"CategoryId":{"type":"integer","description":"Category ID associated with this product."},"BrandId":{"type":"integer","description":"Brand ID associated with this product."},"LinkId":{"type":"string","description":"Slug that will be used to build the product page URL. If it not informed, it will be generated according to the product's name replacing spaces and special characters by hyphens (`-`)."},"RefId":{"type":"string","description":"Product Reference Code. The limit for the product `RefId` is 100 characters."},"IsVisible":{"type":"boolean","description":"Shows (`true`) or hides (`false`) the product in search result and product pages, but the product can still be added to the shopping cart. Usually applicable for gifts."},"Description":{"type":"string","description":"Product description."},"DescriptionShort":{"type":"string","description":"Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``."},"ReleaseDate":{"type":"string","description":"Used to assist in the ordering of the search result of the site. Using the `O=OrderByReleaseDateDESC` query string, you can pull this value and show the display order by release date. This attribute is also used as a condition for dynamic collections."},"KeyWords":{"type":"string","description":"Store Framework: Deprecated. \r\nLegacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). \"Television\", for example, can have a substitute word like \"TV\". This field is important to make your searches more comprehensive."},"Title":{"type":"string","description":"Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"IsActive":{"type":"boolean","description":"Activate (`true`) or inactivate (`false`) product."},"TaxCode":{"type":"string","description":"Product tax code, used for tax calculation."},"MetaTagDescription":{"type":"string","description":"Brief description of the product for SEO. It is recommended not to exceed 150 characters."},"SupplierId":{"type":["integer","null"],"description":"Deprecated field."},"ShowWithoutStock":{"type":"boolean","description":"If `true`, activates the [Notify Me](https://help.vtex.com/en/tutorial/setting-up-the-notify-me-option--2VqVifQuf6Co2KG048Yu6e) option when the product is out of stock."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":"integer","description":"Value used to set the priority on the search result page."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific product by its ID. The response body fields are exactly the information needed to create a new product. + > 📘 Onboarding guide + > + > Check the [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 42, + "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "DepartmentId": 2000089, + "CategoryId": 2000090, + "BrandId": 12121219, + "LinkId": "stefan-janoski-canvas-varsity-red", + "RefId": "sr_1_90", + "IsVisible": true, + "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "Zoom,Stefan,Janoski", + "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "SupplierId": 1, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product by reference ID.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product by reference ID.yml new file mode 100644 index 0000000000..43c017c7a1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product by reference ID.yml @@ -0,0 +1,108 @@ +info: + name: Get product by reference ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/products/productgetbyrefid/:refId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: refId + value: "12345" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/products/productgetbyrefid/:refId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/products/productgetbyrefid/:refId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/products/productgetbyrefid/:refId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/products/productgetbyrefid/:refId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"ID of the product."},"Name":{"type":"string","description":"Name of the product."},"DepartmentId":{"type":"integer","description":"ID of product department."},"CategoryId":{"type":"integer","description":"ID of product category."},"BrandId":{"type":"integer","description":"ID of the product brand."},"LinkId":{"type":"string","description":"Category URL."},"RefId":{"type":"string","description":"Product Reference ID. The limit for the product `RefId` is 100 characters."},"IsVisible":{"type":"boolean","description":"If the product are visible in search and list pages."},"Description":{"type":"string","description":"Product Description, HTML is allowed."},"DescriptionShort":{"type":"string","description":"Product Short Description."},"ReleaseDate":{"type":"string","description":"Product Release Date, for list ordering and product cluster highlight."},"KeyWords":{"type":"string","description":"Alternatives Keywords to improve the product findability."},"Title":{"type":"string","description":"Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"IsActive":{"type":"boolean","description":"If the product is Active."},"TaxCode":{"type":"string","description":"SKU Tax Code."},"MetaTagDescription":{"type":"string","description":"Meta Description for the product page."},"SupplierId":{"type":"integer","description":"Product Supplier ID."},"ShowWithoutStock":{"type":"boolean","description":"If the product can be visible without stock."},"ListStoreId":{"type":"array","description":"Array with the ID of all the sales channels that are related to the product.","items":{"type":"integer","description":"Sales channel ID."}},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific product by its Reference ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `refId` | path | (Required) Product reference code. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 17, + "Name": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", + "DepartmentId": 9287, + "CategoryId": 9287, + "BrandId": 9280, + "LinkId": "black-decker-20v-max-cordless-drill-driver-with-30-piece-acessories-ld120va", + "RefId": "880010", + "IsVisible": true, + "Description": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "DescriptionShort": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "product,sample", + "Title": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "SupplierId": 1, + "ShowWithoutStock": true, + "ListStoreId": [ + 1 + ], + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product review rate by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product review rate by product ID.yml new file mode 100644 index 0000000000..7d8f8f1d7d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product review rate by product ID.yml @@ -0,0 +1,84 @@ +info: + name: Get product review rate by product ID + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/addon/pvt/review/GetProductRate/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/addon/pvt/review/GetProductRate/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/addon/pvt/review/GetProductRate/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/addon/pvt/review/GetProductRate/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/addon/pvt/review/GetProductRate/:productId - Schema is valid", function () { + const schema = {"type":"number","description":"Review rate number."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the review rate of a product given the product's ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Reviews list** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 3 + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Get product's SKUs by product ID.yml b/BrunoCollections/VTEX - Catalog API/Product/Get product's SKUs by product ID.yml new file mode 100644 index 0000000000..6c8aa4a14e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Get product's SKUs by product ID.yml @@ -0,0 +1,192 @@ +info: + name: Get product's SKUs by product ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/variations/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/variations/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/variations/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/variations/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/variations/:productId - Schema is valid", function () { + const schema = {"type":"object","properties":{"productId":{"type":"integer","description":"Product's unique numerical identifier."},"name":{"type":"string","description":"Product name."},"salesChannel":{"type":"string","description":"Sales channel ID."},"available":{"type":"boolean","description":"Defines if the product is available (`true`) or not (`false`)."},"displayMode":{"type":"string","description":"Defines the mannner SKUs are displayed."},"dimensions":{"type":"array","description":"Lists SKU specifications.","items":{"type":"string","description":"Name of the SKU specification."}},"dimensionsInputType":{"type":"object","description":"Lists SKU specifications and their Field type, in the following format: `\"{specificationName}\":\"{fieldType}\"`."},"dimensionsMap":{"type":"object","description":"Lists SKU specifications and their possible values inside arrays."},"skus":{"type":"array","description":"Array containing information about the product's SKUs.","items":{"type":"object","description":"Object containing information about a specific SKU.","properties":{"sku":{"type":"integer","description":"SKU ID."},"skuname":{"type":"string","description":"SKU Name."},"dimensions":{"type":"object","description":"Lists SKU specifications and their respective values."},"available":{"type":"boolean","description":"Defines if the SKU is available (`true`) or not (`false`)."},"availablequantity":{"type":"integer","description":"Available quantity of the SKU in stock."},"cacheVersionUsedToCallCheckout":{"type":["string","null"],"description":"Cache version used to call Checkout."},"listPriceFormated":{"type":"string","description":"List price formatted according to the valid currency."},"listPrice":{"type":"integer","description":"List price."},"taxFormated":{"type":"string","description":"Tax value formatted according to the valid currency."},"taxAsInt":{"type":"integer","description":"Tax value."},"bestPriceFormated":{"type":"string","description":"Best price formatted according to the valid currency."},"bestPrice":{"type":"integer","description":"Best price."},"spotPrice":{"type":"integer","description":"Spot price."},"installments":{"type":"integer","description":"Number of installments."},"installmentsValue":{"type":"integer","description":"Value of installments."},"installmentsInsterestRate":{"type":["integer","null"],"description":"Interest rate of installments."},"image":{"type":"string","description":"SKU image URL."},"sellerId":{"type":"string","description":"Seller ID."},"measures":{"type":"object","description":"SKU measures.","properties":{"cubicweight":{"type":"number","description":"Cubic weight."},"height":{"type":"number","description":"Height."},"length":{"type":"number","description":"Length."},"weight":{"type":"number","description":"Weight."},"width":{"type":"number","description":"Width."}}},"unitMultiplier":{"type":"number","description":"SKU Unit Multiplier."},"rewardValue":{"type":"integer","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves data about a product and its SKUs, given the product ID. A SKU (Stock Keeping Unit) is the physical unit of the product, also called a product variation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "productId": 9, + "name": "Tshirt", + "salesChannel": "2", + "available": true, + "displayMode": "list", + "dimensions": [ + "Color", + "Size", + "Origin country", + "Gender" + ], + "dimensionsInputType": { + "Color": "Combo", + "Size": "Combo", + "Origin country": "Combo", + "Gender": "Combo" + }, + "dimensionsMap": { + "Color": [ + "Yellow", + "Blue", + "Red" + ], + "Size": [ + "S", + "M", + "L" + ], + "Origin country": [ + "Brazil" + ], + "Gender": [ + "Male" + ] + }, + "skus": [ + { + "sku": 310118454, + "skuname": "Yellow - L", + "dimensions": { + "Color": "Yellow", + "Size": "L", + "Origin country": "Brazil", + "Gender": "Male" + }, + "available": false, + "availablequantity": 0, + "cacheVersionUsedToCallCheckout": null, + "listPriceFormated": "R$ 0,00", + "listPrice": 0, + "taxFormated": "R$ 0,00", + "taxAsInt": 0, + "bestPriceFormated": "R$ 9.999.876,00", + "bestPrice": 999987600, + "spotPrice": 999987600, + "installments": 0, + "installmentsValue": 0, + "installmentsInsterestRate": null, + "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155467-292-292/image-5d7ad76ad1954c53adecab4138319034.jpg?v=637321899584500000", + "sellerId": "1", + "seller": "lojadobreno", + "measures": { + "cubicweight": 1, + "height": 5, + "length": 20, + "weight": 200, + "width": 20 + }, + "unitMultiplier": 1, + "rewardValue": 0 + }, + { + "sku": 310118455, + "skuname": "Red - M", + "dimensions": { + "Color": "Red", + "Size": "M", + "Origin country": "Brazil", + "Gender": "Male" + }, + "available": true, + "availablequantity": 99999, + "cacheVersionUsedToCallCheckout": "38395F1AEF59DF5CEAEDE472328145CD_", + "listPriceFormated": "R$ 0,00", + "listPrice": 0, + "taxFormated": "R$ 0,00", + "taxAsInt": 0, + "bestPriceFormated": "R$ 20,00", + "bestPrice": 2000, + "spotPrice": 2000, + "installments": 1, + "installmentsValue": 2000, + "installmentsInsterestRate": 0, + "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155468-292-292/image-601a6099aace48b89d26fc9f22e8e611.jpg?v=637321906602470000", + "sellerId": "pedrostore", + "seller": "pedrostore", + "measures": { + "cubicweight": 0.4167, + "height": 5, + "length": 20, + "weight": 200, + "width": 20 + }, + "unitMultiplier": 1, + "rewardValue": 0 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/Update product.yml b/BrunoCollections/VTEX - Catalog API/Product/Update product.yml new file mode 100644 index 0000000000..6cce73abf3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/Update product.yml @@ -0,0 +1,133 @@ +info: + name: Update product + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/product/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + body: + type: json + data: |- + { + "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "CategoryId": 2000090, + "BrandId": 12121219, + "DepartmentId": 2000089, + "LinkId": "stefan-janoski-canvas-varsity-red", + "RefId": "sr_1_90", + "IsVisible": true, + "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", + "ReleaseDate": "2019-01-01T00:00:00", + "KeyWords": "Zoom,Stefan,Janoski", + "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "IsActive": true, + "TaxCode": "12345", + "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "SupplierId": null, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": null, + "LomadeeCampaignCode": null, + "Score": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/product/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/product/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/product/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/product/:productId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Product's unique numerical identifier."},"Name":{"type":"string","description":"Product's name. Limited to 150 characters."},"DepartmentId":{"type":"integer","description":"Department ID according to the product's category."},"CategoryId":{"type":"integer","description":"Category ID associated with this product."},"BrandId":{"type":"integer","description":"Brand ID associated with this product."},"LinkId":{"type":"string","description":"Slug that will be used to build the product page URL. If not informed, it will be generated according to the product's name replacing spaces and special characters by hyphens (`-`)."},"RefId":{"type":"string","description":"Product reference code."},"IsVisible":{"type":"boolean","description":"Shows (`true`) or hides (`false`) the product in search result and product pages, but the product can still be added to the shopping cart. Usually applicable for gifts."},"Description":{"type":"string","description":"Product description."},"DescriptionShort":{"type":"string","description":"Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``."},"ReleaseDate":{"type":"string","description":"Used to assist in the ordering of the search result of the site. Using the `O=OrderByReleaseDateDESC` query string, you can pull this value and show the display order by release date. This attribute is also used as a condition for dynamic collections."},"KeyWords":{"type":"string","description":"Store Framework: Deprecated. \r\nLegacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). \"Television\", for example, can have a substitute word like \"TV\". This field is important to make your searches more comprehensive."},"Title":{"type":"string","description":"Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"IsActive":{"type":"boolean","description":"Activate (`true`) or inactivate (`false`) product."},"TaxCode":{"type":"string","description":"Product tax code, used for tax calculation."},"MetaTagDescription":{"type":"string","description":"Brief description of the product for SEO. It's recommended that you don't exceed 150 characters."},"SupplierId":{"type":["integer","null"],"description":"Deprecated field."},"ShowWithoutStock":{"type":"boolean","description":"If `true`, activates the [Notify Me](https://help.vtex.com/en/tutorial/setting-up-the-notify-me-option--2VqVifQuf6Co2KG048Yu6e) option when the product is out of stock."},"AdWordsRemarketingCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"LomadeeCampaignCode":{"type":"string","description":"This is a legacy field. Do not take this information into consideration."},"Score":{"type":"integer","description":"Value used to set the priority on the search result page."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing product. + + >❗ Although some fields are not required to get a response `200 OK`, if you don't send a field or send its value as empty or `null`, all previously configured information will be deleted, and boolean fields will turn to `false`. So, to update a product, you should get its data using the [Get product by ID](https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog/pvt/product/-productId-) endpoint and use it as a template for the current request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 42, + "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "DepartmentId": 2000089, + "CategoryId": 2000090, + "BrandId": 12121219, + "LinkId": "stefan-janoski-canvas-varsity-red", + "RefId": "sr_1_90", + "IsVisible": true, + "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "Zoom,Stefan,Janoski", + "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "SupplierId": 1, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Product/folder.yml b/BrunoCollections/VTEX - Catalog API/Product/folder.yml new file mode 100644 index 0000000000..de05246e1e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Product/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product + type: folder + seq: 8 diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/Create SKU EAN.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/Create SKU EAN.yml new file mode 100644 index 0000000000..3ce4f4c2e8 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/Create SKU EAN.yml @@ -0,0 +1,60 @@ +info: + name: Create SKU EAN + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: ean + value: "1234567" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates the EAN value of an SKU. It is not possible to update the EAN. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `ean` | path | (Required) EAN. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete SKU EAN.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete SKU EAN.yml new file mode 100644 index 0000000000..29565f4719 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete SKU EAN.yml @@ -0,0 +1,60 @@ +info: + name: Delete SKU EAN + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: ean + value: ABC123 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the EAN value of an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `ean` | path | (Required) EAN number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete all SKU EAN values.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete all SKU EAN values.yml new file mode 100644 index 0000000000..b1cfc5adef --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/Delete all SKU EAN values.yml @@ -0,0 +1,56 @@ +info: + name: Delete all SKU EAN values + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/ean" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/ean - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all EAN values of an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/Get EAN by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/Get EAN by SKU ID.yml new file mode 100644 index 0000000000..33afff7f0a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/Get EAN by SKU ID.yml @@ -0,0 +1,86 @@ +info: + name: Get EAN by SKU ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/ean" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/ean - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/ean - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/ean - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/ean - Schema is valid", function () { + const schema = {"type":"array","description":"Array with EANs associated with the SKU.","items":{"type":"string","description":"EAN."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the EAN of the SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "1234567890123" + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/Get SKU by EAN.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/Get SKU by EAN.yml new file mode 100644 index 0000000000..2c8b927e83 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/Get SKU by EAN.yml @@ -0,0 +1,236 @@ +info: + name: Get SKU by EAN + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ean + value: "1234567890123" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean - Schema is valid", function () { + const schema = {"required":["Id","ProductId","NameComplete","ProductName","ProductDescription","SkuName","IsActive","IsTransported","IsInventoried","IsGiftCardRecharge","ImageUrl","DetailUrl","CSCIdentification","BrandId","BrandName","Dimension","RealDimension","ManufacturerCode","IsKit","KitItems","Services","Categories","Attachments","Collections","SkuSellers","SalesChannels","Images","SkuSpecifications","ProductSpecifications","ProductClustersIds","ProductCategoryIds","ProductGlobalCategoryId","ProductCategories","CommercialConditionId","RewardValue","AlternateIds","AlternateIdValues","EstimatedDateArrival","MeasurementUnit","UnitMultiplier","InformationSource","ModalType"],"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"SKU ID."},"ProductId":{"type":"integer","description":"Product ID."},"NameComplete":{"type":"string","description":"Product name and SKU name combined."},"ComplementName":{"type":"string","description":"Product complement name."},"ProductName":{"type":"string","description":"Product name."},"ProductDescription":{"type":"string","description":"Product description. HTML is allowed."},"ProductRefId":{"type":"string","description":"Product reference ID."},"TaxCode":{"type":"string","description":"SKU tax code."},"SkuName":{"type":"string","description":"SKU name."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active or not."},"IsTransported":{"type":"boolean","description":"Deprecated field."},"IsInventoried":{"type":"boolean","description":"Deprecated field."},"IsGiftCardRecharge":{"type":"boolean","description":"Defines if the purchase of the SKU will generate reward value for the customer."},"ImageUrl":{"type":"string","description":"SKU image URL."},"DetailUrl":{"type":"string","description":"Product slug."},"CSCIdentification":{"type":["string","null"],"description":"SKU seller identification."},"BrandId":{"type":"string","description":"Brand ID."},"BrandName":{"type":"string","description":"Brand name."},"Dimension":{"required":["cubicweight","height","length","weight","width"],"type":"object","description":"Object containing the SKU dimensions to be used on the shipping calculation.","properties":{"cubicweight":{"type":"number","description":"SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."},"weight":{"type":"number","description":"SKU weight."},"width":{"type":"number","description":"SKU width."}}},"RealDimension":{"required":["realCubicWeight","realHeight","realLength","realWeight","realWidth"],"type":"object","description":"Object containing the real SKU dimensions, which appear in the product page.","properties":{"realCubicWeight":{"type":"number","description":"Real SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"realHeight":{"type":"number","description":"Real SKU height."},"realLength":{"type":"number","description":"Real SKU length."},"realWeight":{"type":"number","description":"Real SKU weight."},"realWidth":{"type":"number","description":"Real SKU width."}}},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"KitItems":{"type":"array","description":"Array with SKU IDs of bundle components.","items":{"type":"string","description":"SKU ID of each bundle component."}},"Services":{"type":"array","description":"Array with service IDs that are related to the SKU.","items":{"type":"string","description":"Service IDs of each service related to the SKU."}},"Categories":{"type":"array","description":"Categories of the related product.","items":{"type":"string","description":"Category ID."}},"CategoriesFullPath":{"type":"array","description":"Path of categories of the related product.","items":{"type":"string","description":"Path composed by category IDs separated by `/`."}},"Attachments":{"type":"array","description":"Array with attachment IDs that are related to the product.","items":{"required":["Id","Name","Keys","Fields","IsActive","IsRequired"],"type":"object","description":"Object containing information about SKU attachments.","properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"Keys":{"type":"array","items":{"type":"string","description":"Each attachment key."},"description":"Attachment Keys."},"Fields":{"type":"array","items":{"required":["FieldName","MaxCaracters","DomainValues"],"type":"object","description":"Object with field details.","properties":{"FieldName":{"type":"string","description":"Attachment field name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters accepted in the attachment field."},"DomainValues":{"type":["string","null"],"description":"Allowed key values."}}},"description":"Array containing attachment fields."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."}}}},"Collections":{"type":"array","description":"Array with collections IDs that are related to the product.","items":{"type":"string","description":"Collection ID."}},"SkuSellers":{"type":"array","description":"Array with related sellers data.","items":{"required":["SellerId","StockKeepingUnitId","SellerStockKeepingUnitId","IsActive","FreightCommissionPercentage","ProductCommissionPercentage"],"type":"object","description":"Object containing related SKU sellers data.","properties":{"SellerId":{"type":"string","description":"SKU seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID for the SKU seller."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active."},"FreightCommissionPercentage":{"type":"number","description":"Registered value for Seller Freight Commission."},"ProductCommissionPercentage":{"type":"number","description":"Registered value for Seller product Commission."}}}},"SalesChannels":{"type":"array","description":"Array of sales channel IDs.","items":{"type":"integer","description":"Sales channel ID."}},"Images":{"type":"array","description":"Array of objects with SKU image details.","items":{"required":["ImageUrl","ImageName","FileId"],"type":"object","description":"Object containing SKU images details.","properties":{"ImageUrl":{"type":"string","description":"Image URL."},"ImageName":{"type":["string","null"],"description":"Image label."},"FileId":{"type":"integer","format":"int32","description":"SKU image ID."}}}},"SkuSpecifications":{"type":"array","description":"Array with related SKU specifications.","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object containing related SKU specifications.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification field Name."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}}},"ProductSpecifications":{"type":"array","description":"Array with related product specifications.","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object with product specification details.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification name. Limited to 100 characters."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}}},"ProductClustersIds":{"type":"string","description":"Product cluster IDs separated by comma (`,`)."},"PositionsInClusters":{"type":"object","description":"Product clusters position in each cluster. Structure: \"{Product cluster ID}\": {Position}.\n\n`{Product cluster ID}` is a string, while `{Position}` is an integer.","additionalProperties":{"type":"integer","description":"Product cluster ID.","additionalProperties":{"type":"integer","description":"Position."}}},"ProductClusterNames":{"type":"object","description":"Product clusters names. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster name."}}},"ProductClusterHighlights":{"type":"object","description":"Product clusters highlights. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster highlight."}}},"ProductCategoryIds":{"type":"string","description":"Category path composed by category IDs separated by `/`."},"IsDirectCategoryActive":{"type":"boolean","description":"Indicates if the direct product category is active or not."},"ProductGlobalCategoryId":{"type":["integer","null"],"description":"Product global category ID."},"ProductCategories":{"type":"object","description":"Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Category ID.","additionalProperties":{"type":"string","description":"Category name."}}},"CommercialConditionId":{"type":"integer","format":"int32","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"AlternateIds":{"type":"object","description":"Array with alternate SKU IDs, such as EAN and `RefId`.","properties":{"Ean":{"type":"string","description":"SKU EAN."},"RefId":{"type":"string","description":"SKU reference ID."}}},"AlternateIdValues":{"type":"array","description":"Array with values of alternative SKU IDs.","items":{"type":"string","description":"Alternative SKU ID."}},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"InformationSource":{"type":["string","null"],"description":"Information source."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KeyWords":{"type":["string","null"],"description":"Keywords related to the product."},"ReleaseDate":{"type":["string","null"],"description":"Release date of the product."},"ProductIsVisible":{"type":"boolean","description":"Defines if the product is visible or not."},"ShowIfNotAvailable":{"type":"boolean","description":"Defines if the product will be shown if it is not available."},"IsProductActive":{"type":"boolean","description":"Defines if the product is active or not."},"ProductFinalScore":{"type":"integer","description":"Product final score."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an SKU by its EAN ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ean` | path | (Required) EAN of the SKU which you need to retrieve details from. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2001773, + "ProductId": 2001426, + "NameComplete": "Tabela de Basquete", + "ProductName": "Tabela de Basquete", + "ProductDescription": "Tabela de Basquete", + "SkuName": "Tabela de Basquete", + "IsActive": true, + "IsTransported": true, + "IsInventoried": true, + "IsGiftCardRecharge": false, + "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952-55-55/7508800GG.jpg", + "DetailUrl": "/tabela-de-basquete/p", + "CSCIdentification": null, + "BrandId": "2000018", + "BrandName": "MARCA ARGOLO TESTE", + "Dimension": { + "cubicweight": 81.6833, + "height": 65, + "length": 58, + "weight": 10000, + "width": 130 + }, + "RealDimension": { + "realCubicWeight": 274.1375, + "realHeight": 241, + "realLength": 65, + "realWeight": 9800, + "realWidth": 105 + }, + "ManufacturerCode": "", + "IsKit": false, + "KitItems": [], + "Services": [], + "Categories": [], + "Attachments": [ + { + "Id": 3, + "Name": "Mensagem", + "Keys": [ + "nome;20", + "foto;40" + ], + "Fields": [ + { + "FieldName": "nome", + "MaxCaracters": "20", + "DomainValues": "Adalberto,Pedro,João" + }, + { + "FieldName": "foto", + "MaxCaracters": "40", + "DomainValues": null + } + ], + "IsActive": true, + "IsRequired": false + } + ], + "Collections": [], + "SkuSellers": [ + { + "SellerId": "1", + "StockKeepingUnitId": 2001773, + "SellerStockKeepingUnitId": "2001773", + "IsActive": true, + "FreightCommissionPercentage": 0, + "ProductCommissionPercentage": 0 + } + ], + "SalesChannels": [ + 1, + 2, + 3, + 10 + ], + "Images": [ + { + "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", + "ImageName": "", + "FileId": 168952 + }, + { + "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168953/7508800_1GG.jpg", + "ImageName": "", + "FileId": 168953 + }, + { + "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168954/7508800_2GG.jpg", + "ImageName": "", + "FileId": 168954 + } + ], + "SkuSpecifications": [ + { + "FieldId": 102, + "FieldName": "Cor", + "FieldValueIds": [ + 266 + ], + "FieldValues": [ + "Padrão" + ] + } + ], + "ProductSpecifications": [ + { + "FieldId": 7, + "FieldName": "Faixa Etária", + "FieldValueIds": [ + 58, + 56, + 55, + 52 + ], + "FieldValues": [ + "5 a 6 anos", + "7 a 8 anos", + "9 a 10 anos", + "Acima de 10 anos" + ] + }, + { + "FieldId": 23, + "FieldName": "Fabricante", + "FieldValueIds": [], + "FieldValues": [ + "Xalingo" + ] + } + ], + "ProductClustersIds": "176,187,192,194,211,217,235,242", + "ProductCategoryIds": "/59/", + "ProductGlobalCategoryId": null, + "ProductCategories": { + "59": "Brinquedos" + }, + "CommercialConditionId": 1, + "RewardValue": 100, + "AlternateIds": { + "Ean": "8781", + "RefId": "878181" + }, + "AlternateIdValues": [ + "8781", + "878181" + ], + "EstimatedDateArrival": null, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "InformationSource": null, + "ModalType": "" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU EAN/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU EAN/folder.yml new file mode 100644 index 0000000000..aef0e12661 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU EAN/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU EAN + type: folder + seq: 12 diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate SKU attachment.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate SKU attachment.yml new file mode 100644 index 0000000000..b064c8de80 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate SKU attachment.yml @@ -0,0 +1,90 @@ +info: + name: Associate SKU attachment + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skuattachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "AttachmentId": 1, + "SkuId": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skuattachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skuattachment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skuattachment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skuattachment - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing information about the association between the SKU and the attachment.","properties":{"Id":{"type":"integer","description":"Identifier of the SKU's association to the attachment."},"AttachmentId":{"type":"integer","description":"Attachment ID."},"SkuId":{"type":"integer","description":"Unique identifier of the SKU."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates an existing SKU to an existing attachment. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 31, + "AttachmentId": 1, + "SkuId": 7 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate attachments to an SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate attachments to an SKU.yml new file mode 100644 index 0000000000..92386bbca5 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/Associate attachments to an SKU.yml @@ -0,0 +1,62 @@ +info: + name: Associate attachments to an SKU + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/sku/associateattachments" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "SkuId": 1, + "AttachmentNames": [ + "T-Shirt Customization" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog_system/pvt/sku/associateattachments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates attachments to an SKU based on a given SKU ID and attachment names. + + This request removes existing SKU attachment associations and recreates the associations with the attachments being sent. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/Delete SKU attachment by attachment association ID.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/Delete SKU attachment by attachment association ID.yml new file mode 100644 index 0000000000..adec116e5e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/Delete SKU attachment by attachment association ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete SKU attachment by attachment association ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuattachment/:skuAttachmentAssociationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuAttachmentAssociationId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuattachment/:skuAttachmentAssociationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the association of an SKU to an attachment. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuAttachmentAssociationId` | path | (Required) ID of the association between the attachment and the SKU, which corresponds to the `Id` in the response body of the [Associate SKU attachment](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-post-sku-attachment) and the [Get SKU attachment by SKU ID](https://developers.vtex.com/vtex-rest-api/reference/get_api-catalog-pvt-stockkeepingunit-skuid-attachment) endpoints. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/Dissociate attachments and SKUs.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/Dissociate attachments and SKUs.yml new file mode 100644 index 0000000000..947a8da7f6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/Dissociate attachments and SKUs.yml @@ -0,0 +1,62 @@ +info: + name: Dissociate attachments and SKUs + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuattachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: query + disabled: true + - name: attachmentId + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuattachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Dissociates attachments and SKUs based on an SKU ID or an attachment ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | query | SKU ID. By using this query param, you can dissociate all the attachments from an SKU based on its SKU ID. | + | `attachmentId` | query | Attachment ID. By using this query param, you can dissociate the given attachment from all previously associated SKUs. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/Get SKU attachments by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/Get SKU attachments by SKU ID.yml new file mode 100644 index 0000000000..41bc8d09f2 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/Get SKU attachments by SKU ID.yml @@ -0,0 +1,90 @@ +info: + name: Get SKU attachments by SKU ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attachment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attachment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attachment - Schema is valid", function () { + const schema = {"type":"array","description":"Array of objects with information about the association between the attachments and the SKU.","items":{"type":"object","description":"Object containing information about the association between the SKU and the attachment.","properties":{"Id":{"type":"integer","description":"Identifier of the SKU's association to the attachment."},"AttachmentId":{"type":"integer","description":"Attachment ID."},"SkuId":{"type":"integer","description":"Unique identifier of the SKU."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves existing SKU attachments by SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 97, + "AttachmentId": 1, + "SkuId": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attachment/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU attachment/folder.yml new file mode 100644 index 0000000000..01f5ea51ae --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attachment/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU attachment + type: folder + seq: 16 diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Create SKU attribute.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Create SKU attribute.yml new file mode 100644 index 0000000000..d7aaad2960 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Create SKU attribute.yml @@ -0,0 +1,102 @@ +info: + name: Create SKU attribute + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + body: + type: json + data: |- + { + "SpecificationName": "Ingredients", + "SpecificationValue": "wax, oil, pigment", + "IsVisible": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU attribute unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the SKU attribute."},"SpecificationValue":{"type":"string","maxLength":3500,"description":"Value of the SKU attribute."},"IsVisible":{"type":"boolean","description":"Defines if the attribute is visible on the store (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates an attribute for an SKU, which is an informative field at the SKU level that doesn't create new variants. For example, a lipstick might have color and size as structured specifications that define SKU variants, while ingredients would be an informative attribute since they don't represent a new SKU. + + >⚠️ Attributes only accept open-text values. The maximum length for `SpecificationValue` is 3,500 characters. If the request body contains characters that break the JSON string (for example, unescaped backslashes), the request will fail with a `400` status code. + + You can also create and edit attributes via VTEX Admin, in **Catalog > Products and SKUs > [SKU editing page](https://help.vtex.com/docs/tutorials/adding-or-editing-skus)** in the **Attributes** section. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1171, + "SkuId": 1, + "SpecificationName": "Ingredients", + "SpecificationValue": "wax, oil, pigment", + "IsVisible": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete SKU attribute.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete SKU attribute.yml new file mode 100644 index 0000000000..1966e90a74 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete SKU attribute.yml @@ -0,0 +1,60 @@ +info: + name: Delete SKU attribute + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: skuAttributeId + value: "1171" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific attribute of an SKU by its unique identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuAttributeId` | path | (Required) SKU attribute unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete all SKU attributes.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete all SKU attributes.yml new file mode 100644 index 0000000000..9b7c87a85b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Delete all SKU attributes.yml @@ -0,0 +1,56 @@ +info: + name: Delete all SKU attributes + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all attributes of an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Get SKU attribute by ID.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Get SKU attribute by ID.yml new file mode 100644 index 0000000000..127b133d5d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Get SKU attribute by ID.yml @@ -0,0 +1,94 @@ +info: + name: Get SKU attribute by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: skuAttributeId + value: "1171" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU attribute unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the SKU attribute."},"SpecificationValue":{"type":"string","maxLength":3500,"description":"Value of the SKU attribute."},"IsVisible":{"type":"boolean","description":"Defines if the attribute is visible on the store (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific attribute of an SKU by its unique identifier. SKU attributes are informative fields defined at the SKU level that don't create new SKU variants. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuAttributeId` | path | (Required) SKU attribute unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1171, + "SkuId": 1, + "SpecificationName": "Ingredients", + "SpecificationValue": "wax, oil, pigment", + "IsVisible": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Get all SKU attributes.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Get all SKU attributes.yml new file mode 100644 index 0000000000..51d1fac4f9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Get all SKU attributes.yml @@ -0,0 +1,101 @@ +info: + name: Get all SKU attributes + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"SKU attribute details.","properties":{"Id":{"type":"integer","description":"SKU attribute unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the SKU attribute."},"SpecificationValue":{"type":"string","maxLength":3500,"description":"Value of the SKU attribute."},"IsVisible":{"type":"boolean","description":"Defines if the attribute is visible on the store (`true`) or not (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all SKU attributes, which are informative fields defined at the SKU level that don't create new SKU variants. They only accept open-text values. + + >ℹ️ These attributes are indexed and can be retrieved in the `attribute` field of the search payload. However, they cannot be used as search filters or searched directly in the storefront. In the storefront context, they are available in the `additionalProperty` field and can be differentiated from regular specifications by the `valueReference` field, which contains `ATTRIBUTE` instead of `SPECIFICATION`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1171, + "SkuId": 1, + "SpecificationName": "Ingredients", + "SpecificationValue": "wax, oil, pigment", + "IsVisible": true + }, + { + "Id": 1172, + "SkuId": 1, + "SpecificationName": "Material", + "SpecificationValue": "cotton", + "IsVisible": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/Update SKU attribute.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/Update SKU attribute.yml new file mode 100644 index 0000000000..31c2ae829d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/Update SKU attribute.yml @@ -0,0 +1,104 @@ +info: + name: Update SKU attribute + type: http + seq: 5 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: skuAttributeId + value: "1171" + type: path + body: + type: json + data: |- + { + "SpecificationName": "Ingredients", + "SpecificationValue": "beeswax, coconut oil, natural pigment", + "IsVisible": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/attribute/:skuAttributeId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU attribute unique numerical identifier."},"SkuId":{"type":"integer","description":"SKU's unique numerical identifier."},"SpecificationName":{"type":"string","description":"Name of the SKU attribute."},"SpecificationValue":{"type":"string","description":"Value of the SKU attribute with a maximum length of 3,500 characters."},"IsVisible":{"type":"boolean","description":"Defines if the attribute is visible on the store (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing attribute of an SKU. + + >⚠️ SKU attributes only accept open-text values. The maximum length for `SpecificationValue` is 3,500 characters. If the request body contains characters that break the JSON string (for example, unescaped backslashes), the request will fail with a status code `400` error. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuAttributeId` | path | (Required) SKU attribute unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1171, + "SkuId": 1, + "SpecificationName": "Ingredients", + "SpecificationValue": "beeswax, coconut oil, natural pigment", + "IsVisible": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU attribute/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU attribute/folder.yml new file mode 100644 index 0000000000..428aa61b2f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU attribute/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU attribute + type: folder + seq: 32 diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Create SKU complement.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Create SKU complement.yml new file mode 100644 index 0000000000..4d68d4e5f9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Create SKU complement.yml @@ -0,0 +1,94 @@ +info: + name: Create SKU complement + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skucomplement" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "ParentSkuId": 1, + "SkuId": 2, + "ComplementTypeId": 2 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skucomplement - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skucomplement - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skucomplement - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skucomplement - Schema is valid", function () { + const schema = {"required":["Id","SkuId","ParentSkuId","ComplementTypeId"],"type":"array","description":"List with SKU complement information.","items":{"type":"object","description":"SKU complement details.","properties":{"Id":{"type":"integer","description":"SKU complement's unique numerical identifier."},"SkuId":{"type":"integer","description":"ID of the SKU which will be inserted as a complement in the parent SKU."},"ParentSkuId":{"type":"integer","description":"ID of the parent SKU, where the complement will be inserted."},"ComplementTypeId":{"type":"integer","description":"Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**.","enum":[1,2,3,4,5]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new SKU complement on a parent SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 61, + "SkuId": 7, + "ParentSkuId": 1, + "ComplementTypeId": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Delete SKU complement by SKU complement ID.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Delete SKU complement by SKU complement ID.yml new file mode 100644 index 0000000000..11d542b9ac --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Delete SKU complement by SKU complement ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete SKU complement by SKU complement ID + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skucomplement/:skuComplementId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuComplementId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skucomplement/:skuComplementId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a previously existing SKU complement by SKU complement ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuComplementId` | path | (Required) SKU complement's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU ID.yml new file mode 100644 index 0000000000..3a5b874e37 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU ID.yml @@ -0,0 +1,91 @@ +info: + name: Get SKU complement by SKU ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/complement" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement - Schema is valid", function () { + const schema = {"required":["Id","SkuId","ParentSkuId","ComplementTypeId"],"type":"array","description":"List with SKU complement information.","items":{"type":"object","description":"SKU complement details.","properties":{"Id":{"type":"integer","description":"SKU complement's unique numerical identifier."},"SkuId":{"type":"integer","description":"ID of the SKU which will be inserted as a complement in the parent SKU."},"ParentSkuId":{"type":"integer","description":"ID of the parent SKU, where the complement will be inserted."},"ComplementTypeId":{"type":"integer","description":"Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**.","enum":[1,2,3,4,5]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an existing SKU complement by its SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 61, + "SkuId": 7, + "ParentSkuId": 1, + "ComplementTypeId": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU complement ID.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU complement ID.yml new file mode 100644 index 0000000000..31429180a5 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complement by SKU complement ID.yml @@ -0,0 +1,91 @@ +info: + name: Get SKU complement by SKU complement ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skucomplement/:skuComplementId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuComplementId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skucomplement/:skuComplementId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skucomplement/:skuComplementId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skucomplement/:skuComplementId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skucomplement/:skuComplementId - Schema is valid", function () { + const schema = {"required":["Id","SkuId","ParentSkuId","ComplementTypeId"],"type":"array","description":"List with SKU complement information.","items":{"type":"object","description":"SKU complement details.","properties":{"Id":{"type":"integer","description":"SKU complement's unique numerical identifier."},"SkuId":{"type":"integer","description":"ID of the SKU which will be inserted as a complement in the parent SKU."},"ParentSkuId":{"type":"integer","description":"ID of the parent SKU, where the complement will be inserted."},"ComplementTypeId":{"type":"integer","description":"Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**.","enum":[1,2,3,4,5]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an existing SKU complement by its SKU complement ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuComplementId` | path | (Required) SKU complement's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 61, + "SkuId": 7, + "ParentSkuId": 1, + "ComplementTypeId": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by complement type ID.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by complement type ID.yml new file mode 100644 index 0000000000..e70ad3590c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by complement type ID.yml @@ -0,0 +1,95 @@ +info: + name: Get SKU complements by complement type ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: complementTypeId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId - Schema is valid", function () { + const schema = {"required":["Id","SkuId","ParentSkuId","ComplementTypeId"],"type":"array","description":"List with SKU complement information.","items":{"type":"object","description":"SKU complement details.","properties":{"Id":{"type":"integer","description":"SKU complement's unique numerical identifier."},"SkuId":{"type":"integer","description":"ID of the SKU which will be inserted as a complement in the parent SKU."},"ParentSkuId":{"type":"integer","description":"ID of the parent SKU, where the complement will be inserted."},"ComplementTypeId":{"type":"integer","description":"Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**.","enum":[1,2,3,4,5]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all the existing SKU complements with the same complement type ID of a specific SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) ID of the SKU which will be inserted as a complement in the parent SKU. | + | `complementTypeId` | path | (Required) Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 61, + "SkuId": 7, + "ParentSkuId": 1, + "ComplementTypeId": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by type.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by type.yml new file mode 100644 index 0000000000..0240da8d65 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/Get SKU complements by type.yml @@ -0,0 +1,94 @@ +info: + name: Get SKU complements by type + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/complements/:parentSkuId/:type" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: parentSkuId + value: "1" + type: path + - name: type + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/complements/:parentSkuId/:type - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/complements/:parentSkuId/:type - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/complements/:parentSkuId/:type - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/complements/:parentSkuId/:type - Schema is valid", function () { + const schema = {"type":"object","required":["ParentSkuId","ComplementSkuIds","Type"],"properties":{"ParentSkuId":{"type":"integer","description":"ID of the parent SKU, where the complement is inserted."},"ComplementSkuIds":{"type":"array","description":"Array with SKU complements IDs.","items":{"type":"integer","description":"SKU complement ID."}},"Type":{"type":"string","description":"Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**.","enum":["1","2","3","4","5"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all the existing SKU complements with the same complement type ID of a specific SKU and parent SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `parentSkuId` | path | (Required) ID of the parent SKU, where the complement is inserted. | + | `type` | path | (Required) Complement type ID. This represents the type of the complement. The possible values are: `1` for **Accessory**; `2` for **Suggestion**; `3` for **Similar product**; `5` for **Show together**. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "ParentSkuId": 1, + "ComplementSkuIds": [ + 7 + ], + "Type": "1" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU complement/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU complement/folder.yml new file mode 100644 index 0000000000..74fb07e10f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU complement/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU complement + type: folder + seq: 17 diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Copy files from an SKU to another SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Copy files from an SKU to another SKU.yml new file mode 100644 index 0000000000..175d4ef9f9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Copy files from an SKU to another SKU.yml @@ -0,0 +1,103 @@ +info: + name: Copy files from an SKU to another SKU + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuIdfrom + value: "1" + type: path + - name: skuIdto + value: "2" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing information about each of the target SKU's files.","items":{"type":"object","description":"Object containing each SKU file's information.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association of the image to the SKU."},"ArchiveId":{"type":"integer","description":"Unique identifier of the image file."},"SkuId":{"type":"integer","description":"Unique identifier of the SKU."},"IsMain":{"type":"boolean","description":"Defines if the image is the main image of the SKU."},"Label":{"type":["string","null"],"description":"Image label."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Copy all existing files from an SKU to another SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuIdfrom` | path | (Required) __Origin__ SKU's unique numerical identifier. | + | `skuIdto` | path | (Required) __Target__ SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1964, + "ArchiveId": 155404, + "SkuId": 1, + "IsMain": true, + "Label": "" + }, + { + "Id": 1965, + "ArchiveId": 155429, + "SkuId": 1, + "IsMain": false, + "Label": "" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Create SKU file.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Create SKU file.yml new file mode 100644 index 0000000000..c51a49e07a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Create SKU file.yml @@ -0,0 +1,108 @@ +info: + name: Create SKU file + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "123456" + type: path + body: + type: json + data: |- + { + "Name": "Nike-Red-Janoski-1", + "Url": "https://m.media-amazon.com/images/I/610G2-sJx5L._AC_UX695_.jpg", + "IsMain": true, + "Label": "Main", + "Text": "Nike-Red-Janoski", + "Position": 0 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing SKU files information.","items":{"type":"object","description":"Object containing a SKU file information.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association of the image to the SKU."},"ArchiveId":{"type":"integer","description":"Unique identifier of the image."},"SkuId":{"type":"integer","description":"SKU unique identifier."},"Name":{"type":"string","description":"Image name."},"IsMain":{"type":"boolean","description":"Defines if the image is the SKU main image (`true`) or not (`false`). This field will always be `true` when the image `Position` is `0`, and `false` otherwise."},"Text":{"type":"string","description":"SKU image text."},"Label":{"type":["string","null"],"description":"Image label."},"Url":{"type":"string","description":"SKU image URL."},"FileLocation":{"type":"string","description":"Location where the file is stored."},"Position":{"type":"integer","description":"Position of the SKU image as displayed in the storefront, where `0` corresponds to the first position, `1` to the second position, and so on. The position `0` will always make the `isMain` value `true`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new image for an SKU based on its URL or on a form-data request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 549, + "ArchiveId": 155485, + "SkuId": 310118490, + "Name": "White tshirt front", + "IsMain": true, + "Label": "fashion", + "Text": "image-b6175322abda4b73bbb57c46ae2f3900", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155485/B5C34F72E355BB325D07E56A2CBBD6FF", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 0 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Delete SKU image file.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Delete SKU image file.yml new file mode 100644 index 0000000000..d50115b211 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Delete SKU image file.yml @@ -0,0 +1,60 @@ +info: + name: Delete SKU image file + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: skuFileId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific SKU image file. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuFileId` | path | (Required) ID of the association of the SKU and the image, which can be obtained by placing a request to the [Get SKU file](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-sku-file) endpoint and copying the `Id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Delete all SKU files.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Delete all SKU files.yml new file mode 100644 index 0000000000..64c0c08dbc --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Delete all SKU files.yml @@ -0,0 +1,56 @@ +info: + name: Delete all SKU files + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all SKU image files. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Disassociate SKU file.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Disassociate SKU file.yml new file mode 100644 index 0000000000..128bce3fc6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Disassociate SKU file.yml @@ -0,0 +1,60 @@ +info: + name: Disassociate SKU file + type: http + seq: 8 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/disassociate/:skuId/file/:skuFileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: skuFileId + value: "32" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/disassociate/:skuId/file/:skuFileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Disassociates an SKU file from an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuFileId` | path | (Required) ID of the association of the SKU and the image, which can be obtained by placing a request to the [Get SKU file](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-sku-file) endpoint and copying the `Id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Get SKU files.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Get SKU files.yml new file mode 100644 index 0000000000..c2aa82daa3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Get SKU files.yml @@ -0,0 +1,121 @@ +info: + name: Get SKU files + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "310118490" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/file - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing SKU files information.","items":{"type":"object","description":"Object containing a SKU file information.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association of the image to the SKU."},"ArchiveId":{"type":"integer","description":"Unique identifier of the image."},"SkuId":{"type":"integer","description":"SKU unique identifier."},"Name":{"type":"string","description":"Image name."},"IsMain":{"type":"boolean","description":"Defines if the image is the SKU main image (`true`) or not (`false`). This field will always be `true` when the image `Position` is `0`, and `false` otherwise."},"Text":{"type":"string","description":"SKU image text."},"Label":{"type":["string","null"],"description":"Image label."},"Url":{"type":"string","description":"SKU image URL."},"FileLocation":{"type":"string","description":"Location where the file is stored."},"Position":{"type":"integer","description":"Position of the SKU image as displayed in the storefront, where `0` corresponds to the first position, `1` to the second position, and so on. The position `0` will always make the `isMain` value `true`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about all files in the SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 549, + "ArchiveId": 155485, + "SkuId": 310118490, + "Name": "White tshirt front", + "IsMain": true, + "Label": "fashion", + "Text": "image-b6175322abda4b73bbb57c46ae2f3900", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155485/B5C34F72E355BB325D07E56A2CBBD6FF", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 0 + }, + { + "Id": 550, + "ArchiveId": 155486, + "SkuId": 310118490, + "Name": "White tshirt left", + "IsMain": false, + "Label": "fashion", + "Text": "image-b6175322abda4b73bbb57c46ae2f7063", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155486/b6175322abda4b73bbb57c46ae2f7063", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 1 + }, + { + "Id": 551, + "ArchiveId": 155487, + "SkuId": 310118490, + "Name": "White tshirt right", + "IsMain": false, + "Label": null, + "Text": "image-b6175322abda4b73bbb57c46ae2f9368", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155487/b6175322abda4b73bbb57c46ae2f9368", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 2 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Reorder SKU files.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Reorder SKU files.yml new file mode 100644 index 0000000000..e0cc939a03 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Reorder SKU files.yml @@ -0,0 +1,69 @@ +info: + name: Reorder SKU files + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file/reorder" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "3101188" + type: path + body: + type: json + data: |- + [ + { + "Id": 6541, + "Position": 0 + }, + { + "Id": 6541, + "Position": 0 + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/reorder - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Defines SKU images positions. For the request to work properly, you must send all SKU images positions. For example, if the SKU has 10 images, you have to send in the request all file IDs and positions. There is no need to send them in order, but all positions must be defined. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | Edit Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/Update SKU file.yml b/BrunoCollections/VTEX - Catalog API/SKU file/Update SKU file.yml new file mode 100644 index 0000000000..90123527ef --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/Update SKU file.yml @@ -0,0 +1,136 @@ +info: + name: Update SKU file + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "123456" + type: path + - name: skuFileId + value: "517" + type: path + body: + type: json + data: |- + { + "Name": "Nike-Red-Janoski-1", + "Url": "https://m.media-amazon.com/images/I/610G2-sJx5L._AC_UX695_.jpg", + "IsMain": true, + "Label": "Main", + "Text": "Nike-Red-Janoski", + "Position": 0 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing SKU files information.","items":{"type":"object","description":"Object containing a SKU file information.","properties":{"Id":{"type":"integer","description":"Unique identifier of the association of the image to the SKU."},"ArchiveId":{"type":"integer","description":"Unique identifier of the image."},"SkuId":{"type":"integer","description":"SKU unique identifier."},"Name":{"type":"string","description":"Image name."},"IsMain":{"type":"boolean","description":"Defines if the image is the SKU main image (`true`) or not (`false`). This field will always be `true` when the image `Position` is `0`, and `false` otherwise."},"Text":{"type":"string","description":"SKU image text."},"Label":{"type":["string","null"],"description":"Image label."},"Url":{"type":"string","description":"SKU image URL."},"FileLocation":{"type":"string","description":"Location where the file is stored."},"Position":{"type":"integer","description":"Position of the SKU image as displayed in the storefront, where `0` corresponds to the first position, `1` to the second position, and so on. The position `0` will always make the `isMain` value `true`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a new image on an SKU based on its URL or on a form-data request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `skuFileId` | path | (Required) ID of the association of the SKU and the image, which can be obtained by placing a request to the [Get SKU file](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-sku-file) endpoint and copying the `Id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 549, + "ArchiveId": 155485, + "SkuId": 310118490, + "Name": "White tshirt front", + "IsMain": true, + "Label": "fashion", + "Text": "image-b6175322abda4b73bbb57c46ae2f3900", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155485/B5C34F72E355BB325D07E56A2CBBD6FF", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 0 + }, + { + "Id": 550, + "ArchiveId": 155486, + "SkuId": 310118490, + "Name": "White tshirt left", + "IsMain": false, + "Label": "fashion", + "Text": "image-b6175322abda4b73bbb57c46ae2f7063", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155486/b6175322abda4b73bbb57c46ae2f7063", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 1 + }, + { + "Id": 551, + "ArchiveId": 155487, + "SkuId": 310118490, + "Name": "White tshirt right", + "IsMain": false, + "Label": null, + "Text": "image-b6175322abda4b73bbb57c46ae2f9368", + "Url": "https://sandboxintegracao.vteximg.com.br/files/ids/155487/b6175322abda4b73bbb57c46ae2f9368", + "FileLocation": "vteximg.com.br/files/ids/168266/B5C34F72E355BB325D07E56A2CBBD6FF", + "Position": 2 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU file/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU file/folder.yml new file mode 100644 index 0000000000..e78da44468 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU file/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU file + type: folder + seq: 13 diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/Create SKU kit.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/Create SKU kit.yml new file mode 100644 index 0000000000..b211274b75 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/Create SKU kit.yml @@ -0,0 +1,94 @@ +info: + name: Create SKU kit + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunitkit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "StockKeepingUnitParent": 31018373, + "StockKeepingUnitId": 31018374, + "Quantity": 3, + "UnitPrice": 15.5 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/stockkeepingunitkit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunitkit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunitkit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunitkit - Schema is valid", function () { + const schema = {"type":"object","description":"SKU kit object.","properties":{"Id":{"type":"integer","description":"SKU kit ID, same as `StockKeepingUnitParent`."},"StockKeepingUnitParent":{"type":"integer","description":"Parent SKU ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID of the kit component."},"Quantity":{"type":"integer","description":"Component quantity."},"UnitPrice":{"type":"integer","description":"Component price per unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a component to a specific kit. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Miscellaneous | **SKU Bundles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 7, + "StockKeepingUnitParent": 7, + "StockKeepingUnitId": 1, + "Quantity": 1, + "UnitPrice": 50 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by SKU ID or parent SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by SKU ID or parent SKU ID.yml new file mode 100644 index 0000000000..24e4fd6d9a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by SKU ID or parent SKU ID.yml @@ -0,0 +1,62 @@ +info: + name: Delete SKU kit by SKU ID or parent SKU ID + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunitkit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: query + disabled: true + - name: parentSkuId + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunitkit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all kit's components based on the parent SKU ID or deletes a specific kit's component based on the SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Miscellaneous | **SKU Bundles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | query | SKU's unique numerical identifier. | + | `parentSkuId` | query | Parent SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by kit ID.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by kit ID.yml new file mode 100644 index 0000000000..10a436ee50 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/Delete SKU kit by kit ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete SKU kit by kit ID + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunitkit/:kitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: kitId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunitkit/:kitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific kit's component based on its kit ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Miscellaneous | **SKU Bundles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `kitId` | path | (Required) Kit's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit by SKU ID or parent SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit by SKU ID or parent SKU ID.yml new file mode 100644 index 0000000000..65dc520ebd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit by SKU ID or parent SKU ID.yml @@ -0,0 +1,96 @@ +info: + name: Get SKU kit by SKU ID or parent SKU ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunitkit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: query + disabled: true + - name: parentSkuId + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit - Schema is valid", function () { + const schema = {"type":"object","description":"SKU kit object.","properties":{"Id":{"type":"integer","description":"SKU kit ID, same as `StockKeepingUnitParent`."},"StockKeepingUnitParent":{"type":"integer","description":"Parent SKU ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID of the kit component."},"Quantity":{"type":"integer","description":"Component quantity."},"UnitPrice":{"type":"integer","description":"Component price per unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the components of an SKU kit by SKU ID or parent SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Miscellaneous | **SKU Bundles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | query | SKU's unique numerical identifier. | + | `parentSkuId` | query | Parent SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 7, + "StockKeepingUnitParent": 7, + "StockKeepingUnitId": 1, + "Quantity": 1, + "UnitPrice": 50 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit.yml new file mode 100644 index 0000000000..6510a1b834 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/Get SKU kit.yml @@ -0,0 +1,90 @@ +info: + name: Get SKU kit + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunitkit/:kitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: kitId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit/:kitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit/:kitId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit/:kitId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunitkit/:kitId - Schema is valid", function () { + const schema = {"type":"object","description":"SKU kit object.","properties":{"Id":{"type":"integer","description":"SKU kit ID, same as `StockKeepingUnitParent`."},"StockKeepingUnitParent":{"type":"integer","description":"Parent SKU ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID of the kit component."},"Quantity":{"type":"integer","description":"Component quantity."},"UnitPrice":{"type":"integer","description":"Component price per unit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about a component of a kit. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Miscellaneous | **SKU Bundles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `kitId` | path | (Required) Kit's unique numerical identifier | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 7, + "StockKeepingUnitParent": 7, + "StockKeepingUnitId": 1, + "Quantity": 1, + "UnitPrice": 50 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU kit/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU kit/folder.yml new file mode 100644 index 0000000000..6ae8937648 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU kit/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU kit + type: folder + seq: 14 diff --git a/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with SKU ID.yml new file mode 100644 index 0000000000..a8634e0692 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with SKU ID.yml @@ -0,0 +1,81 @@ +info: + name: Change notification with SKU ID + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/skuseller/changenotification/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "10" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog_system/pvt/skuseller/changenotification/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ Check out the updated version of this endpoint in our [SKU Bindings API documentation](https://developers.vtex.com/docs/api-reference/sku-bindings-api#post-/sku-binding/pvt/skuseller/changenotification/-skuId-). If you are doing this integration for the first time, we recommend that you follow the updated documentation. + + The seller is responsible for suggesting new SKUs to be sold in the VTEX marketplace and also for informing the marketplace about changes in their SKUs that already exist in the marketplace. Both actions start with a catalog notification, which is made by this request. + + With this notification, the seller is telling the marketplace that something has changed about a specific SKU, like its name or description, or that this is a new SKU that the seller would like to offer to the marketplace. The body of the request should be empty. + + > ⚠️ Do not use this endpoint for price and inventory changes, because these types of updates should be notified using Marketplace API. For price changes, we recommend using the [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) endpoint. For inventory changes, use [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory). + + ## Example + + Let's say your seller has the ID `123` in the marketplace and you want to inform the marketplace that has been a change in the SKU with ID `700`. + + In this case, you would have to replace the `sellerId` parameter with the value `123` and the `skuId` parameter with the value `700`. The URL of the request would be the following. + + ``` + https://{{accountName}}.vtexcommercestable.com.br/api/catalog_system/pvt/skuseller/changenotification/123/700 + ``` + + ## Response codes + + The following response codes are possible for this request. + + * **404:** the SKU was not found in the marketplace. The body of the response, in this case, should follow this format: "Seller StockKeepingUnit `{{skuId}}` not found for this seller id `{{sellerId}}`". This means that the seller can now proceed with sending an offer to the marketplace in order to suggest that this SKU is sold there. + * **200:** the SKU whose ID was informed in the URL already exists in the marketplace and was found. The marketplace can now proceed with a fulfillment simulation in order to get updated information about this SKU's inventory and price. + * **429:** Failure due to too many requests. + * **403:** Failure in the authentication. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Marketplace | **Seller SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use to look for the SKU whose change the seller wants to inform. If the marketplace finds this ID, it responds with status code 200. Otherwise, it responds with status code 404. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with seller ID and seller SKU ID.yml b/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with seller ID and seller SKU ID.yml new file mode 100644 index 0000000000..295f74e01c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU seller/Change notification with seller ID and seller SKU ID.yml @@ -0,0 +1,73 @@ +info: + name: Change notification with seller ID and seller SKU ID + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/skuseller/changenotification/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: "101" + type: path + - name: sellerSkuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog_system/pvt/skuseller/changenotification/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog_system/pvt/skuseller/changenotification/:sellerId/:sellerSkuId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ Check out the updated version of this endpoint in our [SKU Bindings API documentation](https://developers.vtex.com/docs/api-reference/sku-bindings-api#post-/sku-binding/pvt/skuseller/changenotification/-sellerId-/-sellerSkuId-). If you are doing this integration for the first time, we recommend that you follow the updated documentation. + + The seller is responsible for suggesting new SKUs to be sold in the VTEX marketplace and also for informing the marketplace about changes in their SKUs that already exist in the marketplace. Both actions start with a catalog notification, which is made by this request. + + With this notification, the seller is telling the marketplace that something has changed about a specific SKU, like price or inventory, or that this is a new SKU that the seller would like to offer to the marketplace. + + There are two information expected by the marketplace in this request: the `sellerId`, which identifies the seller, and the `sellerSkuId`, which identifies the binding of the seller with the SKU. + + Both information are passed through the request URL. The body of the request should be empty. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Marketplace | **Seller SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) ID of the binding of the seller with the SKU. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU seller/Get details of a seller's SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU seller/Get details of a seller's SKU.yml new file mode 100644 index 0000000000..79b8051aff --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU seller/Get details of a seller's SKU.yml @@ -0,0 +1,100 @@ +info: + name: Get details of a seller's SKU + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: "101" + type: path + - name: sellerSkuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId - Schema is valid", function () { + const schema = {"type":"object","required":["IsPersisted","IsRemoved","SkuSellerId","SellerId","StockKeepingUnitId","SellerStockKeepingUnitId","IsActive","UpdateDate","RequestedUpdateDate"],"properties":{"IsPersisted":{"type":"boolean","description":"Defines if the seller is persisted."},"IsRemoved":{"type":"boolean","description":"Defines if the seller is removed."},"SkuSellerId":{"type":"integer","format":"int32","description":"SKU ID in the seller's store."},"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","format":"int32","description":"SKU ID in the VTEX marketplace."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU seller ID."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."},"UpdateDate":{"type":"string","description":"Date when the SKU binding was updated for the last time, in UTC format."},"RequestedUpdateDate":{"type":["string","null"],"description":"Date when an SKU binding update was requested for the last time, in UTC format."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ Check out the updated version of this endpoint in our [SKU Bindings API documentation](https://developers.vtex.com/docs/api-reference/sku-bindings-api#get-/sku-binding/pvt/skuseller/-sellerId-/-sellerSkuId-). If you are doing this integration for the first time, we recommend that you follow the updated documentation. + + Retrieves the details of a seller's SKU given a seller ID and the SKU ID in the seller's store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Marketplace | **Seller SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "IsPersisted": true, + "IsRemoved": false, + "SkuSellerId": 799, + "SellerId": "myseller", + "StockKeepingUnitId": 50, + "SellerStockKeepingUnitId": "502", + "IsActive": true, + "UpdateDate": "2018-10-11T04:52:42.1", + "RequestedUpdateDate": null + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU seller/Remove a seller's SKU binding.yml b/BrunoCollections/VTEX - Catalog API/SKU seller/Remove a seller's SKU binding.yml new file mode 100644 index 0000000000..b9ddb84cf8 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU seller/Remove a seller's SKU binding.yml @@ -0,0 +1,62 @@ +info: + name: Remove a seller's SKU binding + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/skuseller/remove/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: "101" + type: path + - name: sellerSkuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog_system/pvt/skuseller/remove/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ Check out the updated version of this endpoint in our [SKU Bindings API documentation](https://developers.vtex.com/docs/api-reference/sku-bindings-api#post-/sku-binding/pvt/skuseller/remove/-sellerId-/-sellerSkuId-). If you are doing this integration for the first time, we recommend that you follow the updated documentation. + + Remove a seller's SKU binding, given the seller ID and the SKU ID in the seller's store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Marketplace | **Seller SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU seller/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU seller/folder.yml new file mode 100644 index 0000000000..7209a03413 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU seller/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU seller + type: folder + seq: 31 diff --git a/BrunoCollections/VTEX - Catalog API/SKU service attachment/Associate SKU service attachment.yml b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Associate SKU service attachment.yml new file mode 100644 index 0000000000..329b95f98e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Associate SKU service attachment.yml @@ -0,0 +1,90 @@ +info: + name: Associate SKU service attachment + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skuservicetypeattachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "AttachmentId": 1, + "SkuServiceTypeId": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skuservicetypeattachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skuservicetypeattachment - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skuservicetypeattachment - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skuservicetypeattachment - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU service type attachment association ID."},"AttachmentId":{"type":"integer","description":"Attachment ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates an Attachment for an existing SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "AttachmentId": 1, + "SkuServiceTypeId": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment by attachment ID or SKU service type ID.yml b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment by attachment ID or SKU service type ID.yml new file mode 100644 index 0000000000..31a0530889 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment by attachment ID or SKU service type ID.yml @@ -0,0 +1,62 @@ +info: + name: Dissociate attachment by attachment ID or SKU service type ID + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuservicetypeattachment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: attachmentId + value: "1" + type: query + disabled: true + - name: skuServiceTypeId + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuservicetypeattachment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Dissociates an attachment by its attachment ID or SKU service type ID from an SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `attachmentId` | query | SKU service attachment unique identifier. | + | `skuServiceTypeId` | query | SKU service type unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment from SKU service type.yml b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment from SKU service type.yml new file mode 100644 index 0000000000..d1c6588098 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service attachment/Dissociate attachment from SKU service type.yml @@ -0,0 +1,56 @@ +info: + name: Dissociate attachment from SKU service type + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuservicetypeattachment/:skuServiceTypeAttachmentId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeAttachmentId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuservicetypeattachment/:skuServiceTypeAttachmentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Dissociates an attachment from an SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeAttachmentId` | path | (Required) SKU service attachment unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU service attachment/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU service attachment/folder.yml new file mode 100644 index 0000000000..5aea39da0c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service attachment/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU service attachment + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Catalog API/SKU service type/Create SKU service type.yml b/BrunoCollections/VTEX - Catalog API/SKU service type/Create SKU service type.yml new file mode 100644 index 0000000000..4486ec7180 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service type/Create SKU service type.yml @@ -0,0 +1,102 @@ +info: + name: Create SKU service type + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Engraving", + "IsActive": true, + "ShowOnProductFront": false, + "ShowOnCartFront": false, + "ShowOnAttachmentFront": false, + "ShowOnFileUpload": false, + "IsGiftCard": false, + "IsRequired": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skuservicetype - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skuservicetype - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skuservicetype - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skuservicetype - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service type name. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service type is active or not."},"ShowOnProductFront":{"type":"boolean","description":"Deprecated field."},"ShowOnCartFront":{"type":"boolean","description":"Defines if the SKU service type is displayed on the cart screen."},"ShowOnAttachmentFront":{"type":"boolean","description":"Defines if the SKU service type has an attachment.","default":false},"ShowOnFileUpload":{"type":"boolean","description":"Defines if the SKU service type can be associated with an attachment or not.","default":false},"IsGiftCard":{"type":"boolean","description":"Defines if the SKU service type is displayed as a Gift Card.","default":false},"IsRequired":{"type":"boolean","description":"Defines if the SKU service type is mandatory.","default":false}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU type management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "Name": "Engraving", + "IsActive": true, + "ShowOnProductFront": true, + "ShowOnCartFront": true, + "ShowOnAttachmentFront": true, + "ShowOnFileUpload": true, + "IsGiftCard": true, + "IsRequired": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service type/Delete SKU service type.yml b/BrunoCollections/VTEX - Catalog API/SKU service type/Delete SKU service type.yml new file mode 100644 index 0000000000..a242b15e94 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service type/Delete SKU service type.yml @@ -0,0 +1,56 @@ +info: + name: Delete SKU service type + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype/:skuServiceTypeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU type management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeId` | path | (Required) SKU service type unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU service type/Get SKU service type.yml b/BrunoCollections/VTEX - Catalog API/SKU service type/Get SKU service type.yml new file mode 100644 index 0000000000..f89e08c982 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service type/Get SKU service type.yml @@ -0,0 +1,94 @@ +info: + name: Get SKU service type + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype/:skuServiceTypeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service type name. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service type is active or not."},"ShowOnProductFront":{"type":"boolean","description":"Deprecated field."},"ShowOnCartFront":{"type":"boolean","description":"Defines if the SKU service type is displayed on the cart screen."},"ShowOnAttachmentFront":{"type":"boolean","description":"Defines if the SKU service type has an attachment.","default":false},"ShowOnFileUpload":{"type":"boolean","description":"Defines if the SKU service type can be associated with an attachment or not.","default":false},"IsGiftCard":{"type":"boolean","description":"Defines if the SKU service type is displayed as a Gift Card.","default":false},"IsRequired":{"type":"boolean","description":"Defines if the SKU service type is mandatory.","default":false}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about an existing SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU type management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeId` | path | (Required) SKU service type unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "Name": "Test API SKU services", + "IsActive": true, + "ShowOnProductFront": true, + "ShowOnCartFront": true, + "ShowOnAttachmentFront": true, + "ShowOnFileUpload": true, + "IsGiftCard": true, + "IsRequired": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service type/Update SKU service type.yml b/BrunoCollections/VTEX - Catalog API/SKU service type/Update SKU service type.yml new file mode 100644 index 0000000000..4672965109 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service type/Update SKU service type.yml @@ -0,0 +1,107 @@ +info: + name: Update SKU service type + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservicetype/:skuServiceTypeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceTypeId + value: "1" + type: path + body: + type: json + data: |- + { + "Name": "Engraving", + "IsActive": true, + "ShowOnProductFront": false, + "ShowOnCartFront": false, + "ShowOnAttachmentFront": false, + "ShowOnFileUpload": false, + "IsGiftCard": false, + "IsRequired": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/skuservicetype/:skuServiceTypeId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service type name. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service type is active or not."},"ShowOnProductFront":{"type":"boolean","description":"Deprecated field."},"ShowOnCartFront":{"type":"boolean","description":"Defines if the SKU service type is displayed on the cart screen."},"ShowOnAttachmentFront":{"type":"boolean","description":"Defines if the SKU service type has an attachment.","default":false},"ShowOnFileUpload":{"type":"boolean","description":"Defines if the SKU service type can be associated with an attachment or not.","default":false},"IsGiftCard":{"type":"boolean","description":"Defines if the SKU service type is displayed as a Gift Card.","default":false},"IsRequired":{"type":"boolean","description":"Defines if the SKU service type is mandatory.","default":false}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU type management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceTypeId` | path | (Required) SKU service type unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "Name": "Engraving", + "IsActive": true, + "ShowOnProductFront": true, + "ShowOnCartFront": true, + "ShowOnAttachmentFront": true, + "ShowOnFileUpload": true, + "IsGiftCard": true, + "IsRequired": true + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service type/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU service type/folder.yml new file mode 100644 index 0000000000..c7a6fcdabd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service type/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU service type + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Catalog API/SKU service value/Create SKU service value.yml b/BrunoCollections/VTEX - Catalog API/SKU service value/Create SKU service value.yml new file mode 100644 index 0000000000..b9461cbcf0 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service value/Create SKU service value.yml @@ -0,0 +1,94 @@ +info: + name: Create SKU service value + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skuservicevalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skuservicevalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skuservicevalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skuservicevalue - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","required":["SkuServiceTypeId","Name","Value","Cost"],"properties":{"Id":{"type":"integer","description":"SKU service value ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service value name. Maximum of 100 characters."},"Value":{"type":"number","description":"SKU service value value."},"Cost":{"type":"number","description":"SKU service value cost."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates an SKU service value for an existing SKU service type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service value/Delete SKU service value.yml b/BrunoCollections/VTEX - Catalog API/SKU service value/Delete SKU service value.yml new file mode 100644 index 0000000000..06b0605e68 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service value/Delete SKU service value.yml @@ -0,0 +1,56 @@ +info: + name: Delete SKU service value + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue/:skuServiceValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceValueId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing SKU service value. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceValueId` | path | (Required) SKU service value unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU service value/Get SKU service value.yml b/BrunoCollections/VTEX - Catalog API/SKU service value/Get SKU service value.yml new file mode 100644 index 0000000000..5c0d394538 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service value/Get SKU service value.yml @@ -0,0 +1,90 @@ +info: + name: Get SKU service value + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue/:skuServiceValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceValueId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","required":["SkuServiceTypeId","Name","Value","Cost"],"properties":{"Id":{"type":"integer","description":"SKU service value ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service value name. Maximum of 100 characters."},"Value":{"type":"number","description":"SKU service value value."},"Cost":{"type":"number","description":"SKU service value cost."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an existing SKU service value. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceValueId` | path | (Required) SKU service value unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service value/Update SKU service value.yml b/BrunoCollections/VTEX - Catalog API/SKU service value/Update SKU service value.yml new file mode 100644 index 0000000000..70416eea45 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service value/Update SKU service value.yml @@ -0,0 +1,99 @@ +info: + name: Update SKU service value + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservicevalue/:skuServiceValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceValueId + value: "1" + type: path + body: + type: json + data: |- + { + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/skuservicevalue/:skuServiceValueId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","required":["SkuServiceTypeId","Name","Value","Cost"],"properties":{"Id":{"type":"integer","description":"SKU service value ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"Name":{"type":"string","description":"SKU service value name. Maximum of 100 characters."},"Value":{"type":"number","description":"SKU service value value."},"Cost":{"type":"number","description":"SKU service value cost."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing SKU service value. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceValueId` | path | (Required) SKU service value unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 2, + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service value/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU service value/folder.yml new file mode 100644 index 0000000000..c3e0f298aa --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service value/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU service value + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Catalog API/SKU service/Associate SKU service.yml b/BrunoCollections/VTEX - Catalog API/SKU service/Associate SKU service.yml new file mode 100644 index 0000000000..9cc86612ed --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service/Associate SKU service.yml @@ -0,0 +1,98 @@ +info: + name: Associate SKU service + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/skuservice" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "SkuServiceTypeId": 1, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "Engraving", + "Text": "Name engraving additional service.", + "IsActive": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/skuservice - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/skuservice - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/skuservice - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/skuservice - Schema is valid", function () { + const schema = {"type":"object","description":"SKU service information.","properties":{"Id":{"type":"integer","description":"SKU service ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"SkuServiceValueId":{"type":"integer","description":"SKU service value ID."},"SkuId":{"type":"integer","description":"SKU ID."},"Name":{"type":"string","description":"SKU service name. Maximum of 50 characters."},"Text":{"type":"string","description":"Internal description of the SKU service. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service is active or not."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates an SKU service to an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "SkuServiceTypeId": 1, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "name", + "Text": "text", + "IsActive": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service/Dissociate SKU service.yml b/BrunoCollections/VTEX - Catalog API/SKU service/Dissociate SKU service.yml new file mode 100644 index 0000000000..a64a5a5dd1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service/Dissociate SKU service.yml @@ -0,0 +1,56 @@ +info: + name: Dissociate SKU service + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/skuservice/:skuServiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/skuservice/:skuServiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Dissociates an SKU service from an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceId` | path | (Required) SKU service unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU service/Get SKU service.yml b/BrunoCollections/VTEX - Catalog API/SKU service/Get SKU service.yml new file mode 100644 index 0000000000..279cee04b6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service/Get SKU service.yml @@ -0,0 +1,92 @@ +info: + name: Get SKU service + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/skuservice/:skuServiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceId + value: "5" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/skuservice/:skuServiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuServiceId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuServiceId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/skuservice/:skuServiceId - Schema is valid", function () { + const schema = {"type":"object","description":"SKU service information.","properties":{"Id":{"type":"integer","description":"SKU service ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"SkuServiceValueId":{"type":"integer","description":"SKU service value ID."},"SkuId":{"type":"integer","description":"SKU ID."},"Name":{"type":"string","description":"SKU service name. Maximum of 50 characters."},"Text":{"type":"string","description":"Internal description of the SKU service. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service is active or not."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an SKU service. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceId` | path | (Required) SKU service unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "SkuServiceTypeId": 1, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "name", + "Text": "text", + "IsActive": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service/Update SKU service.yml b/BrunoCollections/VTEX - Catalog API/SKU service/Update SKU service.yml new file mode 100644 index 0000000000..acc100919c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service/Update SKU service.yml @@ -0,0 +1,103 @@ +info: + name: Update SKU service + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/skuservice/:skuServiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuServiceId + value: "5" + type: path + body: + type: json + data: |- + { + "SkuServiceTypeId": 2, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "Test name", + "Text": "Text", + "IsActive": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/skuservice/:skuServiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/skuservice/:skuServiceId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/skuservice/:skuServiceId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/skuservice/:skuServiceId - Schema is valid", function () { + const schema = {"type":"object","description":"SKU service information.","properties":{"Id":{"type":"integer","description":"SKU service ID."},"SkuServiceTypeId":{"type":"integer","description":"SKU service type ID."},"SkuServiceValueId":{"type":"integer","description":"SKU service value ID."},"SkuId":{"type":"integer","description":"SKU ID."},"Name":{"type":"string","description":"SKU service name. Maximum of 50 characters."},"Text":{"type":"string","description":"Internal description of the SKU service. Maximum of 100 characters."},"IsActive":{"type":"boolean","description":"Defines if the SKU service is active or not."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an SKU service. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU Services** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuServiceId` | path | (Required) SKU service unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "SkuServiceTypeId": 1, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "name", + "Text": "text", + "IsActive": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU service/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU service/folder.yml new file mode 100644 index 0000000000..0c6a1b1293 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU service/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU service + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification using specification name and group name.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification using specification name and group name.yml new file mode 100644 index 0000000000..6696054a02 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification using specification name and group name.yml @@ -0,0 +1,103 @@ +info: + name: Associate SKU specification using specification name and group name + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + body: + type: json + data: |- + { + "FieldName": "Size", + "GroupName": "Sizes", + "RootLevelSpecification": true, + "FieldValues": [ + "M" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue - Schema is valid", function () { + const schema = {"type":"array","description":"Array with information of all SKU specifications.","items":{"type":"object","description":"Object with information of the specification.","properties":{"Id":{"type":"integer","description":"ID of the association of the SKU and the specification."},"SkuId":{"type":"integer","description":"SKU ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Current specification value ID."},"Text":{"type":"string","description":"Current specification value text."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a specification to an SKU using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 418, + "SkuId": 5, + "FieldId": 29, + "FieldValueId": 76, + "Text": "M" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification.yml new file mode 100644 index 0000000000..ca6c7f3b16 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Associate SKU specification.yml @@ -0,0 +1,97 @@ +info: + name: Associate SKU specification + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1234568387" + type: path + body: + type: json + data: |- + { + "FieldId": 13, + "FieldValueId": 101 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"ID of the association of the specification and the SKU. This ID is used to update or delete the specification."},"SkuId":{"type":"integer","description":"SKU ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Specification value ID. Required only for `FieldTypeId` as `5`, `6` and `7`."},"Text":{"type":"string","description":"Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a previously created specification to an SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1505, + "SkuId": 1234568387, + "FieldId": 193, + "FieldValueId": 360, + "Text": "Size 10" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Delete SKU specification.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Delete SKU specification.yml new file mode 100644 index 0000000000..f7dcbabba7 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Delete SKU specification.yml @@ -0,0 +1,60 @@ +info: + name: Delete SKU specification + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specification/:specificationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: specificationId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/specification/:specificationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific SKU specification. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `specificationId` | path | (Required) Specification's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Delete all SKU specifications.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Delete all SKU specifications.yml new file mode 100644 index 0000000000..7d85fbee78 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Delete all SKU specifications.yml @@ -0,0 +1,56 @@ +info: + name: Delete all SKU specifications + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all SKU specifications. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Get SKU specifications.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Get SKU specifications.yml new file mode 100644 index 0000000000..469cfe09af --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Get SKU specifications.yml @@ -0,0 +1,92 @@ +info: + name: Get SKU specifications + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"ID of the association of the specification and the SKU. This ID is used to update or delete the specification."},"SkuId":{"type":"integer","description":"SKU ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Specification value ID. Required only for `FieldTypeId` as `5`, `6` and `7`."},"Text":{"type":"string","description":"Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about an SKU's specifications. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1505, + "SkuId": 1234568387, + "FieldId": 193, + "FieldValueId": 360, + "Text": "Size 10" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/Update SKU specification.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/Update SKU specification.yml new file mode 100644 index 0000000000..7135fa5c29 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/Update SKU specification.yml @@ -0,0 +1,102 @@ +info: + name: Update SKU specification + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "21" + type: path + body: + type: json + data: |- + { + "Id": 65, + "FieldId": 32, + "FieldValueId": 131, + "SkuId": 21, + "Text": "Red" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId/specification - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"ID of the association of the specification and the SKU. This ID is used to update or delete the specification."},"SkuId":{"type":"integer","description":"SKU ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"FieldValueId":{"type":"integer","description":"Specification value ID. Required only for `FieldTypeId` as `5`, `6` and `7`."},"Text":{"type":"string","description":"Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing specification on an existing SKU. This endpoint only updates the `FieldValueId`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1505, + "SkuId": 1234568387, + "FieldId": 193, + "FieldValueId": 360, + "Text": "Size 10" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU specification/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU specification/folder.yml new file mode 100644 index 0000000000..09493f1c3a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU specification + type: folder + seq: 15 diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Create SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU/Create SKU.yml new file mode 100644 index 0000000000..67345de6be --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Create SKU.yml @@ -0,0 +1,143 @@ +info: + name: Create SKU + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "ProductId": 42, + "Name": "Size 10", + "PackagedHeight": 10, + "PackagedLength": 10, + "PackagedWidth": 10, + "PackagedWeightKg": 10, + "Id": 1, + "IsActive": false, + "ActivateIfPossible": true, + "RefId": "B096QW8Y8Z", + "Height": 1, + "Length": 1, + "Width": 1, + "WeightKg": 1, + "CubicWeight": 0.1667, + "IsKit": false, + "CreationDate": "2020-01-25T15:51:29.2614605", + "RewardValue": 1, + "EstimatedDateArrival": null, + "ManufacturerCode": "123", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [ + "https://www.youtube.com/" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/stockkeepingunit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/stockkeepingunit - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU unique identifier."},"ProductId":{"type":"integer","description":"ID of the product associated with this SKU."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active (`true`) or not (`false`)."},"ActivateIfPossible":{"type":"boolean","description":"When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component."},"Name":{"type":"string","description":"SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_."},"RefId":{"type":"string","description":"Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well."},"PackagedHeight":{"type":"number","description":"Height used for shipping calculation."},"PackagedLength":{"type":"number","description":"Length used for shipping calculation."},"PackagedWidth":{"type":"number","description":"Width used for shipping calculation."},"PackagedWeightKg":{"type":"integer","description":"Weight used for shipping calculation, in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"Height":{"type":"number","description":"SKU real height."},"Length":{"type":"number","description":"SKU real length."},"Width":{"type":"number","description":"SKU real width."},"WeightKg":{"type":"number","description":"Weight of the SKU in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"CubicWeight":{"type":"number","description":"[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"CreationDate":{"type":"string","description":"Date and time of the SKU's creation."},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"CommercialConditionId":{"type":"integer","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `'un'`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KitItensSellApart":{"type":"boolean","description":"Defines if kit components can be sold apart."},"Videos":{"type":"array","description":"Videos URLs.","items":{"type":"string","description":"Video URL."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new SKU. + + If there is a need to create a new SKU with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 70, + "ProductId": 42, + "IsActive": false, + "ActivateIfPossible": false, + "Name": "Size 10", + "RefId": "B096QW8Y8Z", + "PackagedHeight": 10, + "PackagedLength": 10, + "PackagedWidth": 10, + "PackagedWeightKg": 10, + "Height": 1, + "Length": 1, + "Width": 1, + "WeightKg": 1, + "CubicWeight": 0.1667, + "IsKit": false, + "CreationDate": "2020-01-25T15:51:29.2614605", + "RewardValue": 0, + "EstimatedDateArrival": null, + "ManufacturerCode": "", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [ + "https://www.youtube.com/" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU ID by reference ID.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU ID by reference ID.yml new file mode 100644 index 0000000000..9ab04e0e5e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU ID by reference ID.yml @@ -0,0 +1,84 @@ +info: + name: Get SKU ID by reference ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: refId + value: "0001" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId - Schema is valid", function () { + const schema = {"type":"string","description":"SKU ID."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an SKU ID by the SKU's reference ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `refId` | path | (Required) SKU reference ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1 + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU and context.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU and context.yml new file mode 100644 index 0000000000..07c7e7718b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU and context.yml @@ -0,0 +1,90 @@ +info: + name: Get SKU and context + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: skuId + value: "2001773" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId - Schema is valid", function () { + const schema = {"required":["Id","ProductId","NameComplete","ProductName","ProductDescription","SkuName","IsActive","IsTransported","IsInventoried","IsGiftCardRecharge","ImageUrl","DetailUrl","CSCIdentification","BrandId","BrandName","Dimension","RealDimension","ManufacturerCode","IsKit","KitItems","Services","Categories","Attachments","Collections","SkuSellers","SalesChannels","Images","SkuSpecifications","ProductSpecifications","ProductClustersIds","ProductCategoryIds","ProductGlobalCategoryId","ProductCategories","CommercialConditionId","RewardValue","AlternateIds","AlternateIdValues","EstimatedDateArrival","MeasurementUnit","UnitMultiplier","InformationSource","ModalType"],"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","format":"int32","description":"SKU ID."},"ProductId":{"type":"integer","format":"int32","description":"ID of the related product."},"NameComplete":{"type":"string","description":"Product Name and SKU Name concatenated."},"ComplementName":{"type":"string","description":"Product Complement Name."},"ProductName":{"type":"string","description":"Product Name."},"ProductDescription":{"type":"string","description":"Product Description. HTML is allowed."},"ProductRefId":{"type":"string","description":"Reference ID of the related product."},"TaxCode":{"type":"string","description":"SKU Tax Code."},"SkuName":{"type":"string","description":"SKU Name."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active or not."},"IsTransported":{"type":["boolean","null"],"description":"Deprecated field."},"IsInventoried":{"type":["boolean","null"],"description":"Deprecated field."},"IsGiftCardRecharge":{"type":"boolean","description":"Defines if the purchase will generate a reward."},"ImageUrl":{"type":"string","description":"SKU image URL."},"DetailUrl":{"type":"string","description":"Product URL."},"CSCIdentification":{"type":["string","null"],"description":"SKU seller identification."},"BrandId":{"type":"string","description":"Product brand ID."},"BrandName":{"type":"string","description":"Product brand Name."},"Dimension":{"required":["cubicweight","height","length","weight","width"],"type":"object","description":"Object containing the SKU dimensions to be used on the shipping calculation.","properties":{"cubicweight":{"type":"number","description":"SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."},"weight":{"type":"number","description":"SKU weight."},"width":{"type":"number","description":"SKU width."}}},"RealDimension":{"required":["realCubicWeight","realHeight","realLength","realWeight","realWidth"],"type":"object","description":"Object containing the real SKU dimensions, which appear in the product page.","properties":{"realCubicWeight":{"type":"number","description":"Real SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"realHeight":{"type":"number","description":"Real SKU height."},"realLength":{"type":"number","description":"Real SKU length."},"realWeight":{"type":"number","description":"Real SKU weight."},"realWidth":{"type":"number","description":"Real SKU width."}}},"ManufacturerCode":{"type":"string","description":"Product Supplier ID."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"KitItems":{"type":"array","items":{"type":"string","description":"SKU ID."},"description":"Array with SKU IDs of bundle components."},"Services":{"type":"array","items":{"type":"string","description":"Service ID."},"description":"Array with Service IDs that are related to the SKU."},"Categories":{"type":"array","items":{"type":"string","description":"Category ID."},"description":"Array with Categories from the related product."},"Attachments":{"type":"array","items":{"required":["Id","Name","Keys","Fields","IsActive","IsRequired"],"type":"object","description":"Object containing information about SKU attachments.","properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"Keys":{"type":"array","items":{"type":"string","description":"Each attachment key."},"description":"Attachment Keys."},"Fields":{"type":"array","items":{"required":["FieldName","MaxCaracters","DomainValues"],"type":"object","description":"Object with field details.","properties":{"FieldName":{"type":"string","description":"Attachment field name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters accepted in the attachment field."},"DomainValues":{"type":["string","null"],"description":"Allowed key values."}}},"description":"Array containing attachment fields."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."}}},"description":"Array with Attachments ID that are related to the SKU."},"Collections":{"type":"array","items":{"type":"string","description":"Collection ID."},"description":"Array with Collection IDs that are related to the product."},"SkuSellers":{"type":"array","items":{"required":["SellerId","StockKeepingUnitId","SellerStockKeepingUnitId","IsActive","FreightCommissionPercentage","ProductCommissionPercentage"],"type":"object","description":"Object containing related SKU sellers data.","properties":{"SellerId":{"type":"string","description":"SKU seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID for the SKU seller."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active."},"FreightCommissionPercentage":{"type":"number","description":"Registered value for Seller Freight Commission."},"ProductCommissionPercentage":{"type":"number","description":"Registered value for Seller product Commission."}}},"description":"Array with SKU sellers data."},"SalesChannels":{"type":"array","items":{"type":"integer","description":"Sales channel ID."},"description":"Array with the ID of all the sales channels that are related to the product."},"Images":{"type":"array","items":{"required":["ImageUrl","ImageName","FileId"],"type":"object","description":"Object containing SKU images details.","properties":{"ImageUrl":{"type":"string","description":"Image URL."},"ImageName":{"type":["string","null"],"description":"Image label."},"FileId":{"type":"integer","format":"int32","description":"SKU image ID."}}},"description":"Array with SKU images."},"SkuSpecifications":{"type":"array","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object containing related SKU specifications.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification field Name."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}},"description":"Array with related SKU specifications."},"ProductSpecifications":{"type":"array","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object with product specification details.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification name. Limited to 100 characters."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}},"description":"Array with related product specifications."},"ProductClustersIds":{"type":"string","description":"Product clusters IDs."},"ProductCategoryIds":{"type":"string","description":"Category hierarchy with category IDs."},"ProductGlobalCategoryId":{"type":["integer","null"],"description":"Global category ID."},"ProductCategories":{"type":"object","description":"Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\".","additionalProperties":{"type":"string","description":"Category ID.","additionalProperties":{"type":"string","description":"Category name."}}},"CommercialConditionId":{"type":"integer","format":"int32","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"AlternateIds":{"type":"object","description":"Array with alternate SKU IDs, such as EAN and `RefId`.","properties":{"Ean":{"type":"string","description":"SKU EAN."},"RefId":{"type":"string","description":"SKU reference ID."}}},"AlternateIdValues":{"type":"array","items":{"type":"string","description":"Alternative SKU ID."},"description":"Array with values of alternative SKU IDs."},"EstimatedDateArrival":{"type":["string","null"],"description":"To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date."},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"InformationSource":{"type":["string","null"],"description":"Information source."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KeyWords":{"type":["string","null"],"description":"Keywords related to the product."},"ReleaseDate":{"type":["string","null"],"description":"Release date of the product."},"ProductIsVisible":{"type":"boolean","description":"Defines if the product is visible or not."},"ShowIfNotAvailable":{"type":"boolean","description":"Defines if the product will be shown if it is not available."},"IsProductActive":{"type":"boolean","description":"Defines if the product is active or not."},"ProductFinalScore":{"type":"integer","description":"Product final score."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves context of an SKU. + > 📘 Onboarding guide + > + > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique identifier number. | + | `sc` | query | Sales channel's unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by alternate ID.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by alternate ID.yml new file mode 100644 index 0000000000..ecb42d3a14 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by alternate ID.yml @@ -0,0 +1,193 @@ +info: + name: Get SKU by alternate ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternateId + value: "10" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId - Schema is valid", function () { + const schema = {"required":["Id","ProductId","NameComplete","ProductName","ProductDescription","SkuName","IsActive","IsTransported","IsInventoried","IsGiftCardRecharge","ImageUrl","DetailUrl","CSCIdentification","BrandId","BrandName","Dimension","RealDimension","ManufacturerCode","IsKit","KitItems","Services","Categories","Attachments","Collections","SkuSellers","SalesChannels","Images","SkuSpecifications","ProductSpecifications","ProductClustersIds","ProductCategoryIds","ProductGlobalCategoryId","ProductCategories","CommercialConditionId","RewardValue","AlternateIds","AlternateIdValues","EstimatedDateArrival","MeasurementUnit","UnitMultiplier","InformationSource","ModalType"],"type":"object","description":"Object with the response.","properties":{"Id":{"type":"integer","description":"SKU ID."},"ProductId":{"type":"integer","description":"Product ID."},"NameComplete":{"type":"string","description":"Product name and SKU name combined."},"ComplementName":{"type":"string","description":"Product complement name."},"ProductName":{"type":"string","description":"Product name."},"ProductDescription":{"type":"string","description":"Product description. HTML is allowed."},"ProductRefId":{"type":"string","description":"Product reference ID."},"TaxCode":{"type":"string","description":"SKU tax code."},"SkuName":{"type":"string","description":"SKU name."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active or not."},"IsTransported":{"type":"boolean","description":"Deprecated field."},"IsInventoried":{"type":"boolean","description":"Deprecated field."},"IsGiftCardRecharge":{"type":"boolean","description":"Defines if the purchase of the SKU will generate reward value for the customer."},"ImageUrl":{"type":"string","description":"SKU image URL."},"DetailUrl":{"type":"string","description":"Product slug."},"CSCIdentification":{"type":["string","null"],"description":"SKU seller identification."},"BrandId":{"type":"string","description":"Brand ID."},"BrandName":{"type":"string","description":"Brand name."},"Dimension":{"required":["cubicweight","height","length","weight","width"],"type":"object","description":"Object containing the SKU dimensions to be used on the shipping calculation.","properties":{"cubicweight":{"type":"number","description":"SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"height":{"type":"number","description":"SKU height."},"length":{"type":"number","description":"SKU length."},"weight":{"type":"number","description":"SKU weight."},"width":{"type":"number","description":"SKU width."}}},"RealDimension":{"required":["realCubicWeight","realHeight","realLength","realWeight","realWidth"],"type":"object","description":"Object containing the real SKU dimensions, which appear in the product page.","properties":{"realCubicWeight":{"type":"number","description":"Real SKU [cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"realHeight":{"type":"number","description":"Real SKU height."},"realLength":{"type":"number","description":"Real SKU length."},"realWeight":{"type":"number","description":"Real SKU weight."},"realWidth":{"type":"number","description":"Real SKU width."}}},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"KitItems":{"type":"array","description":"Array with SKU IDs of bundle components.","items":{"type":"string","description":"SKU ID of each bundle component."}},"Services":{"type":"array","description":"Array with service IDs that are related to the SKU.","items":{"type":"string","description":"Service IDs of each service related to the SKU."}},"Categories":{"type":"array","description":"Categories of the related product.","items":{"type":"string","description":"Category ID."}},"CategoriesFullPath":{"type":"array","description":"Path of categories of the related product.","items":{"type":"string","description":"Path composed by category IDs separated by `/`."}},"Attachments":{"type":"array","description":"Array with attachment IDs that are related to the product.","items":{"required":["Id","Name","Keys","Fields","IsActive","IsRequired"],"type":"object","description":"Object containing information about SKU attachments.","properties":{"Id":{"type":"integer","description":"Attachment ID."},"Name":{"type":"string","description":"Attachment name."},"Keys":{"type":"array","items":{"type":"string","description":"Each attachment key."},"description":"Attachment Keys."},"Fields":{"type":"array","items":{"required":["FieldName","MaxCaracters","DomainValues"],"type":"object","description":"Object with field details.","properties":{"FieldName":{"type":"string","description":"Attachment field name."},"MaxCaracters":{"type":"string","description":"Maximum number of characters accepted in the attachment field."},"DomainValues":{"type":["string","null"],"description":"Allowed key values."}}},"description":"Array containing attachment fields."},"IsActive":{"type":"boolean","description":"Defines if the attachment is active or not."},"IsRequired":{"type":"boolean","description":"Defines if the attachment is required or not."}}}},"Collections":{"type":"array","description":"Array with collections IDs that are related to the product.","items":{"type":"string","description":"Collection ID."}},"SkuSellers":{"type":"array","description":"Array with related sellers data.","items":{"required":["SellerId","StockKeepingUnitId","SellerStockKeepingUnitId","IsActive","FreightCommissionPercentage","ProductCommissionPercentage"],"type":"object","description":"Object containing related SKU sellers data.","properties":{"SellerId":{"type":"string","description":"SKU seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID for the SKU seller."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active."},"FreightCommissionPercentage":{"type":"number","description":"Registered value for Seller Freight Commission."},"ProductCommissionPercentage":{"type":"number","description":"Registered value for Seller product Commission."}}}},"SalesChannels":{"type":"array","description":"Array of sales channel IDs.","items":{"type":"integer","description":"Sales channel ID."}},"Images":{"type":"array","description":"Array of objects with SKU image details.","items":{"required":["ImageUrl","ImageName","FileId"],"type":"object","description":"Object containing SKU images details.","properties":{"ImageUrl":{"type":"string","description":"Image URL."},"ImageName":{"type":["string","null"],"description":"Image label."},"FileId":{"type":"integer","format":"int32","description":"SKU image ID."}}}},"SkuSpecifications":{"type":"array","description":"Array with related SKU specifications.","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object containing related SKU specifications.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification field Name."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}}},"ProductSpecifications":{"type":"array","description":"Array with related product specifications.","items":{"required":["FieldId","FieldName","FieldValueIds","FieldValues"],"type":"object","description":"Object with product specification details.","properties":{"FieldId":{"type":"integer","format":"int32","description":"Specification field ID."},"FieldName":{"type":"string","description":"Specification name. Limited to 100 characters."},"FieldValueIds":{"type":"array","items":{"type":"integer","format":"int32","description":"Specification value ID."},"description":"Array with related specification values IDs."},"FieldValues":{"type":"array","items":{"type":"string","description":"Each field value."},"description":"Array with related specification values."}}}},"ProductClustersIds":{"type":"string","description":"Product cluster IDs separated by comma (`,`)."},"PositionsInClusters":{"type":"object","description":"Product clusters position in each cluster. Structure: \"{Product cluster ID}\": {Position}.\n\n`{Product cluster ID}` is a string, while `{Position}` is an integer.","additionalProperties":{"type":"integer","description":"Product cluster ID.","additionalProperties":{"type":"integer","description":"Position."}}},"ProductClusterNames":{"type":"object","description":"Product clusters names. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster name."}}},"ProductClusterHighlights":{"type":"object","description":"Product clusters highlights. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster highlight."}}},"ProductCategoryIds":{"type":"string","description":"Category path composed by category IDs separated by `/`."},"IsDirectCategoryActive":{"type":"boolean","description":"Indicates if the direct product category is active or not."},"ProductGlobalCategoryId":{"type":["integer","null"],"description":"Product global category ID."},"ProductCategories":{"type":"object","description":"Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Category ID.","additionalProperties":{"type":"string","description":"Category name."}}},"CommercialConditionId":{"type":"integer","format":"int32","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"AlternateIds":{"type":"object","description":"Array with alternate SKU IDs, such as EAN and `RefId`.","properties":{"Ean":{"type":"string","description":"SKU EAN."},"RefId":{"type":"string","description":"SKU reference ID."}}},"AlternateIdValues":{"type":"array","description":"Array with values of alternative SKU IDs.","items":{"type":"string","description":"Alternative SKU ID."}},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"InformationSource":{"type":["string","null"],"description":"Information source."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KeyWords":{"type":["string","null"],"description":"Keywords related to the product."},"ReleaseDate":{"type":["string","null"],"description":"Release date of the product."},"ProductIsVisible":{"type":"boolean","description":"Defines if the product is visible or not."},"ShowIfNotAvailable":{"type":"boolean","description":"Defines if the product will be shown if it is not available."},"IsProductActive":{"type":"boolean","description":"Defines if the product is active or not."},"ProductFinalScore":{"type":"integer","description":"Product final score."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an SKU by its alternate ID, which can be the EAN or the reference ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `alternateId` | path | (Required) Product EAN or `RefId`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 310118450, + "ProductId": 2, + "NameComplete": "Caixa de Areia Azul Petmate sku test", + "ComplementName": "", + "ProductName": "Caixa de Areia Azul Petmate", + "ProductDescription": "", + "ProductRefId": "", + "TaxCode": "", + "SkuName": "sku test", + "IsActive": true, + "IsTransported": true, + "IsInventoried": true, + "IsGiftCardRecharge": false, + "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451-55-55/caixa-areia-azul-petmate.jpg?v=637139451191670000", + "DetailUrl": "/caixa-de-areia-azul-petmate/p", + "CSCIdentification": null, + "BrandId": "2000005", + "BrandName": "Petmate", + "IsBrandActive": true, + "Dimension": { + "cubicweight": 0.2083, + "height": 10, + "length": 10, + "weight": 10, + "width": 10 + }, + "RealDimension": { + "realCubicWeight": 0, + "realHeight": 0, + "realLength": 0, + "realWeight": 0, + "realWidth": 0 + }, + "ManufacturerCode": "123", + "IsKit": false, + "KitItems": [], + "Services": [], + "Categories": [], + "CategoriesFullPath": [ + "/3/15/", + "/3/", + "/1/" + ], + "Attachments": [], + "Collections": [], + "SkuSellers": [ + { + "SellerId": "1", + "StockKeepingUnitId": 310118450, + "SellerStockKeepingUnitId": "310118450", + "IsActive": true, + "FreightCommissionPercentage": 0, + "ProductCommissionPercentage": 0 + } + ], + "SalesChannels": [ + 1, + 3 + ], + "Images": [ + { + "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451/caixa-areia-azul-petmate.jpg?v=637139451191670000", + "ImageName": null, + "FileId": 155451 + } + ], + "Videos": [], + "SkuSpecifications": [], + "ProductSpecifications": [], + "ProductClustersIds": "151,158", + "PositionsInClusters": { + "151": 1, + "158": 2 + }, + "ProductClusterNames": { + "151": "asdfghj", + "158": "Coleção halloween" + }, + "ProductClusterHighlights": { + "151": "asdfghj" + }, + "ProductCategoryIds": "/3/15/", + "IsDirectCategoryActive": true, + "ProductGlobalCategoryId": 5000, + "ProductCategories": { + "1": "Alimentação", + "3": "Higiene", + "15": "Caixa de Areia" + }, + "CommercialConditionId": 1, + "RewardValue": 0, + "AlternateIds": { + "RefId": "1" + }, + "AlternateIdValues": [ + "1" + ], + "EstimatedDateArrival": null, + "MeasurementUnit": "un", + "UnitMultiplier": 1, + "InformationSource": null, + "ModalType": null, + "KeyWords": "", + "ReleaseDate": "2020-01-06T00:00:00Z", + "ProductIsVisible": true, + "ShowIfNotAvailable": true, + "IsProductActive": true, + "ProductFinalScore": 0 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by reference ID.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by reference ID.yml new file mode 100644 index 0000000000..bd9126975d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU by reference ID.yml @@ -0,0 +1,110 @@ +info: + name: Get SKU by reference ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit?RefId=1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: RefId + value: "1" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU unique identifier."},"ProductId":{"type":"integer","description":"ID of the product associated with this SKU."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active (`true`) or not (`false`)."},"ActivateIfPossible":{"type":"boolean","description":"When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component."},"Name":{"type":"string","description":"SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_."},"RefId":{"type":"string","description":"Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well."},"Ean":{"type":"string","description":"EAN code. Required only if `RefId` is not informed, but can be used alongside `RefId` as well."},"PackagedHeight":{"type":"number","description":"Height used for shipping calculation."},"PackagedLength":{"type":"number","description":"Length used for shipping calculation."},"PackagedWidth":{"type":"number","description":"Width used for shipping calculation."},"PackagedWeightKg":{"type":"integer","description":"Weight used for shipping calculation, in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"Height":{"type":"number","description":"SKU real height."},"Length":{"type":"number","description":"SKU real length."},"Width":{"type":"number","description":"SKU real width."},"WeightKg":{"type":"number","description":"Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"CubicWeight":{"type":"number","description":"[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"CreationDate":{"type":"string","description":"Date and time of the SKU's creation."},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"CommercialConditionId":{"type":"integer","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KitItensSellApart":{"type":"boolean","description":"Defines if kit components can be sold apart."},"Videos":{"type":"array","description":"Videos URLs.","items":{"type":"string","description":"Video URL."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a specific SKU by its `RefId`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `RefId` | query | (Required) SKU reference ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "ProductId": 1, + "IsActive": true, + "Name": "Royal Canin Feline Urinary 500g", + "RefId": "0001", + "PackagedHeight": 6, + "PackagedLength": 24, + "PackagedWidth": 14, + "PackagedWeightKg": 550, + "Height": 0, + "Length": 0, + "Width": 0, + "WeightKg": 0, + "CubicWeight": 1, + "IsKit": false, + "CreationDate": "2020-03-12T15:42:00", + "RewardValue": 0, + "EstimatedDateArrival": null, + "ManufacturerCode": "", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 1, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU list by product ID.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU list by product ID.yml new file mode 100644 index 0000000000..bcfff1f428 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU list by product ID.yml @@ -0,0 +1,126 @@ +info: + name: Get SKU list by product ID + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId - Schema is valid", function () { + const schema = {"type":"array","description":"Array with information of all SKUs with the same product ID.","items":{"type":"object","description":"Object with the response.","properties":{"IsPersisted":{"type":"boolean","description":"Defines if the SKU is persisted."},"IsRemoved":{"type":"boolean","description":"Defines if the SKU is removed."},"Id":{"type":"integer","format":"int32","description":"SKU ID."},"ProductId":{"type":"integer","format":"int32","description":"Product ID."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active or not."},"Name":{"type":"string","description":"SKU name."},"Height":{"type":"number","description":"SKU height."},"RealHeight":{"type":["number","null"],"description":"Real SKU height."},"Width":{"type":"number","description":"SKU width."},"RealWidth":{"type":["number","null"],"description":"Real SKU width."},"Length":{"type":"number","description":"SKU length."},"RealLength":{"type":["number","null"],"description":"Real SKU length."},"WeightKg":{"type":["number","null"],"description":"Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"RealWeightKg":{"type":["number","null"],"description":"Real weight of the SKU in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"ModalId":{"type":"integer","format":"int32","description":"Delivery method (modal type) ID."},"RefId":{"type":"string","description":"Product reference ID."},"CubicWeight":{"type":"number","description":"[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"IsDynamicKit":{"type":["string","null"],"description":"Deprecated field."},"InternalNote":{"type":["string","null"],"description":"Internal note."},"DateUpdated":{"type":"string","description":"Date when the product was updated for the most recent time."},"RewardValue":{"type":["number","null"],"description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"CommercialConditionId":{"type":"integer","format":"int32","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"FlagKitItensSellApart":{"type":"boolean","description":"Defines if the SKU bundle items can be sold separately."},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"ReferenceStockKeepingUnitId":{"type":["string","null"],"description":"SKU reference ID."},"Position":{"type":"integer","format":"int32","description":"SKU position."},"ActivateIfPossible":{"type":"boolean","description":"When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component."},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"IsInventoried":{"type":["boolean","null"],"description":"Deprecated field."},"IsTransported":{"type":["boolean","null"],"description":"Deprecated field."},"IsGiftCardRecharge":{"type":["boolean","null"],"description":"Defines if the purchase of the SKU will generate reward value for the customer."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"isKitOptimized":{"type":"boolean","description":"Defines if the SKU is an optimized bundle."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list with the SKUs related to a product by the product's ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "IsPersisted": true, + "IsRemoved": false, + "Id": 2000035, + "ProductId": 2000024, + "IsActive": true, + "Name": "33 - Preto", + "Height": 8, + "RealHeight": null, + "Width": 15, + "RealWidth": null, + "Length": 8, + "RealLength": null, + "WeightKg": 340, + "RealWeightKg": null, + "ModalId": 1, + "RefId": "", + "CubicWeight": 0.2, + "IsKit": false, + "IsDynamicKit": null, + "InternalNote": null, + "DateUpdated": "2015-11-06T19:10:00", + "RewardValue": 0.01, + "CommercialConditionId": 1, + "EstimatedDateArrival": null, + "FlagKitItensSellApart": false, + "ManufacturerCode": "", + "ReferenceStockKeepingUnitId": null, + "Position": 0, + "EditionSkuId": null, + "ApprovedAdminId": 123, + "EditionAdminId": 123, + "ActivateIfPossible": true, + "SupplierCode": null, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "IsInventoried": null, + "IsTransported": null, + "IsGiftCardRecharge": null, + "ModalType": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Get SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU.yml new file mode 100644 index 0000000000..b9a8eb60aa --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Get SKU.yml @@ -0,0 +1,113 @@ +info: + name: Get SKU + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/stockkeepingunit/:skuId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU unique identifier."},"ProductId":{"type":"integer","description":"ID of the product associated with this SKU."},"IsActive":{"type":"boolean","description":"Shows if the SKU is active (`true`) or not (`false`)."},"ActivateIfPossible":{"type":"boolean","description":"When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component."},"Name":{"type":"string","description":"SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_."},"RefId":{"type":"string","description":"Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided."},"PackagedHeight":{"type":"number","description":"Height used for shipping calculation."},"PackagedLength":{"type":"number","description":"Length used for shipping calculation."},"PackagedWidth":{"type":"number","description":"Width used for shipping calculation."},"PackagedWeightKg":{"type":"integer","description":"Weight used for shipping calculation, in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"Height":{"type":"number","description":"SKU real height."},"Length":{"type":"number","description":"SKU real length."},"Width":{"type":"number","description":"SKU real width."},"WeightKg":{"type":"number","description":"Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"CubicWeight":{"type":"number","description":"[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"CreationDate":{"type":"string","description":"Date and time of the SKU's creation."},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"CommercialConditionId":{"type":"integer","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445)."},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KitItensSellApart":{"type":"boolean","description":"Defines if kit components can be sold apart."},"Videos":{"type":"array","description":"Videos URLs.","items":{"type":"string","description":"Video URL."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific SKU by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 70, + "ProductId": 42, + "IsActive": false, + "ActivateIfPossible": false, + "Name": "Size 10", + "RefId": "B096QW8Y8Z", + "PackagedHeight": 10, + "PackagedLength": 10, + "PackagedWidth": 10, + "PackagedWeightKg": 10, + "Height": 1, + "Length": 1, + "Width": 1, + "WeightKg": 1, + "CubicWeight": 0.1667, + "IsKit": false, + "CreationDate": "2020-01-25T15:51:29.2614605", + "RewardValue": 0, + "EstimatedDateArrival": null, + "ManufacturerCode": "", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [ + "https://www.youtube.com/" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/List all SKU IDs.yml b/BrunoCollections/VTEX - Catalog API/SKU/List all SKU IDs.yml new file mode 100644 index 0000000000..6429ade716 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/List all SKU IDs.yml @@ -0,0 +1,102 @@ +info: + name: List all SKU IDs + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitids?page=1&pagesize=25" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + - name: pagesize + value: "25" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitids - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitids - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitids - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitids - Schema is valid", function () { + const schema = {"type":"array","description":"Array composed by SKU IDs, in the search context.","items":{"type":"integer","format":"int32","description":"SKU ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the IDs of all SKUs in your store. Presents the results with page size and pagination. + > 📘 Onboarding guide + > + > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | query | (Required) Number of the page from where you need to retrieve SKU IDs. | + | `pagesize` | query | (Required) Size of the page from where you need retrieve SKU IDs. The maximum value is `1000`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Retrieve SKU ID list by reference ID list.yml b/BrunoCollections/VTEX - Catalog API/SKU/Retrieve SKU ID list by reference ID list.yml new file mode 100644 index 0000000000..886783e446 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Retrieve SKU ID list by reference ID list.yml @@ -0,0 +1,93 @@ +info: + name: Retrieve SKU ID list by reference ID list + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pub/sku/stockkeepingunitidsbyrefids" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + "799", + "799" + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog_system/pub/sku/stockkeepingunitidsbyrefids - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog_system/pub/sku/stockkeepingunitidsbyrefids - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog_system/pub/sku/stockkeepingunitidsbyrefids - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog_system/pub/sku/stockkeepingunitidsbyrefids - Schema is valid", function () { + const schema = {"type":"object","description":"Object composed by a list of SKU IDs related to each reference ID list searched. Structure: \"{RefId}\": \"{SkuId}\".","additionalProperties":{"type":"string","description":"Reference ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Given a list of reference IDs, this endpoint returns a list with the corresponding SKU IDs. + + >⚠️ The list of reference IDs in the request body cannot have repeated reference IDs, or the API will return an error 500. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "123": "435", + "D25133K-B2": "4351", + "14-556": "3155", + "DCF880L2-BR": "4500" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/Update SKU.yml b/BrunoCollections/VTEX - Catalog API/SKU/Update SKU.yml new file mode 100644 index 0000000000..6500a62349 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/Update SKU.yml @@ -0,0 +1,145 @@ +info: + name: Update SKU + type: http + seq: 10 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/stockkeepingunit/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + body: + type: json + data: |- + { + "ProductId": 42, + "Name": "Size 10", + "PackagedHeight": 10, + "PackagedLength": 10, + "PackagedWidth": 10, + "PackagedWeightKg": 10, + "IsActive": false, + "ActivateIfPossible": false, + "RefId": "B096QW8Y8Z", + "Height": 1, + "Length": 1, + "Width": 1, + "WeightKg": 1, + "CubicWeight": 0.1667, + "IsKit": false, + "CreationDate": "2020-01-25T15:51:00", + "RewardValue": 1, + "EstimatedDateArrival": null, + "ManufacturerCode": "123", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [ + "https://www.youtube.com/" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/stockkeepingunit/:skuId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"SKU unique identifier."},"ProductId":{"type":"integer","description":"ID of the product associated with this SKU."},"IsActive":{"type":"boolean","description":"Defines if the SKU is active (`true`) or not (`false`)."},"ActivateIfPossible":{"type":"boolean","description":"When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component."},"Name":{"type":"string","description":"SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_."},"RefId":{"type":"string","description":"Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided."},"PackagedHeight":{"type":"number","description":"Height used for shipping calculation."},"PackagedLength":{"type":"number","description":"Length used for shipping calculation."},"PackagedWidth":{"type":"number","description":"Width used for shipping calculation."},"PackagedWeightKg":{"type":"integer","description":"Weight used for shipping calculation, in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"Height":{"type":"number","description":"SKU real height."},"Length":{"type":"number","description":"SKU real length."},"Width":{"type":"number","description":"SKU real width."},"WeightKg":{"type":"number","description":"Weight of the SKU in the measurement unit [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams."},"CubicWeight":{"type":"number","description":"[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."},"IsKit":{"type":"boolean","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"CreationDate":{"type":"string","description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted."},"RewardValue":{"type":"number","description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1."},"EstimatedDateArrival":{"type":["string","null"],"description":"SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date."},"ManufacturerCode":{"type":"string","description":"Identifier provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer's code."},"CommercialConditionId":{"type":"integer","description":"Commercial condition ID, used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Learn more at [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445).","default":1},"MeasurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `\"un\"`."},"UnitMultiplier":{"type":"number","description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward."},"ModalType":{"type":["string","null"],"description":"Links an unusual type of SKU that need special transportation, suach as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)."},"KitItensSellApart":{"type":"boolean","description":"Defines if kit components can be sold apart."},"Videos":{"type":"array","description":"Videos URLs.","items":{"type":"string","description":"Video URL."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **SKUs** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 70, + "ProductId": 42, + "IsActive": false, + "ActivateIfPossible": false, + "Name": "Size 10", + "RefId": "B096QW8Y8Z", + "PackagedHeight": 10, + "PackagedLength": 10, + "PackagedWidth": 10, + "PackagedWeightKg": 10, + "Height": 1, + "Length": 1, + "Width": 1, + "WeightKg": 1, + "CubicWeight": 0.1667, + "IsKit": false, + "CreationDate": "2020-01-25T15:51:29.2614605", + "RewardValue": 0, + "EstimatedDateArrival": null, + "ManufacturerCode": "", + "CommercialConditionId": 1, + "MeasurementUnit": "un", + "UnitMultiplier": 2, + "ModalType": null, + "KitItensSellApart": false, + "Videos": [ + "https://www.youtube.com/" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/SKU/folder.yml b/BrunoCollections/VTEX - Catalog API/SKU/folder.yml new file mode 100644 index 0000000000..2d53c50d2d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/SKU/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU + type: folder + seq: 11 diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/Associate product with sales channel.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/Associate product with sales channel.yml new file mode 100644 index 0000000000..ae965f3209 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/Associate product with sales channel.yml @@ -0,0 +1,60 @@ +info: + name: Associate product with sales channel + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + - name: tradepolicyId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates an existing sales channel with a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | Edit Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `tradepolicyId` | path | (Required) Sales channel's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by ID.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by ID.yml new file mode 100644 index 0000000000..e5ef7b160e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by ID.yml @@ -0,0 +1,106 @@ +info: + name: Get sales channel by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/saleschannel/:salesChannelId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: salesChannelId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/saleschannel/:salesChannelId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/saleschannel/:salesChannelId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/saleschannel/:salesChannelId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/saleschannel/:salesChannelId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Sales channel unique identifier."},"Name":{"type":"string","description":"Sales channel name."},"IsActive":{"type":"boolean","description":"Defines if the sales channel is active (`true`) or not (`false`)."},"ProductClusterId":{"type":["integer","null"],"description":"Product cluster ID, if the sales channel has releated product cluster."},"CountryCode":{"type":"string","description":"Country code in ISO 3166-1 alfa-3 standard."},"CultureInfo":{"type":"string","description":"Language country code in LCID string standard."},"TimeZone":{"type":"string","description":"Name of time zone."},"CurrencyCode":{"type":["string","null"],"description":"Currency code in ISO 4217 standard."},"CurrencySymbol":{"type":"string","description":"Currency symbol."},"CurrencyLocale":{"type":"integer","description":"Currency locale code in LCID standard."},"CurrencyFormatInfo":{"type":"object","description":"Object with currency format.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Defines which currency decimal separator will be applied."},"CurrencyGroupSeparator":{"type":"string","description":"Defines which currency group separator will be applied."},"CurrencyGroupSize":{"type":"integer","description":"Define how many characters will be grouped."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if all prices will be initiated with currency symbol (`true`) or not (`false`)."}}},"Origin":{"type":["string","null"],"description":"Origin of products in the sales channel."},"Position":{"type":["integer","null"],"description":"Defines the position on index."},"ConditionRule":{"type":["string","null"],"description":"Defines what is the conditional rule to activate de Sales channel."},"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific sales channel by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `salesChannelId` | path | (Required) Sales channel ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 1, + "Name": "Main store", + "IsActive": true, + "ProductClusterId": null, + "CountryCode": "BRA", + "CultureInfo": "pt-BR", + "TimeZone": "E. South America Standard Time", + "CurrencyCode": "BRL", + "CurrencySymbol": "R$", + "CurrencyLocale": 1046, + "CurrencyFormatInfo": { + "CurrencyDecimalDigits": 1, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + }, + "Origin": null, + "Position": 8, + "ConditionRule": null, + "CurrencyDecimalDigits": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by product ID.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by product ID.yml new file mode 100644 index 0000000000..ee2f5008da --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel by product ID.yml @@ -0,0 +1,101 @@ +info: + name: Get sales channel by product ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/salespolicy" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/product/:productId/salespolicy - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/salespolicy - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/salespolicy - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/product/:productId/salespolicy - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object containing the product ID and the sales channel ID.","properties":{"ProductId":{"type":"integer","description":"Product's unique numerical identifier."},"StoreId":{"type":"integer","description":"Sales channel's unique numerical identifier."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of the sales channels associated with a product by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "ProductId": 1, + "StoreId": 1 + }, + { + "ProductId": 1, + "StoreId": 2 + }, + { + "ProductId": 1, + "StoreId": 3 + }, + { + "ProductId": 1, + "StoreId": 4 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel list.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel list.yml new file mode 100644 index 0000000000..086dfe817d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/Get sales channel list.yml @@ -0,0 +1,126 @@ +info: + name: Get sales channel list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/saleschannel/list" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/saleschannel/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/saleschannel/list - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/saleschannel/list - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/saleschannel/list - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with the sales channel details.","properties":{"Id":{"type":"integer","description":"Sales channel unique identifier."},"Name":{"type":"string","description":"Sales channel name."},"IsActive":{"type":"boolean","description":"Defines if the Sales channel is active (`true`) or not (`false`)."},"ProductClusterId":{"type":["integer","null"],"description":"Product cluster ID, if the sales channel has releated product cluster."},"CountryCode":{"type":"string","description":"Country code in ISO 3166-1 alfa-3 standard."},"CultureInfo":{"type":"string","description":"Language country code in LCID string standard."},"TimeZone":{"type":"string","description":"Name of time zone."},"CurrencyCode":{"type":"string","description":"Currency code in ISO 4217 standard."},"CurrencySymbol":{"type":"string","description":"Currency symbol."},"CurrencyLocale":{"type":"integer","description":"Currency locale code in LCID standard."},"CurrencyFormatInfo":{"type":"object","description":"Object with currency format.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Defines which currency decimal separator will be applied."},"CurrencyGroupSeparator":{"type":"string","description":"Defines which currency group separator will be applied."},"CurrencyGroupSize":{"type":"integer","description":"Define how many characters will be grouped."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if all prices will be initiated with currency symbol (`true`) or not (`false`)."}}},"Origin":{"type":["string","null"],"description":"Origin of products in the sales channel."},"Position":{"type":["integer","null"],"description":"Defines the position on index."},"ConditionRule":{"type":["string","null"],"description":"Defines what is the conditional rule to activate de sales channel."},"CurrencyDecimalDigits":{"type":["integer","null"],"description":"Quantity of currency decimal digits."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list with details about the store's sales channels. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Name": "Main store", + "IsActive": true, + "ProductClusterId": null, + "CountryCode": "BRA", + "CultureInfo": "pt-BR", + "TimeZone": "E. South America Standard Time", + "CurrencyCode": "BRL", + "CurrencySymbol": "R$", + "CurrencyLocale": 1046, + "CurrencyFormatInfo": { + "CurrencyDecimalDigits": 1, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + }, + "Origin": null, + "Position": 8, + "ConditionRule": "approved=true", + "CurrencyDecimalDigits": 1 + }, + { + "Id": 2, + "Name": "Markeplace Fashion", + "IsActive": true, + "ProductClusterId": null, + "CountryCode": "BRA", + "CultureInfo": "pt-BR", + "TimeZone": "E. South America Standard Time", + "CurrencyCode": "BRL", + "CurrencySymbol": "R$", + "CurrencyLocale": 1046, + "CurrencyFormatInfo": { + "CurrencyDecimalDigits": 2, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + }, + "Origin": null, + "Position": 9, + "ConditionRule": "approved=true", + "CurrencyDecimalDigits": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/List all SKUs in a sales channel.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/List all SKUs in a sales channel.yml new file mode 100644 index 0000000000..3bd0579201 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/List all SKUs in a sales channel.yml @@ -0,0 +1,122 @@ +info: + name: List all SKUs in a sales channel + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel?sc=1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "1" + type: query + disabled: true + - name: onlyAssigned + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel - Schema is valid", function () { + const schema = {"type":"array","description":"List of SKU IDs of the sales channel.","items":{"type":"integer","description":"SKU ID."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of SKU IDs of a sales channel. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sc` | query | (Required) Sales channel's unique numerical identifier. | + | `page` | query | Page number. | + | `pageSize` | query | Number of items in the page. | + | `onlyAssigned` | query | If set as `false`, it allows the user to decide if the SKUs that are not assigned to a specific sales channel should be also returned. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + 405380, + 405381, + 405382, + 405383, + 405384, + 405385, + 405386, + 405387, + 405388, + 405389, + 405390, + 405391, + 405392, + 405393, + 405394, + 405395, + 405396, + 405397, + 405398, + 405399, + 405400, + 405556 + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/Remove product from sales channel.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/Remove product from sales channel.yml new file mode 100644 index 0000000000..9192ae0323 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/Remove product from sales channel.yml @@ -0,0 +1,60 @@ +info: + name: Remove product from sales channel + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + - name: tradepolicyId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Disassociates a sales channel from a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | Edit Product | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `tradepolicyId` | path | (Required) Sales channel's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Sales channel/folder.yml b/BrunoCollections/VTEX - Catalog API/Sales channel/folder.yml new file mode 100644 index 0000000000..1e0931cef1 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Sales channel/folder.yml @@ -0,0 +1,4 @@ +info: + name: Sales channel + type: folder + seq: 29 diff --git a/BrunoCollections/VTEX - Catalog API/Seller/Create seller.yml b/BrunoCollections/VTEX - Catalog API/Seller/Create seller.yml new file mode 100644 index 0000000000..16411e7012 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/Create seller.yml @@ -0,0 +1,127 @@ +info: + name: Create seller + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "SellerId": "pedrostore", + "Name": "My pedrostore", + "Email": "breno@breno.com", + "Description": "Brief description", + "ExchangeReturnPolicy": "Exchange return policy text", + "DeliveryPolicy": "Delivery policy text", + "UseHybridPaymentOptions": false, + "UserName": "myseller", + "Password": "passoword", + "SecutityPrivacyPolicy": "Secutity privacy policy text", + "CNPJ": "12035072751", + "CSCIdentification": "pedrostore", + "ArchiveId": 1, + "UrlLogo": "/myseller", + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "FulfillmentEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "FulfillmentSellerId": 1, + "SellerType": 1, + "IsBetterScope": false, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "MerchantName": "pedrostore", + "TrustPolicy": "Default" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog_system/pvt/seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog_system/pvt/seller - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog_system/pvt/seller - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog_system/pvt/seller - Schema is valid", function () { + const schema = {"type":"object","properties":{"SellerId":{"type":"string","description":"Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name."},"Name":{"type":"string","description":"Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method."},"Email":{"type":"string","description":"Email of the administrator responsible for the seller."},"Description":{"type":"string","description":"Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563)."},"ExchangeReturnPolicy":{"type":"string","description":"Text describing the exchange and return policy previously agreed between the marketplace and the seller."},"DeliveryPolicy":{"type":"string","description":"Text describing the delivery policy previously agreed between the marketplace and the seller."},"UseHybridPaymentOptions":{"type":"boolean","description":"Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller."},"UserName":{"type":["string","null"],"description":"Seller username."},"Password":{"type":["string","null"],"description":"Seller password."},"SecutityPrivacyPolicy":{"type":"string","description":"Text describing the security policy previously agreed between the marketplace and the seller."},"CNPJ":{"type":"string","description":"Company registration number."},"CSCIdentification":{"type":"string","description":"CSC identification."},"ArchiveId":{"type":["integer","null"],"description":"Seller archive ID."},"UrlLogo":{"type":["string","null"],"description":"Seller URL logo."},"ProductCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FreightCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"CategoryCommissionPercentage":{"type":"string","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FulfillmentEndpoint":{"type":["string","null"],"description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don't need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added."},"CatalogSystemEndpoint":{"type":"string","description":"URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`."},"IsActive":{"type":"boolean","description":"If the selle is active (`true`) or not (`false`)."},"MerchantName":{"type":"string","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more."},"FulfillmentSellerId":{"type":["integer","null"],"description":"Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank."},"SellerType":{"type":"integer","description":"Seller type."},"IsBetterScope":{"type":"boolean","description":"Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI)."},"TrustPolicy":{"type":"string","description":"Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new seller. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SellerId": "pedrostore", + "Name": "pedrostore", + "Email": "breno@breno.com", + "Description": "", + "ExchangeReturnPolicy": "", + "DeliveryPolicy": "", + "UseHybridPaymentOptions": false, + "UserName": null, + "Password": null, + "SecutityPrivacyPolicy": "", + "CNPJ": "12035072751", + "CSCIdentification": "pedrostore", + "ArchiveId": null, + "UrlLogo": null, + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "FulfillmentEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "MerchantName": "", + "FulfillmentSellerId": null, + "SellerType": 1, + "IsBetterScope": false, + "TrustPolicy": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID (2).yml b/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID (2).yml new file mode 100644 index 0000000000..eaf97b230a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID (2).yml @@ -0,0 +1,102 @@ +info: + name: Get seller by ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/sellers/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: pedrostore + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/sellers/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/sellers/:sellerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/sellers/:sellerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/sellers/:sellerId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information of all sellers in the store.","properties":{"SellerId":{"type":"string","description":"Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name."},"Name":{"type":["string","null"],"description":"Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method."},"Email":{"type":["string","null"],"description":"Email of the administrator responsible for the seller."},"Description":{"type":"string","description":"Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563)."},"ExchangeReturnPolicy":{"type":"string","description":"Text describing the exchange and return policy previously agreed between the marketplace and the seller."},"DeliveryPolicy":{"type":"string","description":"Text describing the delivery policy previously agreed between the marketplace and the seller."},"UseHybridPaymentOptions":{"type":"boolean","description":"Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller."},"UserName":{"type":["string","null"],"description":"Seller username."},"Password":{"type":["string","null"],"description":"Seller password."},"SecutityPrivacyPolicy":{"type":"string","description":"Text describing the security policy previously agreed between the marketplace and the seller."},"CNPJ":{"type":"string","description":"Company registration number."},"CSCIdentification":{"type":"string","description":"CSC identification."},"ArchiveId":{"type":["integer","null"],"description":"Seller archive ID."},"UrlLogo":{"type":"string","description":"Seller URL logo."},"ProductCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FreightCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"CategoryCommissionPercentage":{"type":"string","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FulfillmentEndpoint":{"type":["string","null"],"description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don't need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added."},"CatalogSystemEndpoint":{"type":"string","description":"URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`."},"IsActive":{"type":"boolean","description":"If the selle is active (`true`) or not (`false`)."},"MerchantName":{"type":"string","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more."},"FulfillmentSellerId":{"type":["integer","null"],"description":"Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank."},"SellerType":{"type":"integer","description":"Seller type."},"IsBetterScope":{"type":"boolean","description":"Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI)."},"TrustPolicy":{"type":"string","description":"Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the seller's details by its ID. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SellerId": "sellerstore", + "Name": "sellerstore", + "Email": "jane@email.com", + "Description": "", + "ExchangeReturnPolicy": "", + "DeliveryPolicy": "", + "UseHybridPaymentOptions": false, + "UserName": null, + "Password": null, + "SecutityPrivacyPolicy": "", + "CNPJ": "12035072751", + "CSCIdentification": "sellerstore", + "ArchiveId": null, + "UrlLogo": "", + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "FulfillmentEndpoint": "http://sellerstore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://sellerstore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "MerchantName": "", + "FulfillmentSellerId": null, + "SellerType": 1, + "IsBetterScope": false, + "TrustPolicy": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID.yml b/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID.yml new file mode 100644 index 0000000000..487c2b9f2d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/Get seller by ID.yml @@ -0,0 +1,102 @@ +info: + name: Get seller by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/seller/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: pedrostore + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/seller/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/seller/:sellerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/seller/:sellerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/seller/:sellerId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information of all sellers in the store.","properties":{"SellerId":{"type":"string","description":"Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name."},"Name":{"type":"string","description":"Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method."},"Email":{"type":"string","description":"Email of the admin responsible for the seller."},"Description":{"type":"string","description":"Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563)."},"ExchangeReturnPolicy":{"type":"string","description":"Text describing the exchange and return policy previously agreed between the marketplace and the seller."},"DeliveryPolicy":{"type":"string","description":"Text describing the delivery policy previously agreed between the marketplace and the seller."},"UseHybridPaymentOptions":{"type":"boolean","description":"Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller."},"UserName":{"type":["string","null"],"description":"Seller username."},"Password":{"type":["string","null"],"description":"Seller password."},"SecutityPrivacyPolicy":{"type":"string","description":"Text describing the security policy previously agreed between the marketplace and the seller."},"CNPJ":{"type":"string","description":"Company registration number."},"CSCIdentification":{"type":"string","description":"CSC identification."},"ArchiveId":{"type":["integer","null"],"description":"Seller archive ID."},"UrlLogo":{"type":"string","description":"Seller URL logo."},"ProductCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FreightCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"CategoryCommissionPercentage":{"type":"string","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FulfillmentEndpoint":{"type":["string","null"],"description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don't need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added."},"CatalogSystemEndpoint":{"type":"string","description":"URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`."},"IsActive":{"type":"boolean","description":"If the selle is active (`true`) or not (`false`)."},"MerchantName":{"type":"string","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more."},"FulfillmentSellerId":{"type":["integer","null"],"description":"Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank."},"SellerType":{"type":"integer","description":"Seller type."},"IsBetterScope":{"type":"boolean","description":"Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI)."},"TrustPolicy":{"type":"string","description":"Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the seller details by its ID. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SellerId": "pedrostore", + "Name": "pedrostore", + "Email": "breno@breno.com", + "Description": "", + "ExchangeReturnPolicy": "", + "DeliveryPolicy": "", + "UseHybridPaymentOptions": false, + "UserName": null, + "Password": null, + "SecutityPrivacyPolicy": "", + "CNPJ": "12035072751", + "CSCIdentification": "pedrostore", + "ArchiveId": null, + "UrlLogo": "", + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "FulfillmentEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "MerchantName": "", + "FulfillmentSellerId": null, + "SellerType": 1, + "IsBetterScope": false, + "TrustPolicy": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Seller/Get seller list.yml b/BrunoCollections/VTEX - Catalog API/Seller/Get seller list.yml new file mode 100644 index 0000000000..222a727063 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/Get seller list.yml @@ -0,0 +1,115 @@ +info: + name: Get seller list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/seller/list" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: sellerType + value: "1" + type: query + disabled: true + - name: isBetterScope + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/seller/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/seller/list - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/seller/list - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/seller/list - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with seller details.","properties":{"SellerId":{"type":"string","description":"Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name."},"Name":{"type":"string","description":"Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method."},"Email":{"type":"string","description":"Email of the admin responsible for the seller."},"Description":{"type":"string","description":"Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563)."},"ExchangeReturnPolicy":{"type":"string","description":"Text describing the exchange and return policy previously agreed between the marketplace and the seller."},"DeliveryPolicy":{"type":"string","description":"Text describing the delivery policy previously agreed between the marketplace and the seller."},"UseHybridPaymentOptions":{"type":"boolean","description":"Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller."},"UserName":{"type":["string","null"],"description":"Seller username."},"Password":{"type":["string","null"],"description":"Seller password."},"SecutityPrivacyPolicy":{"type":"string","description":"Text describing the security policy previously agreed between the marketplace and the seller."},"CNPJ":{"type":"string","description":"Company registration number."},"CSCIdentification":{"type":"string","description":"CSC identification."},"ArchiveId":{"type":["integer","null"],"description":"Seller archive ID."},"UrlLogo":{"type":["string","null"],"description":"Seller URL logo."},"ProductCommissionPercentage":{"type":"number","description":"Registered value for seller product commission. The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FreightCommissionPercentage":{"type":"number","description":"Registered value for seller freight commission. The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"CategoryCommissionPercentage":{"type":"string","description":"Registered value for seller category commission. The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FulfillmentEndpoint":{"type":["string","null"],"description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don't need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added."},"CatalogSystemEndpoint":{"type":"string","description":"URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`."},"IsActive":{"type":"boolean","description":"Determines if the seller is active (`true`) or not (`false`)."},"MerchantName":{"type":"string","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more."},"FulfillmentSellerId":{"type":["integer","null"],"description":"Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank."},"SellerType":{"type":"integer","description":"Seller type."},"IsBetterScope":{"type":"boolean","description":"Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI)."},"TrustPolicy":{"type":"string","description":"Seller trust policy. The default value is `Default`, but if your store is a B2B marketplace and you want to share the customers' emails with the sellers you need to set this field as `AllowEmailSharing`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the seller's details by its ID. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sc` | query | Sales channel ID. | + | `sellerType` | query | There are two possible values for this parameter: - `1`: Regular sellers - `2`: [White label sellers](https://help.vtex.com/en/tutorial/seller-white-label--5orlGHyDHGAYciQ64oEgKa) | + | `isBetterScope` | query | If the seller is better scope. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "SellerId": "sellerstore", + "Name": "sellerstore", + "Email": "jane@email.com", + "Description": "s1d222", + "ExchangeReturnPolicy": "", + "DeliveryPolicy": "", + "UseHybridPaymentOptions": false, + "UserName": null, + "Password": null, + "SecutityPrivacyPolicy": "My privacy policy", + "CNPJ": "12035072751", + "CSCIdentification": "sellerstore", + "ArchiveId": null, + "UrlLogo": null, + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "FulfillmentEndpoint": "http://sellerstore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://sellerstore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "MerchantName": "Seller store", + "FulfillmentSellerId": null, + "SellerType": 1, + "IsBetterScope": false, + "TrustPolicy": "Default" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Seller/Update seller.yml b/BrunoCollections/VTEX - Catalog API/Seller/Update seller.yml new file mode 100644 index 0000000000..369c43a6d3 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/Update seller.yml @@ -0,0 +1,127 @@ +info: + name: Update seller + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "SellerId": "pedrostore", + "Name": "My pedrostore", + "Email": "breno@breno.com", + "Description": "Brief description", + "ExchangeReturnPolicy": "Exchange return policy text", + "DeliveryPolicy": "Delivery policy text", + "UseHybridPaymentOptions": false, + "UserName": "myseller", + "Password": "passoword", + "SecutityPrivacyPolicy": "Secutity privacy policy text", + "CNPJ": "12035072751", + "CSCIdentification": "pedrostore", + "ArchiveId": 1, + "UrlLogo": "/myseller", + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "FulfillmentEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "FulfillmentSellerId": 1, + "SellerType": 1, + "IsBetterScope": false, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "MerchantName": "pedrostore", + "TrustPolicy": "Default" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/seller - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/seller - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/seller - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the seller details.","properties":{"SellerId":{"type":"string","description":"Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name."},"Name":{"type":"string","description":"Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method."},"Email":{"type":"string","description":"Email of the admin responsible for the seller."},"Description":{"type":"string","description":"Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563)."},"ExchangeReturnPolicy":{"type":"string","description":"Text describing the exchange and return policy previously agreed between the marketplace and the seller."},"DeliveryPolicy":{"type":"string","description":"Text describing the delivery policy previously agreed between the marketplace and the seller."},"UseHybridPaymentOptions":{"type":"boolean","description":"Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller."},"UserName":{"type":["string","null"],"description":"Seller username."},"Password":{"type":["string","null"],"description":"Seller password."},"SecutityPrivacyPolicy":{"type":"string","description":"Text describing the security policy previously agreed between the marketplace and the seller."},"CNPJ":{"type":"string","description":"Company registration number."},"CSCIdentification":{"type":"string","description":"CSC identification."},"ArchiveId":{"type":["integer","null"],"description":"Seller archive ID."},"UrlLogo":{"type":["string","null"],"description":"Seller URL logo."},"ProductCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FreightCommissionPercentage":{"type":"number","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"CategoryCommissionPercentage":{"type":"string","description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"FulfillmentEndpoint":{"type":["string","null"],"description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don't need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added."},"CatalogSystemEndpoint":{"type":"string","description":"URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`."},"IsActive":{"type":"boolean","description":"If the selle is active (`true`) or not (`false`)."},"MerchantName":{"type":"string","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more."},"FulfillmentSellerId":{"type":["integer","null"],"description":"Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank."},"SellerType":{"type":"integer","description":"Seller type."},"IsBetterScope":{"type":"boolean","description":"Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI)."},"TrustPolicy":{"type":"string","description":"Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a seller. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SellerId": "pedrostore", + "Name": "pedrostore", + "Email": "breno@breno.com", + "Description": "", + "ExchangeReturnPolicy": "", + "DeliveryPolicy": "", + "UseHybridPaymentOptions": false, + "UserName": null, + "Password": null, + "SecutityPrivacyPolicy": "", + "CNPJ": "12035072751", + "CSCIdentification": "pedrostore", + "ArchiveId": null, + "UrlLogo": null, + "ProductCommissionPercentage": 0, + "FreightCommissionPercentage": 0, + "CategoryCommissionPercentage": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]", + "FulfillmentEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1", + "CatalogSystemEndpoint": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/", + "IsActive": true, + "MerchantName": "", + "FulfillmentSellerId": null, + "SellerType": 1, + "IsBetterScope": false, + "TrustPolicy": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Seller/folder.yml b/BrunoCollections/VTEX - Catalog API/Seller/folder.yml new file mode 100644 index 0000000000..45a3a18a97 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Seller/folder.yml @@ -0,0 +1,4 @@ +info: + name: Seller + type: folder + seq: 30 diff --git a/BrunoCollections/VTEX - Catalog API/Similar category/Add similar category.yml b/BrunoCollections/VTEX - Catalog API/Similar category/Add similar category.yml new file mode 100644 index 0000000000..a320e7f810 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Similar category/Add similar category.yml @@ -0,0 +1,91 @@ +info: + name: Add similar category + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/similarcategory/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/product/:productId/similarcategory/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/product/:productId/similarcategory/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/product/:productId/similarcategory/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/product/:productId/similarcategory/:categoryId - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing information related to the similar category.","properties":{"ProductId":{"type":"integer","description":"Product ID."},"StoreId":{"type":"integer","description":"Sales channel ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a similar category to a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Similar Categories Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `categoryId` | path | (Required) Similar category's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "ProductId": 1, + "StoreId": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Similar category/Delete similar category.yml b/BrunoCollections/VTEX - Catalog API/Similar category/Delete similar category.yml new file mode 100644 index 0000000000..f6c1cbc497 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Similar category/Delete similar category.yml @@ -0,0 +1,60 @@ +info: + name: Delete similar category + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/similarcategory/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/product/:productId/similarcategory/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a similar category from a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Similar Categories Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `categoryId` | path | (Required) Similar category's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Similar category/Get similar categories.yml b/BrunoCollections/VTEX - Catalog API/Similar category/Get similar categories.yml new file mode 100644 index 0000000000..55b52a5a16 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Similar category/Get similar categories.yml @@ -0,0 +1,93 @@ +info: + name: Get similar categories + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/product/:productId/similarcategory" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/product/:productId/similarcategory - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/similarcategory - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/product/:productId/similarcategory - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/product/:productId/similarcategory - Schema is valid", function () { + const schema = {"type":"array","description":"Array of objects with similar category information.","items":{"type":"object","description":"Object containing product ID and similar category ID.","properties":{"ProductId":{"type":"integer","description":"Product ID."},"CategoryId":{"type":"integer","description":"Similar category ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves similar categories from a product. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Similar Category** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "ProductId": 1, + "CategoryId": 1 + }, + { + "ProductId": 1, + "CategoryId": 20 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Similar category/folder.yml b/BrunoCollections/VTEX - Catalog API/Similar category/folder.yml new file mode 100644 index 0000000000..db82dfae61 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Similar category/folder.yml @@ -0,0 +1,4 @@ +info: + name: Similar category + type: folder + seq: 10 diff --git a/BrunoCollections/VTEX - Catalog API/Specification field value/Create specification field value.yml b/BrunoCollections/VTEX - Catalog API/Specification field value/Create specification field value.yml new file mode 100644 index 0000000000..04ba643039 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field value/Create specification field value.yml @@ -0,0 +1,97 @@ +info: + name: Create specification field value + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/specification/fieldValue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "FieldId": 34, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog_system/pvt/specification/fieldValue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog_system/pvt/specification/fieldValue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog_system/pvt/specification/fieldValue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog_system/pvt/specification/fieldValue - Schema is valid", function () { + const schema = {"type":"object","properties":{"FieldValueId":{"type":"integer","format":"int32","description":"Specification field value ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"Name":{"type":"string","description":"Specification field value name."},"Text":{"type":"string","description":"Specification field value description."},"IsActive":{"type":"boolean","description":"Defines if the specification field value is active (`true`) or inactive (`false`)."},"Position":{"type":"integer","format":"int32","description":"Specification field value position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a specification field value by the specification field's ID. + >⚠️ This is a legacy endpoint. We recommend using [Create specification value](https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/specificationvalue) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "FieldValueId": 143, + "FieldId": 34, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification field value.yml b/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification field value.yml new file mode 100644 index 0000000000..8eff06f9dd --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification field value.yml @@ -0,0 +1,92 @@ +info: + name: Get specification field value + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/specification/fieldValue/:fieldValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: fieldValueId + value: "143" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/specification/fieldValue/:fieldValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/specification/fieldValue/:fieldValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/specification/fieldValue/:fieldValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/specification/fieldValue/:fieldValueId - Schema is valid", function () { + const schema = {"type":"object","properties":{"FieldValueId":{"type":"integer","format":"int32","description":"Specification field value ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"Name":{"type":"string","description":"Specification field value name."},"Text":{"type":"string","description":"Specification field value Description."},"IsActive":{"type":"boolean","description":"Defines if the specification field Value is active (`true`) or inactive (`false`)."},"Position":{"type":"integer","format":"int32","description":"Specification field value position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details from a specification field's value by this value's ID. + >⚠️ This is a legacy endpoint. We recommend using [Get specification value](https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog/pvt/specificationvalue/-specificationValueId-?endpoint=get-/api/catalog/pvt/specificationvalue/-specificationValueId-) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `fieldValueId` | path | (Required) Specification value ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "FieldValueId": 143, + "FieldId": 34, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification values by specification field ID.yml b/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification values by specification field ID.yml new file mode 100644 index 0000000000..85baac5d2d --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field value/Get specification values by specification field ID.yml @@ -0,0 +1,127 @@ +info: + name: Get specification values by specification field ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/specification/fieldvalue/:fieldId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: fieldId + value: "34" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/specification/fieldvalue/:fieldId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldvalue/:fieldId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldvalue/:fieldId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldvalue/:fieldId - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["FieldValueId","Value","IsActive","Position"],"type":"object","description":"Object with specification field value details.","properties":{"FieldValueId":{"type":"integer","format":"int32","description":"Specification field value ID."},"Value":{"type":"string","description":"Specification field value."},"IsActive":{"type":"boolean","description":"Defines if the specification field is active (`true`) or inactive (`false`)."},"Position":{"type":"integer","format":"int32","description":"Specification field value position."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets a list of all specification values from a specification field by this field's ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `fieldId` | path | (Required) Specification field ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "FieldValueId": 52, + "Value": "0 a 6 meses", + "IsActive": true, + "Position": 1 + }, + { + "FieldValueId": 53, + "Value": "1 a 2 anos", + "IsActive": true, + "Position": 4 + }, + { + "FieldValueId": 54, + "Value": "3 a 4 anos", + "IsActive": true, + "Position": 3 + }, + { + "FieldValueId": 55, + "Value": "5 a 6 anos", + "IsActive": true, + "Position": 2 + }, + { + "FieldValueId": 56, + "Value": "7 a 8 anos", + "IsActive": true, + "Position": 5 + }, + { + "FieldValueId": 57, + "Value": "9 a 10 anos", + "IsActive": true, + "Position": 6 + }, + { + "FieldValueId": 58, + "Value": "Acima de 10 anos", + "IsActive": true, + "Position": 7 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field value/Update specification field value.yml b/BrunoCollections/VTEX - Catalog API/Specification field value/Update specification field value.yml new file mode 100644 index 0000000000..90ed655fed --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field value/Update specification field value.yml @@ -0,0 +1,90 @@ +info: + name: Update specification field value + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/specification/fieldValue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "FieldId": 1, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/specification/fieldValue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/specification/fieldValue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/specification/fieldValue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/specification/fieldValue - Schema is valid", function () { + const schema = {"type":"string","description":"Status of the request."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specification field value by the specification field's ID. + >⚠️ This is a legacy endpoint. We recommend using [Update specification field value](https://developers.vtex.com/docs/api-reference/catalog-api#put-/api/catalog/pvt/stockkeepingunit/-skuId-/specification?endpoint=put-/api/catalog/pvt/stockkeepingunit/-skuId-/specification-value-id) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + Field Value Updated + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field value/folder.yml b/BrunoCollections/VTEX - Catalog API/Specification field value/folder.yml new file mode 100644 index 0000000000..768749d565 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field value/folder.yml @@ -0,0 +1,4 @@ +info: + name: Specification field value + type: folder + seq: 22 diff --git a/BrunoCollections/VTEX - Catalog API/Specification field/Create specification field.yml b/BrunoCollections/VTEX - Catalog API/Specification field/Create specification field.yml new file mode 100644 index 0000000000..6583868c87 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field/Create specification field.yml @@ -0,0 +1,103 @@ +info: + name: Create specification field + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/catalog_system/pvt/specification/field" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Material", + "CategoryId": 4, + "FieldId": 88, + "IsActive": true, + "IsRequired": true, + "FieldTypeId": 1, + "FieldValueId": 1, + "IsStockKeepingUnit": false, + "Description": "Composition of the product.", + "IsFilter": true, + "IsOnProductDetails": false, + "Position": 1, + "IsWizard": false, + "IsTopMenuLinkActive": true, + "IsSideMenuLinkActive": true, + "DefaultValue": null, + "FieldGroupId": 20, + "FieldGroupName": "Clothes specifications" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog_system/pvt/specification/field - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog_system/pvt/specification/field - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog_system/pvt/specification/field - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog_system/pvt/specification/field - Schema is valid", function () { + const schema = {"type":"integer","description":"Specification field ID."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a specification field in a category. + >⚠️ This is a legacy endpoint. We recommend using [Create specification](https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/specification?endpoint=post-/api/catalog/pvt/specification) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 89 + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field/Get specification field.yml b/BrunoCollections/VTEX - Catalog API/Specification field/Get specification field.yml new file mode 100644 index 0000000000..d8d6b77d39 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field/Get specification field.yml @@ -0,0 +1,105 @@ +info: + name: Get specification field + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/specification/fieldGet/:fieldId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: fieldId + value: "88" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/specification/fieldGet/:fieldId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldGet/:fieldId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldGet/:fieldId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/specification/fieldGet/:fieldId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Name":{"type":"string","description":"Specification field name."},"FieldId":{"type":"integer","description":"Specification field ID."},"IsActive":{"type":"boolean","description":"Enable (`true`) or disable (`false`) specification."},"IsRequired":{"type":"boolean","description":"Makes the specification mandatory (`true`) or optional (`false`)."},"FieldTypeId":{"type":"integer","description":"Field type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`."},"FieldTypeName":{"type":"string","description":"Field type name, which can be `Text`, `Multi-Line Text`, `Number`, `Combo`, `Radio`, `Checkbox`, `Indexed Text` or `Indexed Multi-Line Text`."},"FieldValueId":{"type":["integer","null"],"description":"Specification value ID."},"Description":{"type":["string","null"],"description":"Deprecated field."},"IsStockKeepingUnit":{"type":"boolean","description":"If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field."},"IsFilter":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar."},"IsOnProductDetails":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page."},"Position":{"type":"integer","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page."},"IsWizard":{"type":["boolean","null"],"description":"Deprecated field."},"IsTopMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu."},"IsSideMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar."},"DefaultValue":{"type":["string","null"],"description":"Specification default value."},"FieldGroupId":{"type":"integer","description":"ID of the group of specifications that contains the new specification."},"FieldGroupName":{"type":"string","description":"Specification field group name."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details from a specification field by this field's ID. + >⚠️ This is a legacy endpoint. We recommend using [Get specification](https://developers.vtex.com/vtex-rest-api/reference/get_api-catalog-pvt-specification-specificationid) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `fieldId` | path | (Required) Specification field ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Name": "Material", + "CategoryId": 4, + "FieldId": 88, + "IsActive": true, + "IsRequired": true, + "FieldTypeId": 1, + "FieldTypeName": "Texto", + "FieldValueId": null, + "Description": "Composition of the product.", + "IsStockKeepingUnit": false, + "IsFilter": true, + "IsOnProductDetails": false, + "Position": 1, + "IsWizard": false, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": true, + "DefaultValue": null, + "FieldGroupId": 20, + "FieldGroupName": "Clothes specifications" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field/Update specification field.yml b/BrunoCollections/VTEX - Catalog API/Specification field/Update specification field.yml new file mode 100644 index 0000000000..8d265c807a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field/Update specification field.yml @@ -0,0 +1,103 @@ +info: + name: Update specification field + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/specification/field" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Material", + "CategoryId": 4, + "IsActive": true, + "FieldId": 89, + "IsRequired": true, + "FieldTypeId": 1, + "Description": "Composition of the product.", + "IsStockKeepingUnit": false, + "IsWizard": false, + "IsFilter": true, + "IsOnProductDetails": true, + "Position": 1, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": false, + "DefaultValue": "Cotton", + "FieldGroupId": 20, + "FieldGroupName": "Clothes specifications", + "FieldValueId": 143 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/specification/field - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/specification/field - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/specification/field - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/specification/field - Schema is valid", function () { + const schema = {"type":"integer","description":"Specification field ID."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specification field in a category. + >⚠️ This is a legacy endpoint. We recommend using [Update specification](https://developers.vtex.com/docs/api-reference/catalog-api#put-/api/catalog/pvt/stockkeepingunit/-skuId-/specification?endpoint=put-/api/catalog/pvt/stockkeepingunit/-skuId-/specification) instead. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 89 + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification field/folder.yml b/BrunoCollections/VTEX - Catalog API/Specification field/folder.yml new file mode 100644 index 0000000000..9bedf4ab48 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification field/folder.yml @@ -0,0 +1,4 @@ +info: + name: Specification field + type: folder + seq: 19 diff --git a/BrunoCollections/VTEX - Catalog API/Specification group/Create specification group.yml b/BrunoCollections/VTEX - Catalog API/Specification group/Create specification group.yml new file mode 100644 index 0000000000..2677fa3004 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification group/Create specification group.yml @@ -0,0 +1,92 @@ +info: + name: Create specification group + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/specificationgroup" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "CategoryId": 1, + "Name": "Sizes" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/specificationgroup - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/specificationgroup - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/specificationgroup - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/specificationgroup - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","format":"int32","description":"Specification group ID."},"CategoryId":{"type":"integer","format":"int32","description":"Category ID."},"Name":{"type":"string","description":"Specification group name."},"Position":{"type":"integer","format":"int32","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - specification Group Position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Create a specification group. + >⚠️ It is also possible to create a specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 10, + "CategoryId": 1, + "Name": "Sizes", + "Position": 3 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification group/Get specification group.yml b/BrunoCollections/VTEX - Catalog API/Specification group/Get specification group.yml new file mode 100644 index 0000000000..bab49a6ea0 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification group/Get specification group.yml @@ -0,0 +1,89 @@ +info: + name: Get specification group + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/specification/groupGet/:groupId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupId + value: "6" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/specification/groupGet/:groupId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/specification/groupGet/:groupId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/specification/groupGet/:groupId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/specification/groupGet/:groupId - Schema is valid", function () { + const schema = {"required":["CategoryId","Id","Name","Position"],"type":"object","description":"Object with specification groups information.","properties":{"CategoryId":{"type":["integer","null"],"description":"Category ID."},"Id":{"type":"integer","description":"Specification group ID."},"Name":{"type":"string","description":"Specification group name."},"Position":{"type":["integer","null"],"description":"Specification group position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details from a specification group by the ID of the group. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Specification group ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "CategoryId": 1, + "Id": 6, + "Name": "Sizes", + "Position": 3 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification group/List specification group by category.yml b/BrunoCollections/VTEX - Catalog API/Specification group/List specification group by category.yml new file mode 100644 index 0000000000..0c2235ac26 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification group/List specification group by category.yml @@ -0,0 +1,97 @@ +info: + name: List specification group by category + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pvt/specification/groupbycategory/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pvt/specification/groupbycategory/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pvt/specification/groupbycategory/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pvt/specification/groupbycategory/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pvt/specification/groupbycategory/:categoryId - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["CategoryId","Id","Name","Position"],"type":"object","description":"Object with specification groups information.","properties":{"CategoryId":{"type":["integer","null"],"description":"Category ID."},"Id":{"type":"integer","description":"Specification group ID."},"Name":{"type":"string","description":"Specification group name."},"Position":{"type":["integer","null"],"description":"Specification group position."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of specification groups by the category ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "CategoryId": 1, + "Id": 5, + "Name": "Materials", + "Position": 2 + }, + { + "CategoryId": 1, + "Id": 6, + "Name": "Sizes", + "Position": 3 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification group/Update specification group.yml b/BrunoCollections/VTEX - Catalog API/Specification group/Update specification group.yml new file mode 100644 index 0000000000..519d238738 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification group/Update specification group.yml @@ -0,0 +1,99 @@ +info: + name: Update specification group + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specificationgroup/:groupId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupId + value: "1" + type: path + body: + type: json + data: |- + { + "CategoryId": 1, + "Name": "Sizes", + "Id": 24, + "Position": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/specificationgroup/:groupId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/specificationgroup/:groupId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/specificationgroup/:groupId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/specificationgroup/:groupId - Schema is valid", function () { + const schema = {"type":"object","properties":{"CategoryId":{"type":"integer","description":"Category ID where the specification Group is contained."},"Id":{"type":"integer","format":"int32","description":"Specification group ID."},"Name":{"type":"string","description":"Specification group name."},"Position":{"type":"integer","description":"Specification group position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Update a specification group. + >⚠️ It is also possible to update a specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Groups** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "CategoryId": 1, + "Id": 24, + "Name": "Sizes", + "Position": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification group/folder.yml b/BrunoCollections/VTEX - Catalog API/Specification group/folder.yml new file mode 100644 index 0000000000..69c96df6be --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification group/folder.yml @@ -0,0 +1,4 @@ +info: + name: Specification group + type: folder + seq: 20 diff --git a/BrunoCollections/VTEX - Catalog API/Specification value/Create specification value.yml b/BrunoCollections/VTEX - Catalog API/Specification value/Create specification value.yml new file mode 100644 index 0000000000..ead0ebd91f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification value/Create specification value.yml @@ -0,0 +1,96 @@ +info: + name: Create specification value + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "FieldId": 193, + "Name": "Metal", + "Text": null, + "IsActive": true, + "Position": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/specificationvalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/specificationvalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/specificationvalue - Schema is valid", function () { + const schema = {"type":"object","properties":{"FieldValueId":{"type":"integer","description":"Specification value ID."},"FieldId":{"type":"integer","description":"Specification field ID associated with this specification value."},"Name":{"type":"string","description":"Specification value name."},"Text":{"type":["string","null"],"description":"Specification value text."},"IsActive":{"type":"boolean","description":"Enable (`true`) or disable (`false`) specification value."},"Position":{"type":"integer","description":"The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new specification value for a category. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "FieldValueId": 360, + "FieldId": 193, + "Name": "Metal", + "Text": null, + "IsActive": true, + "Position": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification value/Get specification value.yml b/BrunoCollections/VTEX - Catalog API/Specification value/Get specification value.yml new file mode 100644 index 0000000000..d787e88e94 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification value/Get specification value.yml @@ -0,0 +1,91 @@ +info: + name: Get specification value + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specificationvalue/:specificationValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationValueId + value: "143" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specificationvalue/:specificationValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:specificationValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:specificationValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specificationvalue/:specificationValueId - Schema is valid", function () { + const schema = {"type":"object","properties":{"FieldValueId":{"type":"integer","format":"int32","description":"Specification field value ID."},"FieldId":{"type":"integer","description":"Specification field ID."},"Name":{"type":"string","description":"Specification field value name."},"Text":{"type":"string","description":"Specification field value description."},"IsActive":{"type":"boolean","description":"Defines if the specification field value is active (`true`) or inactive (`false`)."},"Position":{"type":"integer","format":"int32","description":"Specification field value position."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about a specification value. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationValueId` | path | (Required) Specification value's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "FieldValueId": 143, + "FieldId": 34, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification value/Update specification value.yml b/BrunoCollections/VTEX - Catalog API/Specification value/Update specification value.yml new file mode 100644 index 0000000000..7c03858b99 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification value/Update specification value.yml @@ -0,0 +1,101 @@ +info: + name: Update specification value + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specificationvalue/:specificationValueId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationValueId + value: "1" + type: path + body: + type: json + data: |- + { + "FieldId": 193, + "Name": "Metal", + "Text": null, + "IsActive": true, + "Position": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/specificationvalue/:specificationValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/specificationvalue/:specificationValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/specificationvalue/:specificationValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/specificationvalue/:specificationValueId - Schema is valid", function () { + const schema = {"type":"object","properties":{"FieldValueId":{"type":"integer","description":"Specification value ID."},"FieldId":{"type":"integer","description":"Specification field ID associated with this specification value."},"Name":{"type":"string","description":"Specification value name."},"Text":{"type":["string","null"],"description":"Specification value text."},"IsActive":{"type":"boolean","description":"Enable (`true`) or disable (`false`) specification value."},"Position":{"type":"integer","description":"The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a new specification value for a category. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationValueId` | path | (Required) specification value's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "FieldValueId": 360, + "FieldId": 193, + "Name": "Metal", + "Text": null, + "IsActive": true, + "Position": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification value/folder.yml b/BrunoCollections/VTEX - Catalog API/Specification value/folder.yml new file mode 100644 index 0000000000..54c8f7d76a --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification value/folder.yml @@ -0,0 +1,4 @@ +info: + name: Specification value + type: folder + seq: 21 diff --git a/BrunoCollections/VTEX - Catalog API/Specification/Create specification.yml b/BrunoCollections/VTEX - Catalog API/Specification/Create specification.yml new file mode 100644 index 0000000000..02d6c98238 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification/Create specification.yml @@ -0,0 +1,116 @@ +info: + name: Create specification + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/specification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "FieldTypeId": 1, + "FieldGroupId": 22, + "Name": "Material", + "CategoryId": 1, + "Description": "Composition of the product.", + "Position": 1, + "IsFilter": false, + "IsRequired": false, + "IsOnProductDetails": true, + "IsStockKeepingUnit": false, + "IsWizard": null, + "IsActive": true, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": false, + "DefaultValue": "Cotton" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/specification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/specification - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/specification - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/specification - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Specification ID."},"FieldTypeId":{"type":"integer","description":"Field type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`."},"CategoryId":{"type":"integer","description":"Category ID associated with this specification."},"FieldGroupId":{"type":"integer","description":"ID of the group of specifications that contains the new specification."},"Name":{"type":"string","description":"Specification name. Limited to 100 characters."},"Description":{"type":["string","null"],"description":"Specification description."},"Position":{"type":"integer","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page."},"IsFilter":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar."},"IsRequired":{"type":"boolean","description":"Makes the specification mandatory (`true`) or optional (`false`)."},"IsOnProductDetails":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page."},"IsStockKeepingUnit":{"type":"boolean","description":"If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field."},"IsWizard":{"type":["boolean","null"],"description":"Deprecated field."},"IsActive":{"type":"boolean","description":"Enable (`true`) or disable (`false`) specification."},"IsTopMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu."},"IsSideMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar."},"DefaultValue":{"type":"string","description":"Specification default value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new product or SKU specification. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 88, + "FieldTypeId": 1, + "CategoryId": 4, + "FieldGroupId": 20, + "Name": "Material", + "Description": "Composition of the product.", + "Position": 1, + "IsFilter": true, + "IsRequired": true, + "IsOnProductDetails": false, + "IsStockKeepingUnit": false, + "IsWizard": false, + "IsActive": true, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": true, + "DefaultValue": "Cotton" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification/Get specification by specification ID.yml b/BrunoCollections/VTEX - Catalog API/Specification/Get specification by specification ID.yml new file mode 100644 index 0000000000..86be39021e --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification/Get specification by specification ID.yml @@ -0,0 +1,101 @@ +info: + name: Get specification by specification ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/specification/:specificationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/specification/:specificationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/specification/:specificationId - Schema is valid", function () { + const schema = {"type":"object","required":["Id","FieldTypeId","CategoryId","FieldGroupId","Name","Description","Position","IsFilter","IsRequired","IsOnProductDetails","IsStockKeepingUnit","IsWizard","IsActive","IsTopMenuLinkActive","IsSideMenuLinkActive","DefaultValue"],"properties":{"Id":{"type":"integer","description":"Created specification's ID."},"FieldTypeId":{"type":"integer","description":"Field type can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`.","enum":[1,2,4,5,6,7,8,9]},"CategoryId":{"type":"integer","description":"Specification category ID."},"FieldGroupId":{"type":"integer","description":"Numerical ID of the specification group that contains the new specification."},"Name":{"type":"string","description":"Specification name. Limited to 100 characters."},"Description":{"type":"string","description":"Specification description."},"Position":{"type":"integer","description":"The current specification's position in comparison to the other specifications."},"IsFilter":{"type":"boolean","description":"Defines if the specification can be used as a filter."},"IsRequired":{"type":"boolean","description":"Defines if the specification is required or not."},"IsOnProductDetails":{"type":"boolean","description":"Defines if the specification will be shown on the product screen in the specification area."},"IsStockKeepingUnit":{"type":"boolean","description":"Defines if the specification is applied to a specific SKU."},"IsWizard":{"type":"boolean","description":"Deprecated field."},"IsActive":{"type":"boolean","description":"Defines if the specification is active or not."},"IsTopMenuLinkActive":{"type":"boolean","description":"Defines if the specification is shown in the main menu of the site."},"IsSideMenuLinkActive":{"type":"boolean","description":"Defines if the specification is shown in the side menu."},"DefaultValue":{"type":["string","null"],"description":"Specification default value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a product or SKU specification. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationId` | path | (Required) Specification's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 32, + "FieldTypeId": 6, + "CategoryId": 10, + "FieldGroupId": 11, + "Name": "Peso", + "Description": "Peso", + "Position": 1, + "IsFilter": false, + "IsRequired": true, + "IsOnProductDetails": false, + "IsStockKeepingUnit": true, + "IsWizard": false, + "IsActive": true, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": false, + "DefaultValue": null + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification/Update specification.yml b/BrunoCollections/VTEX - Catalog API/Specification/Update specification.yml new file mode 100644 index 0000000000..7c8c5d8b78 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification/Update specification.yml @@ -0,0 +1,123 @@ +info: + name: Update specification + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/specification/:specificationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: specificationId + value: "88" + type: path + body: + type: json + data: |- + { + "FieldTypeId": 1, + "CategoryId": 0, + "FieldGroupId": 0, + "Name": "Material", + "Description": "Composition of the product.", + "Position": 1, + "IsFilter": false, + "IsRequired": false, + "IsOnProductDetails": false, + "IsStockKeepingUnit": false, + "IsWizard": false, + "IsActive": false, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": false, + "DefaultValue": "Leather" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/specification/:specificationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/specification/:specificationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/specification/:specificationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/specification/:specificationId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Specification ID."},"FieldTypeId":{"type":"integer","description":"Field type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`."},"CategoryId":{"type":"integer","description":"Category ID associated with this specification."},"FieldGroupId":{"type":"integer","description":"ID of the group of specifications that contains the new specification."},"Name":{"type":"string","description":"Specification name. Limited to 100 characters."},"Description":{"type":["string","null"],"description":"Deprecated field."},"Position":{"type":"integer","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page."},"IsFilter":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar."},"IsRequired":{"type":"boolean","description":"Makes the specification mandatory (`true`) or optional (`false`)."},"IsOnProductDetails":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page."},"IsStockKeepingUnit":{"type":"boolean","description":"If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field."},"IsWizard":{"type":["boolean","null"],"description":"Deprecated field."},"IsActive":{"type":"boolean","description":"Enable (`true`) or disable (`false`) specification."},"IsTopMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu."},"IsSideMenuLinkActive":{"type":"boolean","description":"Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar."},"DefaultValue":{"type":"string","description":"Specification default value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a product specification or SKU specification. + + >⚠️ It is not possible to edit `FieldTypeId`, `CategoryId`, `FieldGroupId` or `IsStockKeepingUnit` in this API call. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Commercial | **SKU management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `specificationId` | path | (Required) Specification's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 88, + "FieldTypeId": 1, + "CategoryId": 4, + "FieldGroupId": 20, + "Name": "Material", + "Description": "Composition of the product.", + "Position": 1, + "IsFilter": true, + "IsRequired": true, + "IsOnProductDetails": false, + "IsStockKeepingUnit": false, + "IsWizard": false, + "IsActive": true, + "IsTopMenuLinkActive": false, + "IsSideMenuLinkActive": true, + "DefaultValue": "Leather" + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Specification/folder.yml b/BrunoCollections/VTEX - Catalog API/Specification/folder.yml new file mode 100644 index 0000000000..db2e654992 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Specification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Specification + type: folder + seq: 24 diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Add SKU to subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Add SKU to subcollection.yml new file mode 100644 index 0000000000..6d385d8aa9 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Add SKU to subcollection.yml @@ -0,0 +1,95 @@ +info: + name: Add SKU to subcollection + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + body: + type: json + data: |- + { + "SkuId": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit - Schema is valid", function () { + const schema = {"type":"object","properties":{"SubCollectionId":{"type":"integer","description":"Subcollection's unique numerical identifier."},"SkuId":{"type":"integer","description":"Unique identifier of the SKU."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Associates a single SKU to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection'''s unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SubCollectionId": 17, + "SkuId": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Associate brand to subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Associate brand to subcollection.yml new file mode 100644 index 0000000000..9982912c04 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Associate brand to subcollection.yml @@ -0,0 +1,95 @@ +info: + name: Associate brand to subcollection + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/brand" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + body: + type: json + data: |- + { + "BrandId": 2000000 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/brand - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/brand - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/brand - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/brand - Schema is valid", function () { + const schema = {"type":"object","properties":{"SubCollectionId":{"type":"integer","description":"Subcollection's unique numerical identifier."},"BrandId":{"type":"integer","description":"Unique identifier of the brand."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Associates a single brand to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SubCollectionId": 17, + "BrandId": 2000000 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Associate category to subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Associate category to subcollection.yml new file mode 100644 index 0000000000..5868999722 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Associate category to subcollection.yml @@ -0,0 +1,95 @@ +info: + name: Associate category to subcollection + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/category" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + body: + type: json + data: |- + { + "CategoryId": 0 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/category - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/category - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/category - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/category - Schema is valid", function () { + const schema = {"type":"object","properties":{"SubCollectionId":{"type":"integer","description":"Subcollection's unique numerical identifier."},"CategoryId":{"type":"integer","description":"Unique identifier of the category."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Associates a single category to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SubCollectionId": 17, + "CategoryId": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Create subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Create subcollection.yml new file mode 100644 index 0000000000..8173ba4d62 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Create subcollection.yml @@ -0,0 +1,98 @@ +info: + name: Create subcollection + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/subcollection" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "CollectionId": 17, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/subcollection - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/subcollection - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/subcollection - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/subcollection - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Subcollection ID."},"CollectionId":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Subcollection name."},"Type":{"type":"string","description":"Either `Exclusive` (all the products contained in it will not be used) or `Inclusive` (all the products contained in it will be used)."},"PreSale":{"type":"boolean","description":"Defines if the collection is on PreSale."},"Release":{"type":"boolean","description":"Defines if the collection is a new released one."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Creates a new subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. A subcollection can be either “Exclusive” (all the products contained in it will not be used) or “Inclusive” (all the products contained in it will be used). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 17, + "CollectionId": 151, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Delete SKU from subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete SKU from subcollection.yml new file mode 100644 index 0000000000..2e6d629faf --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete SKU from subcollection.yml @@ -0,0 +1,62 @@ +info: + name: Delete SKU from subcollection + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Deletes an SKU from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `skuId` | path | (Required) SKU's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Delete brand from subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete brand from subcollection.yml new file mode 100644 index 0000000000..9e1e6dd48f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete brand from subcollection.yml @@ -0,0 +1,62 @@ +info: + name: Delete brand from subcollection + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/brand/:brandId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + - name: brandId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/subcollection/:subCollectionId/brand/:brandId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Deletes a brand from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `brandId` | path | (Required) Brand's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Delete category from subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete category from subcollection.yml new file mode 100644 index 0000000000..27ad48d1b6 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete category from subcollection.yml @@ -0,0 +1,62 @@ +info: + name: Delete category from subcollection + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/category/:categoryId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/subcollection/:subCollectionId/category/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Deletes a category from a subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by dollection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `categoryId` | path | (Required) Category's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Delete specification value from subcollection by ID.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete specification value from subcollection by ID.yml new file mode 100644 index 0000000000..bc6b8b40a8 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete specification value from subcollection by ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete specification value from subcollection by ID + type: http + seq: 15 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "80" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specification value from a subcollection searching by subcollection ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | Edit Category | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Delete subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete subcollection.yml new file mode 100644 index 0000000000..5c616f6a23 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Delete subcollection.yml @@ -0,0 +1,58 @@ +info: + name: Delete subcollection + type: http + seq: 10 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/subcollection/:subCollectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Deletes a previously created subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Get specification values by subcollection ID.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Get specification values by subcollection ID.yml new file mode 100644 index 0000000000..9119e74a60 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Get specification values by subcollection ID.yml @@ -0,0 +1,103 @@ +info: + name: Get specification values by subcollection ID + type: http + seq: 13 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "80" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the response.","properties":{"Page":{"type":"integer","description":"Current page number of the result set."},"Size":{"type":"integer","description":"Number of records per page."},"TotalRows":{"type":"integer","description":"Total number of records returned."},"TotalPage":{"type":"integer","description":"Total number of pages available."},"Data":{"type":"array","description":"Array of SubCollection Specification Value records.","items":{"type":"object","description":"SubCollection Specification Value records details.","properties":{"SubCollectionId":{"type":"integer","description":"Subcollection unique identifier."},"SpecificationValueId":{"type":"integer","description":"Subcollection specification value ID."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves specification values searching by subcollection ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | View Category | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Page": 1, + "Size": 3, + "TotalRows": 3, + "TotalPage": 1, + "Data": [ + { + "SubCollectionId": 80, + "SpecificationValueId": 2461 + }, + { + "SubCollectionId": 80, + "SpecificationValueId": 2463 + }, + { + "SubCollectionId": 80, + "SpecificationValueId": 2464 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by collection ID.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by collection ID.yml new file mode 100644 index 0000000000..f4dbba60b4 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by collection ID.yml @@ -0,0 +1,103 @@ +info: + name: Get subcollection by collection ID + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/subcollection" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "151" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/subcollection - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/subcollection - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/subcollection - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/collection/:collectionId/subcollection - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Subcollection object.","properties":{"Id":{"type":"integer","description":"Subcollection ID."},"CollectionId":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Subcollection name."},"Type":{"type":"string","description":"Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used)."},"PreSale":{"type":"boolean","description":"Defines if the collection is on PreSale."},"Release":{"type":"boolean","description":"Defines if the collection is a new released one."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Retrieves all subcollections given a collection ID. A subcollection is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 17, + "CollectionId": 151, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + }, + { + "Id": 18, + "CollectionId": 151, + "Name": "group 2", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by subcollection ID.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by subcollection ID.yml new file mode 100644 index 0000000000..b00eb4216f --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Get subcollection by subcollection ID.yml @@ -0,0 +1,93 @@ +info: + name: Get subcollection by subcollection ID + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "17" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog/pvt/subcollection/:subCollectionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Subcollection ID."},"CollectionId":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Subcollection name."},"Type":{"type":"string","description":"Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used)."},"PreSale":{"type":"boolean","description":"Defines if the collection is on PreSale."},"Release":{"type":"boolean","description":"Defines if the collection is a new released one."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Retrieves information about a subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Read Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 17, + "CollectionId": 151, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Reposition SKU on the subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Reposition SKU on the subcollection.yml new file mode 100644 index 0000000000..13d6d88b79 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Reposition SKU on the subcollection.yml @@ -0,0 +1,66 @@ +info: + name: Reposition SKU on the subcollection + type: http + seq: 12 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/collection/:collectionId/position" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: collectionId + value: "151" + type: path + body: + type: json + data: |- + { + "skuId": 1, + "position": 1, + "subCollectionId": 17 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/catalog/pvt/collection/:collectionId/position - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Edits the position of an SKU that already exists in the subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `collectionId` | path | (Required) Collection's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Update subcollection.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Update subcollection.yml new file mode 100644 index 0000000000..53e5e7a633 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Update subcollection.yml @@ -0,0 +1,103 @@ +info: + name: Update subcollection + type: http + seq: 9 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "17" + type: path + body: + type: json + data: |- + { + "CollectionId": 17, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/subcollection/:subCollectionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/subcollection/:subCollectionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/subcollection/:subCollectionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/subcollection/:subCollectionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"Id":{"type":"integer","description":"Subcollection ID."},"CollectionId":{"type":"integer","description":"Collection ID."},"Name":{"type":"string","description":"Subcollection name."},"Type":{"type":"string","description":"Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used)."},"PreSale":{"type":"boolean","description":"Defines if the collection is on PreSale."},"Release":{"type":"boolean","description":"Defines if the collection is a new released one."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). + + Updates a previously created subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a collection. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Collection | **Write Collections** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection's unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 17, + "CollectionId": 151, + "Name": "group 1", + "Type": "Inclusive", + "PreSale": false, + "Release": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/Use specification value in subcollection by ID.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/Use specification value in subcollection by ID.yml new file mode 100644 index 0000000000..44d4c5af65 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/Use specification value in subcollection by ID.yml @@ -0,0 +1,94 @@ +info: + name: Use specification value in subcollection by ID + type: http + seq: 14 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subCollectionId + value: "80" + type: path + body: + type: json + data: |- + { + "SubCollectionId": 80, + "SpecificationValueId": 2461 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/subcollection/:subCollectionId/specificationvalue - Schema is valid", function () { + const schema = {"type":"object","properties":{"SubCollectionId":{"type":"integer","description":"Subcollection unique identifier."},"SpecificationValueId":{"type":"integer","description":"Subcollection specification value ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Uses a specification value in a subcollection searching by subcollection ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | Edit Category | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subCollectionId` | path | (Required) Subcollection unique numerical identifier, which can be obtained by placing a request to [Get subcollection by collection ID](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-subcollection-collectionid). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "SubCollectionId": 80, + "SpecificationValueId": 86 + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Subcollection/folder.yml b/BrunoCollections/VTEX - Catalog API/Subcollection/folder.yml new file mode 100644 index 0000000000..e291db59b2 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Subcollection/folder.yml @@ -0,0 +1,4 @@ +info: + name: Subcollection + type: folder + seq: 25 diff --git a/BrunoCollections/VTEX - Catalog API/Supplier/Create supplier.yml b/BrunoCollections/VTEX - Catalog API/Supplier/Create supplier.yml new file mode 100644 index 0000000000..b18a42ae31 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Supplier/Create supplier.yml @@ -0,0 +1,104 @@ +info: + name: Create supplier + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/catalog/pvt/supplier" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "Name": "Supplier", + "CorporateName": "TopStore", + "StateInscription": "123456", + "Cnpj": "33304981001272", + "Phone": "3333333333", + "CellPhone": "4444444444", + "CorportePhone": "5555555555", + "Email": "email@email.com", + "IsActive": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/catalog/pvt/supplier - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/catalog/pvt/supplier - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/catalog/pvt/supplier - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/catalog/pvt/supplier - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing the response.","properties":{"Id":{"type":"integer","description":"Supplier unique identifier code."},"Name":{"type":"string","description":"Supplier name."},"CorporateName":{"type":"string","description":"Supplier corporate name."},"StateInscription":{"type":"string","description":"State inscription."},"Cnpj":{"type":"string","description":"Corporate legal ID."},"Phone":{"type":"string","description":"Supplier phone."},"CellPhone":{"type":"string","description":"Supplier cellphone."},"CorportePhone":{"type":"string","description":"Supplier corporate phone."},"Email":{"type":"string","description":"Supplier email."},"IsActive":{"type":"boolean","description":"Defines if the Supplier is active (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new supplier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 123, + "Name": "Supplier", + "CorporateName": "TopStore", + "StateInscription": "123456", + "Cnpj": "33304981001272", + "Phone": "3333333333", + "CellPhone": "4444444444", + "CorportePhone": "5555555555", + "Email": "email@email.com", + "IsActive": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Supplier/Delete supplier.yml b/BrunoCollections/VTEX - Catalog API/Supplier/Delete supplier.yml new file mode 100644 index 0000000000..b89bb7ae3c --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Supplier/Delete supplier.yml @@ -0,0 +1,56 @@ +info: + name: Delete supplier + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/catalog/pvt/supplier/:supplierId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: supplierId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/catalog/pvt/supplier/:supplierId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing supplier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `supplierId` | path | (Required) Supplier's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Catalog API/Supplier/Update supplier.yml b/BrunoCollections/VTEX - Catalog API/Supplier/Update supplier.yml new file mode 100644 index 0000000000..d1ed27c18b --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Supplier/Update supplier.yml @@ -0,0 +1,109 @@ +info: + name: Update supplier + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog/pvt/supplier/:supplierId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: supplierId + value: "1" + type: path + body: + type: json + data: |- + { + "Name": "Supplier", + "CorporateName": "TopStore", + "StateInscription": "123456", + "Cnpj": "33304981001272", + "Phone": "3333333333", + "CellPhone": "4444444444", + "CorportePhone": "5555555555", + "Email": "email@email.com", + "IsActive": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog/pvt/supplier/:supplierId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog/pvt/supplier/:supplierId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog/pvt/supplier/:supplierId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog/pvt/supplier/:supplierId - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing the response.","properties":{"Id":{"type":"integer","description":"Supplier unique identifier code."},"Name":{"type":"string","description":"Supplier name."},"CorporateName":{"type":"string","description":"Supplier corporate name."},"StateInscription":{"type":"string","description":"State inscription."},"Cnpj":{"type":"string","description":"Corporate legal ID."},"Phone":{"type":"string","description":"Supplier phone."},"CellPhone":{"type":"string","description":"Supplier cellphone."},"CorportePhone":{"type":"string","description":"Supplier corporate phone."},"Email":{"type":"string","description":"Supplier email."},"IsActive":{"type":"boolean","description":"Defines if the Supplier is active (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates general information of an existing supplier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `supplierId` | path | (Required) Supplier's unique numerical identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 123, + "Name": "Supplier", + "CorporateName": "TopStore", + "StateInscription": "123456", + "Cnpj": "33304981001272", + "Phone": "3333333333", + "CellPhone": "4444444444", + "CorportePhone": "5555555555", + "Email": "email@email.com", + "IsActive": false + } + ``` diff --git a/BrunoCollections/VTEX - Catalog API/Supplier/folder.yml b/BrunoCollections/VTEX - Catalog API/Supplier/folder.yml new file mode 100644 index 0000000000..fd9d3023eb --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/Supplier/folder.yml @@ -0,0 +1,4 @@ +info: + name: Supplier + type: folder + seq: 28 diff --git a/BrunoCollections/VTEX - Catalog API/environments/VTEX.yml b/BrunoCollections/VTEX - Catalog API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Catalog API/opencollection.yml b/BrunoCollections/VTEX - Catalog API/opencollection.yml new file mode 100644 index 0000000000..9af9f5c124 --- /dev/null +++ b/BrunoCollections/VTEX - Catalog API/opencollection.yml @@ -0,0 +1,38 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Catalog API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Catalog API empowers merchants to seamlessly manage their product information. It enables the creation, modification, and deletion of product details, including attributes like images and specifications. SKU management covers product variations. This API also supports organizing products into categories, collections, and manage brands. + + > ⚠️ The default rate limit for the Catalog API is 45,000 requests per minute per account, and 15,000 requests per minute per endpoint. + + > ⚠️ The SKU ID is an integer with a maximum value of 2,147,483,647. + + > Check the [Catalog onboarding guide](https://developers.vtex.com/docs/guides/catalog-overview), created to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client preferences.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client preferences.yml new file mode 100644 index 0000000000..d6318a9f78 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client preferences.yml @@ -0,0 +1,194 @@ +info: + name: Add client preferences + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "locale": "pt-BR", + "optinNewsLetter": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to include client preferences information to a given shopping cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive client profile information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "a7e4702410864239959f9bdcf77e3fba", + "salesChannel": "1", + "loggedIn": false, + "isCheckedIn": false, + "storeId": "1", + "checkedInPickupPointId": "21", + "allowManualPrice": false, + "canEditData": true, + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "userType": "User type", + "ignoreProfileData": false, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": null, + "paymentData": { + "updateStatus": "updated", + "installmentOptions": [], + "paymentSystems": [], + "payments": [ + { + "paymentSystem": 6, + "bin": null, + "accountId": "12", + "tokenId": null, + "value": 34390, + "referenceValue": 34390, + "giftCardRedemptionCode": null, + "giftCardProvider": null, + "giftCardId": null + } + ], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [] + }, + "marketingData": null, + "sellers": [], + "clientPreferencesData": { + "locale": "PT", + "optinNewsLetter": false + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": {}, + "customData": null, + "itemMetadata": { + "items": [ + { + "id": "1", + "seller": "1", + "name": "Ração Royal Canin Feline Urinary 500g", + "skuName": "Ração Royal Canin Feline Urinary 500g", + "productId": "1", + "refId": "0001", + "ean": "123456789", + "imageUrl": "http://lojadobreno.vteximg.com.br/arquivos/ids/155450-55-55/Racao-Royal-Canin-Feline-Urinary-SO.jpg?v=637139444438700000", + "detailUrl": "/racao-royal-canin-feline-urinary/p", + "assemblyOptions": [] + } + ] + }, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "itemsOrdination": { + "criteria": "NAME", + "ascending": true + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client profile.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client profile.yml new file mode 100644 index 0000000000..8de801727a --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add client profile.yml @@ -0,0 +1,222 @@ +info: + name: Add client profile + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "email": "orders@acmecorp.com", + "firstName": "Jane", + "lastName": "Smith", + "documentType": "cnpj", + "document": "12345678000199", + "phone": "+5511987654321", + "corporateName": "Acme Corporation Ltda", + "tradeName": "Acme Corp", + "corporateDocument": "12345678000199", + "stateInscription": "123456789", + "corporatePhone": "+551122334455", + "isCorporate": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to include client profile information to a given shopping cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + >⚠️ The authentication of this endpoint can change depending on the customer context. If you are modifying information from a customer with a complete profile on the store, the response will return the customer's data masked. You can only access the customer data with an authenticated request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive client profile information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "9ceee0fde6db489fbc809a0e2ab13a86", + "salesChannel": "1", + "loggedIn": false, + "isCheckedIn": false, + "storeId": "1", + "checkedInPickupPointId": "21", + "allowManualPrice": false, + "canEditData": true, + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "userType": "User type", + "ignoreProfileData": false, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "document": "44444444444", + "documentType": "cpf", + "phone": "+5511123456789", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "551100988887777", + "isCorporate": false, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": null + }, + "paymentData": { + "updateStatus": "updated", + "installmentOptions": [], + "paymentSystems": [], + "payments": [ + { + "paymentSystem": 6, + "bin": null, + "accountId": "12", + "tokenId": null, + "value": 34390, + "referenceValue": 34390, + "giftCardRedemptionCode": null, + "giftCardProvider": null, + "giftCardId": null + } + ], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [] + }, + "marketingData": null, + "sellers": [], + "clientPreferencesData": { + "locale": "pt-BR", + "optinNewsLetter": null + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": {}, + "customData": null, + "itemMetadata": { + "items": [ + { + "id": "1", + "seller": "1", + "name": "Ração Royal Canin Feline Urinary 500g", + "skuName": "Ração Royal Canin Feline Urinary 500g", + "productId": "1", + "refId": "0001", + "ean": "123456789", + "imageUrl": "http://lojadobreno.vteximg.com.br/arquivos/ids/155450-55-55/Racao-Royal-Canin-Feline-Urinary-SO.jpg?v=637139444438700000", + "detailUrl": "/racao-royal-canin-feline-urinary/p", + "assemblyOptions": [] + } + ] + }, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "itemsOrdination": { + "criteria": "NAME", + "ascending": true + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item attachment.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item attachment.yml new file mode 100644 index 0000000000..92215c6f9d --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item attachment.yml @@ -0,0 +1,111 @@ +info: + name: Add item attachment + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 87ad1304f75940479ec04c1fa0947cb3 + type: path + - name: itemIndex + value: "0" + type: path + - name: attachmentName + value: vtex.subscription.testeplan05 + type: path + body: + type: json + data: |- + { + "content": { + "vtex.subscription.key.frequency": "1 month" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to add an attachment to a specific item in a shopping cart. Attachments allow you to include extra information to a cart item, such as subscription or gift details, according to the attachment schemas available for that item, which can be checked in the `attachmentOfferings` field of the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields). + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. This means the `orderFormId` is the identification code of a given cart. + + + You need to inform which cart you are referring to, by sending its `orderFormId`, which item will receive the attachment, by sending its `itemIndex`, and the name of the attachment, by sending its `attachmentName`. + + + > This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose item will receive the attachment. | + | `itemIndex` | path | (Required) The index of the item in the cart that will receive the attachment. Each cart item is identified by an index, starting in 0. | + | `attachmentName` | path | (Required) Name of the attachment that will be added to the item. It must match one of the attachment schemas available for the item, listed in the `attachmentOfferings` field of the orderForm. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 9 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item subscription attachment.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item subscription attachment.yml new file mode 100644 index 0000000000..a864a34e0d --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add item subscription attachment.yml @@ -0,0 +1,113 @@ +info: + name: Add item subscription attachment + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 96a589ee-3573-4aef-93c8-3bc9a5e00826 + type: path + body: + type: json + data: |- + { + "subscriptions": [ + { + "itemIndex": 0, + "plan": { + "frequency": { + "interval": 4, + "periodicity": "WEEK" + }, + "validity": { + "begin": "2020-12-22", + "end": "2023-10-21" + }, + "type": "RECURRING_PAYMENT" + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to attach subscription information to one or more items in a shopping cart, defining the recurrence plan (frequency, validity, and type) under which the items will be purchased. The available subscription schemas for each item can be checked in the `attachmentOfferings` field of the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields). + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. This means the `orderFormId` is the identification code of a given cart. + + + > This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart that will receive the subscription information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 14 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add marketing data.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add marketing data.yml new file mode 100644 index 0000000000..2115454ffe --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add marketing data.yml @@ -0,0 +1,215 @@ +info: + name: Add marketing data + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/marketingData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "utmSource": "app", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmiPage": "", + "utmiPart": "", + "utmiCampaign": "", + "coupon": "free-shipping", + "marketingTags": [ + "tag1", + "tag2" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/marketingData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/marketingData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/marketingData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/marketingData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to include marketing information to a given shopping cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive client profile information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "7c5b47971fad41b89102c7ab7bb8b08b", + "salesChannel": "1", + "loggedIn": false, + "isCheckedIn": false, + "storeId": "1", + "checkedInPickupPointId": "21", + "allowManualPrice": false, + "canEditData": true, + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "userType": "User type", + "ignoreProfileData": false, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": null, + "paymentData": { + "updateStatus": "updated", + "installmentOptions": [], + "paymentSystems": [], + "payments": [ + { + "paymentSystem": 6, + "bin": null, + "accountId": "12", + "tokenId": null, + "value": 34390, + "referenceValue": 34390, + "giftCardRedemptionCode": null, + "giftCardProvider": null, + "giftCardId": null + } + ], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [] + }, + "marketingData": { + "utmSource": "app", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmipage": null, + "utmiPart": null, + "utmiCampaign": null, + "coupon": "free-shipping", + "marketingTags": [ + "tag1", + "tag2" + ] + }, + "sellers": [], + "clientPreferencesData": { + "locale": "pt-BR", + "optinNewsLetter": null + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": {}, + "customData": null, + "itemMetadata": { + "items": [ + { + "id": "1", + "seller": "1", + "name": "Ração Royal Canin Feline Urinary 500g", + "skuName": "Ração Royal Canin Feline Urinary 500g", + "productId": "1", + "refId": "0001", + "ean": "123456789", + "imageUrl": "http://lojadobreno.vteximg.com.br/arquivos/ids/155450-55-55/Racao-Royal-Canin-Feline-Urinary-SO.jpg?v=637139444438700000", + "detailUrl": "/racao-royal-canin-feline-urinary/p", + "assemblyOptions": [] + } + ] + }, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "itemsOrdination": { + "criteria": "NAME", + "ascending": true + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add merchant context data.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add merchant context data.yml new file mode 100644 index 0000000000..5605c540d4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add merchant context data.yml @@ -0,0 +1,106 @@ +info: + name: Add merchant context data + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + body: + type: json + data: |- + { + "salesAssociateData": { + "salesAssociateId": "seller123" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData - Schema is valid", function () { + const schema = {"type":"object","properties":{"salesAssociateId":{"type":"string","description":"Sales Associate (Seller) identification code."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used for the merchant to add to the cart any relevant information that is related to the context of a specific order. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive the relevant information added by the merchant. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "salesAssociateData": { + "salesAssociateId": "seller123" + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add payment data.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add payment data.yml new file mode 100644 index 0000000000..e5c7080339 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add payment data.yml @@ -0,0 +1,110 @@ +info: + name: Add payment data + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "payments": [ + { + "paymentSystem": 6, + "paymentSystemName": "Boleto Bancário", + "group": "bankInvoicePaymentGroup", + "installments": 1, + "installmentsInterestRate": 0, + "installmentsValue": 34390, + "value": 34390, + "referenceValue": 34390, + "hasDefaultBillingAddress": false + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to include payment information to a given shopping cart. The payment information attachment in the shopping cart does not determine the final order payment method in itself. However, it allows tha platform to update any relevant information that may be impacted by the payment method. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive client profile information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 11 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Add shipping address and select delivery option.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add shipping address and select delivery option.yml new file mode 100644 index 0000000000..2e032eb123 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Add shipping address and select delivery option.yml @@ -0,0 +1,136 @@ +info: + name: Add shipping address and select delivery option + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/shippingData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "clearAddressIfPostalCodeNotFound": false, + "selectedAddresses": [ + { + "addressType": "residential", + "receiverName": "Clark Kent", + "addressId": "c3701fc4c61b4d1b91f67e81415db44d", + "isDisposable": true, + "postalCode": "12345000", + "city": "Rio de Janeiro", + "state": "ST", + "country": "BRA", + "street": "My street", + "number": "1091", + "neighborhood": "My neighborhood", + "complement": "", + "reference": "", + "geoCoordinates": [] + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": null, + "selectedDeliveryChannel": null + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/shippingData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/shippingData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/shippingData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/shippingData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to include shipping information and/or selected delivery option to a given shopping cart. + + To add shipping addresses, send the `selectedAddresses` array. To select a delivery option, use the `logisticsInfo` array. + + The `orderFormId` identifies the shopping cart. For more information, see [orderForm](https://developers.vtex.com/docs/guides/orderform-fields). + + This request has a timeout of 12 seconds. + + >⚠️ If the request modifies a customer with a complete profile, the response will return masked data. To access unmasked data, use an authenticated request. + + ## Delivery option selection + + If no `selectedSla` is sent in the request body, the API will automatically select the best delivery option among the ones available in the `slas` array, excluding pickup options and scheduled delivery options. If no such option is available, none will be selected. + + The best delivery option selected is the one that can fulfill the biggest item quantity for the lowest price. This selection does not consider delivery time. + + This process happens after the White Label Sellers selection in the Checkout pipeline. White label sellers selection is a separate process and is the responsibility of the Order Allocation module. For more information, see the [White label sellers selection](https://help.vtex.com/en/docs/tutorials/white-label-sellers-selection) article. + + For a pickup option or a scheduled delivery option to be selected, it must be explicitly sent in the request body in the `selectedSla` field. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive client profile information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Attach invoice data.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Attach invoice data.yml new file mode 100644 index 0000000000..e05971c5c3 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Attach invoice data.yml @@ -0,0 +1,208 @@ +info: + name: Attach invoice data + type: http + seq: 12 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/invoiceData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + body: + type: json + data: |- + { + "address": { + "addressType": "residential", + "city": "New York", + "complement": "101", + "country": "USA", + "geoCoordinates": [ + 40.7986877, + -73.9534529 + ], + "neighborhood": "Manhattan", + "number": "52", + "postalCode": "10019", + "reference": "Between the Upper West Side and Upper East Side", + "state": "NY", + "street": "North 110th Street" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/invoiceData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/invoiceData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/invoiceData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/invoiceData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Attaches invoice data to the cart. + + The [`orderForm`](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the `orderForm` that will receive the invoice data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "e66d440c15d0497692dffbec775cae2f", + "salesChannel": "1", + "loggedIn": true, + "isCheckedIn": false, + "storeId": null, + "checkedInPickupPointId": null, + "allowManualPrice": true, + "canEditData": true, + "userProfileId": "", + "userType": null, + "ignoreProfileData": false, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": { + "email": "karen.krieger@vtex.com", + "firstName": "", + "lastName": "", + "document": "", + "documentType": "", + "phone": "", + "corporateName": "", + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": null + }, + "paymentData": { + "updateStatus": "updated", + "installmentOptions": [], + "paymentSystems": [], + "payments": [], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [], + "availableAssociations": {} + }, + "marketingData": null, + "sellers": [], + "clientPreferencesData": { + "locale": "pt-BR", + "optinNewsLetter": null + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": { + "address": { + "postalCode": "10019", + "city": "New York", + "state": "NY", + "country": "USA", + "street": "North 110th Street", + "number": "52", + "neighborhood": "Manhattan", + "complement": "101", + "reference": "Between the Upper West Side and Upper East Side", + "geoCoordinates": [ + 40.7986877, + -73.9534529 + ] + } + }, + "customData": null, + "itemMetadata": {}, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "merchantContextData": null, + "purchaseAgentsData": null, + "itemsOrdination": {} + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Get client profile by email.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Get client profile by email.yml new file mode 100644 index 0000000000..c95fda1fd1 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Get client profile by email.yml @@ -0,0 +1,153 @@ +info: + name: Get client profile by email + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/profiles?email=clark.kent@examplemail.com" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: clark.kent@examplemail.com + type: query + - name: ensureComplete + value: "false" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/profiles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/profiles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/profiles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/profiles - Schema is valid", function () { + const schema = {"type":"object","properties":{"userProfileId":{"type":"string","description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account name."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"type":"object","description":"Address information.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"type":["string","null"],"description":"Complement to the address."},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"userProfile":{"type":"object","description":"Customer profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"document":{"type":"string","description":"Document."},"documentType":{"type":"string","description":"Document type."},"phone":{"type":"string","description":"Telephone number."},"corporateName":{"type":["string","null"],"description":"Name of the company. Used for corporate clients."},"tradeName":{"type":["string","null"],"description":"Trade name. Used for corporate clients."},"corporateDocument":{"type":["string","null"],"description":"Document. Used for corporate clients."},"stateInscription":{"type":["string","null"],"description":"State inscription. Used for corporate clients."},"corporatePhone":{"type":["string","null"],"description":"Telephone number. Used for corporate clients."},"isCorporate":{"type":"boolean","description":"Indicates whether the client is corporate."},"profileCompleteOnLoading":{"type":["boolean","null"],"description":"Profile complete when loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Profile error when loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"isComplete":{"type":"boolean","description":"Indicates whether customer profile is complete."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a client's profile information by providing an email address. + + + If the response body fields are empty, the following situations may have occurred: + + + 1. There is no client registered with the email address provided in your store, or; + + 2. Client profile is invalid or incomplete. However, you can use the query parameter `ensureComplete=false` to get incomplete profiles. For more information, see [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-customer-information-automatic-fill-in--2Nuu3xAFzdhIzJIldAdtan). + + >⚠️ The authentication of this endpoint can change depending on the customer context. If you are consulting information from a customer with a complete profile on the store, the response will return the customer's data masked. You can only access the customer data with an authenticated request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Shopping Cart Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Shopping Cart Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `email` | query | (Required) Client's email address to be searched. | + | `ensureComplete` | query | Indicates whether the returned profiles must be complete or not. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "profileProvider": "VTEX", + "availableAccounts": [], + "availableAddresses": [ + { + "addressType": "residential", + "receiverName": "Clark Kent", + "addressId": "666c2e830bd9474ab6f6cc53fb6dd2d2", + "isDisposable": false, + "postalCode": "12345-000", + "city": "Metropolis", + "state": "NY", + "country": "USA", + "street": "My street", + "number": "123", + "neighborhood": "My neighborhood", + "complement": "Complement", + "reference": "Reference", + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ] + } + ], + "userProfile": { + "email": "clark.kent@example.com", + "firstName": "Clark", + "lastName": "Kent", + "document": "12345678900", + "documentType": "cpf", + "phone": "+556199999999", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "551100988887777", + "isCorporate": false, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": null + }, + "isComplete": true + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item attachment.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item attachment.yml new file mode 100644 index 0000000000..1370472321 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item attachment.yml @@ -0,0 +1,103 @@ +info: + name: Remove item attachment + type: http + seq: 8 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 87ad1304f75940479ec04c1fa0947cb3 + type: path + - name: itemIndex + value: "0" + type: path + - name: attachmentName + value: vtex.subscription.testeplan05 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/attachments/:attachmentName - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to remove an attachment from a specific item in a shopping cart. Attachments allow you to include extra information to a cart item, such as subscription or gift details, according to the attachment schemas available for that item, which can be checked in the `attachmentOfferings` field of the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields). + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. This means the `orderFormId` is the identification code of a given cart. + + + You need to inform which cart you are referring to, by sending its `orderFormId`, which item will have the attachment removed, by sending its `itemIndex`, and the name of the attachment, by sending its `attachmentName`. + + + > This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose item will have the attachment removed. | + | `itemIndex` | path | (Required) The index of the item in the cart that will have the attachment removed. Each cart item is identified by an index, starting in 0. | + | `attachmentName` | path | (Required) Name of the attachment that will be removed from the item. It must match one of the attachment schemas available for the item, listed in the `attachmentOfferings` field of the orderForm. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 8 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item subscription attachment.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item subscription attachment.yml new file mode 100644 index 0000000000..3f5b458619 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/Remove item subscription attachment.yml @@ -0,0 +1,98 @@ +info: + name: Remove item subscription attachment + type: http + seq: 10 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 96a589ee-3573-4aef-93c8-3bc9a5e00826 + type: path + body: + type: json + data: |- + { + "subscriptions": [] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/attachments/subscriptionData - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to remove the subscription information attached to the items in a shopping cart. To remove all subscriptions from the cart, send an empty `subscriptions` array in the request body. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. This means the `orderFormId` is the identification code of a given cart. + + + > This request has a timeout of 12 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart that will have the subscription information removed. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Cart attachments/folder.yml b/BrunoCollections/VTEX - Checkout API/Cart attachments/folder.yml new file mode 100644 index 0000000000..528d9e2af4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Cart attachments/folder.yml @@ -0,0 +1,4 @@ +info: + name: Cart attachments + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Clear order form messages.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Clear order form messages.yml new file mode 100644 index 0000000000..d7717c2004 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Clear order form messages.yml @@ -0,0 +1,96 @@ +info: + name: Clear order form messages + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/messages/clear" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: "{}" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/messages/clear - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/messages/clear - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/messages/clear - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/messages/clear - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":"string","description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Available account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"type":["string","null"],"description":"Complement to the address."},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"string","description":"Attachment information."}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"Selected SLA. For example, `normal` or `express`. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, for example, `1223d5b4-52a4-442f-ab23-01345b60be48`. If this field is `null` or omitted, the API automatically selects the best delivery option available, excluding pickup and scheduled delivery options. To select a pickup option or a scheduled delivery option, it must be explicitly sent in this field. For more information, see the [Add shipping address and select delivery option](https://developers.vtex.com/docs/guides/checkout-api#tag/Cart-attachments/operation/AddShippingAddress) endpoint description."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, Three business days will be represented `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":"object","properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":["string","null"],"description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"integer","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Object containing information pertinent to the order's invoice."},"customData":{"type":["object","null"],"description":"Customer additional information."},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":"object","description":"Object containing information about the ordering of items within the orderForm.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request removes all messages from the `messages` field of the orderForm , leaving it empty. + + You must send an empty JSON in the body of the request. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose messages you want to remove. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 9 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Create order form configuration.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Create order form configuration.yml new file mode 100644 index 0000000000..a78827beac --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Create order form configuration.yml @@ -0,0 +1,83 @@ +info: + name: Create order form configuration + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pvt/configuration/orderForm" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "paymentConfiguration": { + "requiresAuthenticationForPreAuthorizedPaymentOption": false + }, + "taxConfiguration": null, + "minimumQuantityAccumulatedForItems": 1, + "decimalDigitsPrecision": 2, + "minimumValueAccumulated": null, + "apps": null, + "allowMultipleDeliveries": null, + "allowManualPrice": null + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/checkout/pvt/configuration/orderForm - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pvt/configuration/orderForm - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates the settings that will apply to every `orderForm` in the account. + + + For example, if you create an app using this request, every `orderForm` of this account will have the custom fields created through it. + + + >ℹ️ This request overwrites the entire configuration. To update only specific properties without overwriting the others, use the request [Update order form configuration](https://developers.vtex.com/docs/api-reference/checkout-api#patch-/api/checkout/pvt/configuration/orderForm) instead. Always retrieve the current configuration beforehand using the request [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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 `403` status code. These are the applicable resources for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Get order form configuration.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Get order form configuration.yml new file mode 100644 index 0000000000..96bcd8b00b --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Get order form configuration.yml @@ -0,0 +1,117 @@ +info: + name: Get order form configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pvt/configuration/orderForm" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pvt/configuration/orderForm - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pvt/configuration/orderForm - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pvt/configuration/orderForm - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pvt/configuration/orderForm - Schema is valid", function () { + const schema = {"type":"object","properties":{"paymentConfiguration":{"type":"object","description":"Payment configuration information.","properties":{"requiresAuthenticationForPreAuthorizedPaymentOption":{"type":"boolean","description":"Determines whether pre-authorized payments require authentication."},"allowInstallmentsMerge":{"type":"boolean","description":"By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installment options configured by every seller will be available. When indicated as `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those do not match. Installment values may not be equal in this case."}}},"taxConfiguration":{"type":["object","null"],"description":"External tax service configuration information.","properties":{"url":{"type":["string","null"],"description":"Endpoint URL."},"authorizationHeader":{"type":["string","null"],"description":"Authorization header."},"appId":{"type":"string","description":"Custom data ID sent to the tax system."},"isMarketplaceResponsibleForTaxes":{"type":"boolean","description":"Indicates whether the marketplace is responsible for the products taxes."}}},"minimumQuantityAccumulatedForItems":{"type":"integer","description":"Minimum SKU quantity by cart."},"decimalDigitsPrecision":{"type":"integer","description":"Number of price digits."},"minimumValueAccumulated":{"type":["integer","null"],"description":"Minimum cart value."},"apps":{"type":["array","null"],"description":"Array of objects containing Apps configuration information.","items":{"description":"App configuration information.","type":"object","properties":{"id":{"type":"string","description":"App ID."},"fields":{"type":"array","description":"Array of fields available to the app.","items":{"type":"string","description":"Available fieldValue name."}},"major":{"type":"integer","description":"App major version."}}}},"allowMultipleDeliveries":{"type":["boolean","null"],"description":"On the same purchase, allows the selection of items from multiple delivery channels."},"allowManualPrice":{"type":["boolean","null"],"description":"Allows the editing of SKU prices right in the cart."},"savePersonalDataAsOptIn":{"type":["boolean","null"],"description":"Allows users to select whether they want the store to keep their personal and payment data saved."},"maxNumberOfWhiteLabelSellers":{"type":["integer","null"],"description":"Allows the input of a limit of white label sellers involved on the cart."},"maskFirstPurchaseData":{"type":["boolean","null"],"description":"Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client does not want to share its data."},"recaptchaValidation":{"type":"string","description":"Configures reCAPTCHA validation for the account, defining in which situations the shopper will be prompted to validate a purchase with reCAPTCHA. Learn more about [reCAPTCHA validation for VTEX stores](https://help.vtex.com/en/tutorial/using-recaptcha-at-checkout--18Te3oDd7f4qcjKu9jhNzP)\n\r\n\rPossible values are:\n\r- `\"never\"`: no purchases are validated with reCAPTCHA.\n\r- `\"always\"`: every purchase is validated with reCAPTCHA.\n\r- `\"vtexCriteria\"`: only some purchases are validated with reCAPTCHA in order to minimize friction and improve shopping experience. VTEX's algorithm determines which sessions are trustworthy and which should be validated with reCAPTCHA. This is the recommended option."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the settings that are currently applied to every orderForm in the account. + + + These settings are defined by the request [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm). + + + Always use this request to retrieve the current configuration before performing an update. By doing so you ensure that you are modifying only the properties you want. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentConfiguration": { + "requiresAuthenticationForPreAuthorizedPaymentOption": false, + "allowInstallmentsMerge": false, + "blockPaymentSession": null + }, + "taxConfiguration": null, + "minimumQuantityAccumulatedForItems": 1, + "decimalDigitsPrecision": 2, + "minimumValueAccumulated": null, + "apps": [ + { + "fields": [ + "name", + "age" + ], + "id": "abcd", + "major": 1 + } + ], + "allowMultipleDeliveries": false, + "allowManualPrice": true, + "savePersonalDataAsOptIn": false, + "maxNumberOfWhiteLabelSellers": null, + "maskFirstPurchaseData": null, + "recaptchaValidation": "vtexCriteria" + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Get window to change seller.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Get window to change seller.yml new file mode 100644 index 0000000000..5847335dd5 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Get window to change seller.yml @@ -0,0 +1,70 @@ +info: + name: Get window to change seller + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pvt/configuration/window-to-change-seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Content-Type is text/plain", function () { + expect(String(res.getHeader("content-type"))).to.include("text/plain"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a marketplace's window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. + + + > The default period for this window is of 2 days, but it can be configured by the request Update window to change seller. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```text + 2 + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Update order form configuration.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Update order form configuration.yml new file mode 100644 index 0000000000..469e1bc80a --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Update order form configuration.yml @@ -0,0 +1,83 @@ +info: + name: Update order form configuration + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/checkout/pvt/configuration/orderForm" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "paymentConfiguration": { + "requiresAuthenticationForPreAuthorizedPaymentOption": false + }, + "taxConfiguration": null, + "minimumQuantityAccumulatedForItems": 1, + "decimalDigitsPrecision": 2, + "minimumValueAccumulated": null, + "apps": null, + "allowMultipleDeliveries": null, + "allowManualPrice": null + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/checkout/pvt/configuration/orderForm - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/checkout/pvt/configuration/orderForm - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Determines settings that will apply to every orderForm in the account. + + + For example, if you create an app using this request, every orderForm of this account will have the custom fields created though it. + + + >ℹ️ Always retrieve the current configuration before performing an update to ensure that you are modifying only the properties you want. Otherwise, old values can be overwritten. To retrieve the current configuration, use the request [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/Update window to change seller.yml b/BrunoCollections/VTEX - Checkout API/Configuration/Update window to change seller.yml new file mode 100644 index 0000000000..dfd74e1aaf --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/Update window to change seller.yml @@ -0,0 +1,66 @@ +info: + name: Update window to change seller + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pvt/configuration/window-to-change-seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "waitingTime": 4 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/checkout/pvt/configuration/window-to-change-seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a marketplace's window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. + + + > It is possible to check the current window using the request Get window to change seller. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout API/Configuration/folder.yml b/BrunoCollections/VTEX - Checkout API/Configuration/folder.yml new file mode 100644 index 0000000000..76639628d8 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Configuration + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Add address custom field.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Add address custom field.yml new file mode 100644 index 0000000000..63e3cf7028 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Add address custom field.yml @@ -0,0 +1,103 @@ +info: + name: Add address custom field + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customFields/address/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: addressId + value: 12345678-1234-1234-1234-123456789012 + type: path + body: + type: json + data: |- + { + "name": "desktop", + "value": "DK1", + "refId": "DK1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/address/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/address/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/address/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/address/:addressId - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Add a custom field to a specific address in an orderForm. The custom field is linked to the address ID. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm. | + | `addressId` | path | (Required) ID of the address. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 121 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Add item custom field.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Add item custom field.yml new file mode 100644 index 0000000000..422fb34aa4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Add item custom field.yml @@ -0,0 +1,103 @@ +info: + name: Add item custom field + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: itemId + value: E0F2B7AF5CD74D668F1E27537206912C + type: path + body: + type: json + data: |- + { + "name": "costCenter", + "value": "CC1", + "refId": "CC1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Add a custom field to a specific item in an orderForm. The custom field is linked to the item's unique ID. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm. | + | `itemId` | path | (Required) Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 122 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Add order custom field.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Add order custom field.yml new file mode 100644 index 0000000000..5ea6d395a3 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Add order custom field.yml @@ -0,0 +1,99 @@ +info: + name: Add order custom field + type: http + seq: 5 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customFields/order" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + body: + type: json + data: |- + { + "name": "poNumber", + "value": "PO2", + "refId": "PO2" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/order - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/order - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/order - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields/order - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Add a custom field to the order level of an orderForm. Order-level custom fields are not linked to any specific item or address. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 122 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Batch add custom fields.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Batch add custom fields.yml new file mode 100644 index 0000000000..cda2b689f7 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Batch add custom fields.yml @@ -0,0 +1,122 @@ +info: + name: Batch add custom fields + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customFields" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + body: + type: json + data: |- + [ + { + "linkedEntity": { + "type": "address", + "id": "12345678-1234-1234-1234-123456789012" + }, + "fields": [ + { + "name": "desktop", + "value": "DK1", + "refId": "DK1" + } + ] + }, + { + "linkedEntity": { + "type": "item", + "id": "E0F2B7AF5CD74D668F1E27537206912C" + }, + "fields": [ + { + "name": "costCenter", + "value": "CC1", + "refId": "CC1" + } + ] + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customFields - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Add multiple custom fields to an order form in a single request. Custom fields can be linked to the order, specific items, or addresses and be related to different entities from Master Data. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive the new custom fields. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 121 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Remove item custom field.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Remove item custom field.yml new file mode 100644 index 0000000000..da98b7c0d2 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Remove item custom field.yml @@ -0,0 +1,99 @@ +info: + name: Remove item custom field + type: http + seq: 7 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: itemId + value: E0F2B7AF5CD74D668F1E27537206912C + type: path + - name: fieldName + value: costCenter + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customFields/item/:itemId - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Remove a specific custom field from an item in an orderForm. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm. | + | `itemId` | path | (Required) Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart. | + | `fieldName` | path | (Required) Name of the custom field to remove. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 121 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Remove single custom field value.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Remove single custom field value.yml new file mode 100644 index 0000000000..4dd005bd1c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Remove single custom field value.yml @@ -0,0 +1,101 @@ +info: + name: Remove single custom field value + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: appId + value: appId + type: path + - name: appFieldName + value: appFieldName + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The value of a specific custom field can be removed by this request. + + + To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). + + + You also need to iform the specific field created in this app (identified by the `appFieldName` parameter, also passed through the URL) whose value you want to remove. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) The ID of the orderForm from which you want to remove the custom field value. | + | `appId` | path | (Required) ID of the app created through the Update orderForm Configuration endpoint. | + | `appFieldName` | path | (Required) Name of the app's field created through the Update orderForm Configuration endpoint and which will be deleted. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Set multiple custom field values.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Set multiple custom field values.yml new file mode 100644 index 0000000000..85a5e9b580 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Set multiple custom field values.yml @@ -0,0 +1,105 @@ +info: + name: Set multiple custom field values + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customData/:appId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: appId + value: appId + type: path + body: + type: json + data: |- + { + "fieldName": "fieldValue" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The values of these custom fields can then be updated by this request. + + + To do that, you need to inform the ID of the app you created with the configuration API (`appId`). + + + In the body of the request, for each field created in this app (`appFieldName`) you will inform a value (`appFieldValue`). + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive the new custom field values. | + | `appId` | path | (Required) ID of the app created with the configuration API. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/Set single custom field value.yml b/BrunoCollections/VTEX - Checkout API/Custom data/Set single custom field value.yml new file mode 100644 index 0000000000..b29567be00 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/Set single custom field value.yml @@ -0,0 +1,106 @@ +info: + name: Set single custom field value + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: 29154e27383145cc8ce1f7a1df0d99c4 + type: path + - name: appId + value: appId + type: path + - name: appFieldName + value: appFieldName + type: path + body: + type: json + data: "{appFieldValue}" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The value of a specific custom field can then be updated by this request. + + + To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). + + + In the body of the request, you will inform the new value (`appFieldValue`, passed through the body) of the specific field created in this app (identified by the `appFieldName` parameter, passed through the URL). + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) The ID of the orderForm whose custom field's value you want to change. | + | `appId` | path | (Required) ID of the app created through the Update orderForm Configuration endpoint. | + | `appFieldName` | path | (Required) Name of the app's field created through the Update orderForm Configuration endpoint. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Custom data/folder.yml b/BrunoCollections/VTEX - Checkout API/Custom data/folder.yml new file mode 100644 index 0000000000..2ee5dfa08f --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Custom data/folder.yml @@ -0,0 +1,4 @@ +info: + name: Custom data + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Checkout API/Fulfillment/Get address by postal code.yml b/BrunoCollections/VTEX - Checkout API/Fulfillment/Get address by postal code.yml new file mode 100644 index 0000000000..b1063b2471 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Fulfillment/Get address by postal code.yml @@ -0,0 +1,98 @@ +info: + name: Get address by postal code + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/postal-code/:countryCode/:postalCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: countryCode + value: BRA + type: path + - name: postalCode + value: "1234000" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/postal-code/:countryCode/:postalCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/postal-code/:countryCode/:postalCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/postal-code/:countryCode/:postalCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/postal-code/:countryCode/:postalCode - Schema is valid", function () { + const schema = {"description":"Address.","type":"object","properties":{"postalCode":{"description":"Postal code.","type":"string"},"city":{"description":"City.","type":"string"},"state":{"description":"State.","type":"string"},"country":{"description":"Country.","type":"string"},"street":{"description":"Street.","type":"string"},"number":{"description":"Number.","type":"string"},"neighborhood":{"description":"Neighborhood.","type":"string"},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"description":"Reference.","type":"string"},"geoCoordinates":{"description":"Geo coordinates.","type":"array","items":{"description":"Geo coordinate.","type":"integer"}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves address information for a given postal code and country. + + This request can be used to implement auto complete functionality when a customer needs to fill in an address. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `countryCode` | path | (Required) Three letter country code refering to the `postalCode` field. | + | `postalCode` | path | (Required) Postal code. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "postalCode": "12345000", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "My street", + "number": "34", + "neighborhood": "My neighborhood", + "complement": "Apto 101", + "reference": "Reference", + "geoCoordinates": [] + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Fulfillment/List pickup points by location.yml b/BrunoCollections/VTEX - Checkout API/Fulfillment/List pickup points by location.yml new file mode 100644 index 0000000000..b92d259039 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Fulfillment/List pickup points by location.yml @@ -0,0 +1,168 @@ +info: + name: List pickup points by location + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/pickup-points" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: geoCoordinates + value: -47.924747467041016; -15.832582473754883 + type: query + disabled: true + - name: postalCode + value: "1234000" + type: query + disabled: true + - name: countryCode + value: BRA + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/pickup-points - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/pickup-points - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/pickup-points - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/pickup-points - Schema is valid", function () { + const schema = {"type":"object","properties":{"paging":{"description":"Paging.","type":"object","properties":{"page":{"description":"Page number.","type":"integer"},"pageSize":{"description":"Page size.","type":"integer"},"total":{"description":"Total pages.","type":"integer"},"pages":{"description":"Pages.","type":"integer"}}},"items":{"description":"Items.","type":"array","items":{"description":"Item information.","type":"object","properties":{"distance":{"description":"Distance.","type":"number"},"pickupPoint":{"description":"Pickup point.","type":"object","properties":{"friendlyName":{"description":"Friendly name.","type":"string"},"address":{"description":"Address.","type":"object","properties":{"addressType":{"description":"Address type.","type":"string"},"receiverName":{"description":"Receiver name.","type":"string"},"addressId":{"description":"Address ID.","type":["string","null"]},"isDisposable":{"description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used.","type":"boolean"},"postalCode":{"description":"Postal code.","type":"string"},"city":{"description":"City.","type":"string"},"state":{"description":"State.","type":"string"},"country":{"description":"Country.","type":"string"},"street":{"description":"Street.","type":"string"},"number":{"description":"Number.","type":"string"},"neighborhood":{"description":"Neighborhood.","type":"string"},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"description":"Racao.","type":"string"},"geoCoordinates":{"description":"Geo coordinates.","type":"array","items":{"description":"Geo coordinate.","type":"integer"}}}},"additionalInfo":{"description":"Additional info.","type":"string"},"id":{"description":"ID.","type":"string"},"businessHours":{"description":"Array with business hours.","type":"array","items":{"description":"Business hours.","type":"object","properties":{"DayOfWeek":{"description":"Day of week.","type":"integer"},"OpeningTime":{"description":"Opening time.","type":"string"},"ClosingTime":{"description":"Closing time.","type":"string"}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information on pickup points close to a given location determined by geocoordinates or postal code. + + + The pickup points returned are not necessarily all active ones. Make sure to validate the information consumed by integrations. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `geoCoordinates` | query | Geocoordinates (first longitude, then latitude) around which to search for pickup points. If you use this type of search, do not pass postal and country codes. | + | `postalCode` | query | Postal code around which to search for pickup points. If you use this type of search, make sure to pass a `countryCode` and do not pass `geoCoordinates`. | + | `countryCode` | query | Three letter country code refering to the `postalCode` field. Pass the country code only if you are searching pickup points by postal code. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paging": { + "page": 1, + "pageSize": 30, + "total": 1, + "pages": 1 + }, + "items": [ + { + "distance": 0.8469786518616546, + "pickupPoint": { + "friendlyName": "physical-store-02", + "address": { + "addressType": "pickup", + "receiverName": "", + "addressId": "physical-store-02", + "isDisposable": true, + "postalCode": "23450-070", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "132", + "neighborhood": "Botafogo", + "complement": "Apto 101", + "reference": "", + "geoCoordinates": [ + -47, + -15 + ] + }, + "additionalInfo": "", + "id": "02_Physical", + "businessHours": [ + { + "DayOfWeek": 0, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + }, + { + "DayOfWeek": 1, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + }, + { + "DayOfWeek": 2, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + }, + { + "DayOfWeek": 3, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + }, + { + "DayOfWeek": 4, + "OpeningTime": "00:00:00", + "ClosingTime": "23:50:00" + }, + { + "DayOfWeek": 5, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + }, + { + "DayOfWeek": 6, + "OpeningTime": "00:00:00", + "ClosingTime": "23:59:00" + } + ] + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Fulfillment/folder.yml b/BrunoCollections/VTEX - Checkout API/Fulfillment/folder.yml new file mode 100644 index 0000000000..0a7d9eee15 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Fulfillment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Fulfillment + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Checkout API/Order placement/Place order from an existing cart.yml b/BrunoCollections/VTEX - Checkout API/Order placement/Place order from an existing cart.yml new file mode 100644 index 0000000000..c0dad0c74a --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Order placement/Place order from an existing cart.yml @@ -0,0 +1,101 @@ +info: + name: Place order from an existing cart + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/transaction" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "referenceId": "41a22925298a4ddca95318131a25b000", + "savePersonalData": false, + "optinNewsLetter": false, + "value": 6800, + "referenceValue": 6800, + "interestValue": 0 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint places an order from an existing `orderForm` object, meaning an existing cart. + + + After the creation of an order with this request, you have five minutes to send payment information and then request payment processing. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the `orderForm` corresponding to the cart from which to place the order. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Order placement/Place order.yml b/BrunoCollections/VTEX - Checkout API/Order placement/Place order.yml new file mode 100644 index 0000000000..a3bfd47db2 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Order placement/Place order.yml @@ -0,0 +1,191 @@ +info: + name: Place order + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "items": [ + { + "id": "123456789", + "quantity": 1, + "seller": "1", + "price": 2499, + "commission": 10, + "freightCommission": 5, + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false, + "bundleItems": [ + { + "type": "gift-wrap", + "id": "gift-123", + "name": "Gift Wrapping", + "price": 199 + } + ], + "priceTags": [ + { + "identifier": "discount-123", + "isPercentual": false, + "name": "Promotional Discount", + "rawValue": -10, + "value": -1000 + } + ] + } + ], + "clientProfileData": { + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "documentType": "cpf", + "document": "12345678900", + "phone": "+5511999999999", + "isCorporate": false + }, + "shippingData": { + "address": { + "addressType": "residential", + "receiverName": "John Doe", + "postalCode": "12345-000", + "city": "São Paulo", + "state": "SP", + "country": "BRA", + "street": "Avenida Paulista", + "number": "1000", + "neighborhood": "Bela Vista", + "complement": "Apt 101", + "reference": "Next to the park" + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Express", + "selectedDeliveryChannel": "delivery", + "shippingEstimate": "2d", + "price": 1099 + } + ], + "updateStatus": "updated" + }, + "paymentData": { + "payments": [ + { + "paymentSystem": 1, + "referenceValue": 2499, + "value": 2499, + "installments": 1 + } + ], + "giftCards": [ + { + "redemptionCode": "GIFT-1234-5678", + "value": 500, + "balance": 500, + "name": "Birthday Gift Card", + "id": "gift123", + "inUse": true, + "isSpecialCard": false + } + ], + "updateStatus": "updated" + }, + "marketingData": { + "coupon": "SUMMER10", + "utmSource": "Google", + "utmMedium": "CPC", + "utmCampaign": "Summer_Sale" + }, + "openTextField": "Please deliver after 5 PM.", + "salesAssociateData": { + "salesAssociateId": "seller123" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orders - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderForm":{"type":["string","null"],"description":"This is `null` since this request does not depend on any previously existing orderForm information in the platform."},"transactionData":{"type":"object","description":"Information on each transaction pertinent to the order placed.","properties":{"merchantTransactions":{"type":"array","description":"Information on each merchant transaction.","items":{"description":"Merchant transaction information.","type":"object","properties":{"id":{"type":"string","description":"ID of the seller."},"transactionId":{"type":"string","description":"ID of the transaction in the platform."},"merchantName":{"type":"string","description":"Name of the merchant responsible for the sale."},"payments":{"type":"array","description":"Information on each payment pertinent to the transaction.","items":{"description":"Payment information.","type":"object","properties":{"paymentSystem":{"type":"integer","description":"Payment system."},"bin":{"type":["string","null"],"description":"Payment bin."},"accountId":{"type":["string","null"],"description":"Account ID."},"tokenId":{"type":["string","null"],"description":"Token ID."},"value":{"type":"integer","description":"Total value to be paid in this payment."},"referenceValue":{"type":"integer","description":"Reference value over which interests may be applied."},"giftCardRedemptionCode":{"type":["string","null"],"description":"Gift card redemption code."},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."}}}}}}},"receiverUri":{"type":"string","description":"Receiver URI."},"gatewayCallbackTemplatePath":{"type":"string","description":"Template of the gateway callback path, which may later be used to send information about the transaction."}}},"orders":{"type":"array","description":"Information on each of the orders created.","items":{"description":"Order information.","type":"object","properties":{"orderId":{"type":"string","description":"ID of the order in the Order Management System (OMS)."},"orderGroup":{"type":"string","description":"Order group. Orders that involve different sellers are split into different orders of a same order group."},"state":{"type":["string","null"],"description":"State."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"sellerOrderId":{"type":["string","null"],"description":"ID of the order in the seller."},"storeId":{"type":["string","null"],"description":"Store ID."},"checkedInPickupPointId":{"type":["string","null"],"description":"Checked in pickup point."},"value":{"type":"integer","description":"Value of the order."},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/pt/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"string","description":"Attachment ID."}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"totals":{"type":"array","description":"Information on order totals.","items":{"description":"Order total information.","type":"object","properties":{"id":{"type":"string","description":"Total ID."},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value."}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Rate and benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Rate and benefit teaser."}}}},"shippingData":{"type":"object","description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"Selected SLA. For example, `normal` or `express`. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, for example, `1223d5b4-52a4-442f-ab23-01345b60be48`. If this field is `null` or omitted, the API automatically selects the best delivery option available, excluding pickup and scheduled delivery options. To select a pickup option or a scheduled delivery option, it must be explicitly sent in this field. For more information, see the [Add shipping address and select delivery option](https://developers.vtex.com/docs/guides/checkout-api#tag/Cart-attachments/operation/AddShippingAddress) endpoint description."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer. For example, `\"delivery\"` or `\"pickup-in-point\"`."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, Three business days will be represented `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":"object","properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"integer","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"type":"object","description":"Item metadata.","properties":{"id":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"salesChannel":{"type":"string","description":"Sales channel."},"followUpEmail":{"type":"string","description":"Follow up email address."},"creationDate":{"type":"string","description":"Creation date."},"lastChange":{"type":"string","description":"Last change."},"timeZoneCreationDate":{"type":"string","description":"Time zone creation date."},"timeZoneLastChange":{"type":"string","description":"Time zone last change."},"isCompleted":{"type":"boolean","description":"Indicates whether order is completed."},"hostName":{"type":"string","description":"Host name."},"merchantName":{"type":["string","null"],"description":"Merchant name."},"userType":{"type":"string","description":"User type."},"roundingError":{"type":"integer","description":"Rounding error."},"allowEdition":{"type":"boolean","description":"Indicates whether edition is allowed."},"allowCancelation":{"type":"boolean","description":"Indicates whether cancelation is allowed."},"allowChangeSeller":{"type":"boolean","description":"Indicates whether seller changing is allowed."},"isUserDataVisible":{"type":"boolean","description":"Indicates whether user data is visible."},"orderFormCreationDate":{"type":"string","description":"`orderForm` creation date."},"salesAssociateId":{"type":"string","description":"Sales Associate (Seller) identification code."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Places order without having any prior cart information. This means all information on items, client, payment and shipping must be sent in the body. + + >⚠️ The authentication of this endpoint is required if you are creating an order with an item that has an attachment that creates a Subscription. For more information, access [Subscriptions API](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sc` | query | Trade Policy (Sales Channel) identification. This query can be used to create an order for a specific sales channel. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 11 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Order placement/Process order.yml b/BrunoCollections/VTEX - Checkout API/Order placement/Process order.yml new file mode 100644 index 0000000000..39fd42e1a0 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Order placement/Process order.yml @@ -0,0 +1,67 @@ +info: + name: Process order + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/gatewayCallback/:orderGroup" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Cookie + value: Vtex_CHKO_Auth=0e/RpYIEZu19BuwXB4tZ7eIGu9HT8vdUAHWQDHDpxMc=; CheckoutDataAccess=0e/PoiTEZu19BuwXB4tZ7eIGu9HT8vdUAHWQDHDpxMc= + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderGroup + value: "123456789" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/checkout/pub/gatewayCallback/:orderGroup - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Order processing callback request, which is made after an order's payment is approved. + + + > This request has to be made within five minutes after the [Place order](https://developers.vtex.com/docs/api-reference/checkout-api#put-/api/checkout/pub/orders) or [Place order from existing cart](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/transaction) request has been made, or else, the order will not be processed. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save Order Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderGroup` | path | (Required) Order group. It is the part of the `orderId` that comes before the `-`. For example, the `orderGroup` of the order `123456789-01` is `123456789`. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Cookie` | header | (Required) VTEX Chekout cookie associated with a specific order. Use the `Vtex_CHKO_Auth` and the `CheckoutDataAccess` cookies returned by the [Place order](https://developers.vtex.com/vtex-rest-api/reference/order-placement-1#placeorder) or [Place order from existing cart](https://developers.vtex.com/vtex-rest-api/reference/order-placement-1#placeorderfromexistingorderform) API requests, like a browser would. | diff --git a/BrunoCollections/VTEX - Checkout API/Order placement/folder.yml b/BrunoCollections/VTEX - Checkout API/Order placement/folder.yml new file mode 100644 index 0000000000..94ee177e17 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Order placement/folder.yml @@ -0,0 +1,4 @@ +info: + name: Order placement + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Checkout API/Region/Get sellers by region or address.yml b/BrunoCollections/VTEX - Checkout API/Region/Get sellers by region or address.yml new file mode 100644 index 0000000000..fd844dea00 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Region/Get sellers by region or address.yml @@ -0,0 +1,134 @@ +info: + name: Get sellers by region or address + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/regions/:regionId?country=BRA" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: country + value: BRA + type: query + - name: postalCode + value: "1234000" + type: query + disabled: true + - name: geoCoordinates + value: "-47.924747467041016" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: regionId + value: v2.1BB18CE648B5111D0933734ED83EC783 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/regions/:regionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/regions/:regionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/regions/:regionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/regions/:regionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Region ID."},"sellers":{"type":"array","description":"Array with information on each seller retrieved for the given region.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of sellers that cater to a specific region or address, according to your setup of our [regionalization feature](https://help.vtex.com/en/tutorial/setting-up-price-and-availability-of-skus-by-region--12ne58BmvYsYuGsimmugoc#). Learn more about [Region v2](https://developers.vtex.com/docs/guides/region-v2-release). + + + To access the list of sellers, you must choose one of the following methods: + + + 1. Send the identification of the list of sellers (`regionId`) as a path parameter through the URL. Or; + + 2. Send the `country` (3-digit ISO code) and at least one of the two values (`postal Code` or `geo Coordinates`) as query parameters through the URL. For this method, it is also allowed to send both values (`postalCode` or `geoCoordinates`) in the same request. + + + > The `regionId` and `country` parameters are indicated as required in this documentation. However, only one of them should be sent in the request according to one of the methods mentioned above. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Shopping Cart Full Access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `regionId` | path | (Required) ID of the region corresponding to the shopper's location. | + | `country` | query | (Required) Three letter country code refering to the `postalCode` field. | + | `postalCode` | query | Postal code corresponding to the shopper's location. | + | `geoCoordinates` | query | Geocoordinates (first longitude, semicolon, then latitude) corresponding to the shopper's location. | + | `geoCoordinates` | query | Geocoordinates (first longitude, semicolon, then latitude) corresponding to the shopper's location. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "v2.1BB18CE648B5111D0933734ED83EC783", + "sellers": [ + { + "id": "abacaba", + "name": "Abacaba Store", + "logo": null + }, + { + "id": "abacaba2", + "name": "Abacaba VTEX Outlet", + "logo": null + }, + { + "id": "abacaba3", + "name": "Abacaba VTEX Mall", + "logo": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Region/folder.yml b/BrunoCollections/VTEX - Checkout API/Region/folder.yml new file mode 100644 index 0000000000..b89e3e05af --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Region/folder.yml @@ -0,0 +1,4 @@ +info: + name: Region + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Add cart items.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Add cart items.yml new file mode 100644 index 0000000000..2a76251bc4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Add cart items.yml @@ -0,0 +1,111 @@ +info: + name: Add cart items + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: allowedOutdatedData + value: paymentData + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "orderItems": [ + { + "quantity": 3, + "seller": "1", + "id": "2005", + "index": 0, + "price": 1099 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to add a new item to the shopping cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + > This request has a time out of 45 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart in which the new item will be added. | + | `allowedOutdatedData` | query | In order to optimize performance, this parameter allows some information to not be updated when there are changes in the minicart. For instance, if a shopper adds another unit of a given SKU to the cart, it may not be necessary to recalculate payment information, which could impact performance. This array accepts strings and currently the only possible value is `”paymentData”`. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 11 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Add coupons to the cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Add coupons to the cart.yml new file mode 100644 index 0000000000..9279d81c3b --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Add coupons to the cart.yml @@ -0,0 +1,103 @@ +info: + name: Add coupons to the cart + type: http + seq: 14 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/coupons" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "text": "freeshipping" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/coupons - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/coupons - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/coupons - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/coupons - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":"string","description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Available account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"type":["string","null"],"description":"Complement to the address."},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"string","description":"Attachment information."}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":"object","description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"Selected SLA. For example, `normal` or `express`. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, for example, `1223d5b4-52a4-442f-ab23-01345b60be48`. If this field is `null` or omitted, the API automatically selects the best delivery option available, excluding pickup and scheduled delivery options. To select a pickup option or a scheduled delivery option, it must be explicitly sent in this field. For more information, see the [Add shipping address and select delivery option](https://developers.vtex.com/docs/guides/checkout-api#tag/Cart-attachments/operation/AddShippingAddress) endpoint description."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"type":"object","description":"Delivery ID information.","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, Three business days will be represented `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`.","type":"boolean"},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"type":"object","description":"Selected address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array containing two floats with geocoordinates, first longitude, then latitude.","items":{"type":"number","description":"Geocoordinates numbers."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":["object","null"],"properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"integer","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containIng promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":["string","null"],"description":"UTM source."},"utmMedium":{"type":["string","null"],"description":"UTM medium."},"utmCampaign":{"type":["string","null"],"description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":["object","null"],"properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":"boolean","description":"`true` if the client opted to receive newsletter from the store.","nullable":false}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON`, even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api)."},"invoiceData":{"type":"object","description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information."},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":["object","null"],"properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":"object","description":"Object containing information about the ordering of items within the orderForm.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use this request to add coupons to a given shopping cart. + + + To add multiple coupons to the same cart, you need to: + + + 1. Request the activation of this feature through the [Support VTEX](https://help.vtex.com/support) if this is the first time you perform this action on your store. + + 2. Submit all coupon codes in the same requisition separated by commas. E.g.: {"text": "freeshipping, discount10, holiday30"}. + + For more information on multiple coupons, access the [coupons tutorial](https://help.vtex.com/en/tutorial/creating-a-coupon-beta--7lMk3MmhNp2IEccyGApxU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm that will receive coupon information. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 9 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart installments.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart installments.yml new file mode 100644 index 0000000000..5c22bc44fb --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart installments.yml @@ -0,0 +1,160 @@ +info: + name: Cart installments + type: http + seq: 13 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/installments?paymentSystem=2" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentSystem + value: "2" + type: query + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId/installments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId/installments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId/installments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId/installments - Schema is valid", function () { + const schema = {"type":"object","properties":{"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"array","description":"Array of installments.","items":{"description":"Object with installments information.","type":"object","properties":{"count":{"description":"An explanation about the purpose of this instance.","type":"integer"},"hasInterestRate":{"description":"An explanation about the purpose of this instance.","type":"boolean"},"interestRate":{"description":"An explanation about the purpose of this instance.","type":"integer"},"value":{"description":"An explanation about the purpose of this instance.","type":"integer"},"total":{"description":"An explanation about the purpose of this instance.","type":"integer"},"sellerMerchantInstallments":{"description":"An explanation about the purpose of this instance.","type":"array","items":{"description":"An explanation about the purpose of this instance.","type":"object","properties":{"id":{"description":"Installment ID.","type":"string"},"count":{"description":"Count.","type":"integer"},"hasInterestRate":{"description":"If the installment has an interest rate.","type":"boolean"},"interestRate":{"description":"Interest rate number.","type":"integer"},"value":{"description":"Installment value.","type":"integer"},"total":{"description":"Installment total.","type":"integer"}}}}}}},"paymentSystem":{"type":"integer","description":"Payment system."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."},"paymentName":{"type":["string","null"],"description":"Payment name."},"paymentGroupName":{"type":["string","null"],"description":"Payment group name."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves possible amount of installments and respective values for a given cart with a given payment method. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + This endpoint can be used to get the installment options for only one payment method at a time. + + + This endpoint should be called only after the selected `orderForm` already has a `paymentData`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the `orderForm` to be consulted for installments. | + | `paymentSystem` | query | (Required) ID of the payment method to be consulted for installments. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentSystem": 2, + "bin": null, + "paymentName": null, + "paymentGroupName": null, + "value": 32000, + "installments": [ + { + "count": 1, + "hasInterestRate": false, + "interestRate": 0, + "value": 32000, + "total": 32000, + "sellerMerchantInstallments": [ + { + "id": "MyStore", + "count": 1, + "hasInterestRate": false, + "interestRate": 0, + "value": 32000, + "total": 32000 + } + ] + }, + { + "count": 2, + "hasInterestRate": false, + "interestRate": 0, + "value": 1600, + "total": 32000, + "sellerMerchantInstallments": [ + { + "id": "MyStore", + "count": 2, + "hasInterestRate": false, + "interestRate": 0, + "value": 1600, + "total": 32000 + } + ] + }, + { + "count": 3, + "hasInterestRate": false, + "interestRate": 0, + "value": 10666, + "total": 32000, + "sellerMerchantInstallments": [ + { + "id": "MyStore", + "count": 3, + "hasInterestRate": false, + "interestRate": 0, + "value": 10666, + "total": 32000 + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart simulation.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart simulation.yml new file mode 100644 index 0000000000..ea144493a9 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Cart simulation.yml @@ -0,0 +1,121 @@ +info: + name: Cart simulation + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForms/simulation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: RnbBehavior + value: "0" + type: query + disabled: true + - name: sc + value: "1" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "items": [ + { + "id": "12345", + "quantity": 2, + "seller": "1" + }, + { + "id": "67890", + "quantity": 1, + "seller": "2" + } + ], + "country": "BRA", + "postalCode": "12345-000", + "geoCoordinates": [ + -47.924747, + -15.832582 + ], + "allowedOutdatedData": [ + "inventoryData", + "promotionData", + "paymentData" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Schema is valid", function () { + const schema = {"type":"object","properties":{"items":{"type":"array","description":"Information on each item in the cart.","items":{"type":"object","description":"Object containing information of the item.","properties":{"id":{"type":"string","description":"ID of the item."},"requestIndex":{"type":"integer","description":"Request index information."},"quantity":{"type":"integer","description":"The quantity of the item the cart."},"seller":{"type":"string","description":"The seller responsible for the SKU."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"offerings":{"type":"array","description":"Array containing offering information of SKU service. A service is an item that may come with a product, optionally and with cost. It is used to assign a value of an additional service itself to an SKU.","items":{"type":"object","description":"Service general information.","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"string","description":"Service type ID."},"name":{"type":"string","description":"Name of the service type."},"allowGiftMessage":{"type":"boolean","description":"Option to display the service type on the gift card."},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"price":{"type":"integer","description":"Service type price."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"availability":{"type":"string","description":"Availability."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"type":"object","description":"Item value and rounding quantity.","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"ratesAndBenefitsData":{"type":"object","description":"Information on pricing and promotions that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with pricing and promotions identifiers.","items":{"type":"string","description":"Promotion identifier."}},"teaser":{"type":"array","description":"List with pricing and promotions teaser.","items":{"type":"string","description":"Promotion teaser."}}}},"paymentData":{"type":"object","description":"Payment data information.","properties":{"installmentOptions":{"type":"array","description":"List of Installment options.","items":{"type":"object","description":"Information about the installment option.","properties":{"paymentSystem":{"type":"integer","description":"Payment system identification."},"bin":{"type":["string","null"],"description":"Card bin."},"paymentName":{"type":["string","null"],"description":"Payment name."},"paymentGroupName":{"type":["string","null"],"description":"Payment group name."},"value":{"type":"integer","description":"Total value assigned to this payment."},"installments":{"type":"array","description":"Installment information.","items":{"type":"object","description":"Installment information.","properties":{"count":{"type":"integer","description":"Count information."},"hasInterestRate":{"type":"boolean","description":"Indicates whether the payment has interest."},"interestRate":{"type":"integer","description":"Interest rate value."},"value":{"type":"integer","description":"Value of the order without the interest rate. The value is shown without separating cents."},"total":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments information.","items":{"type":"object","description":"Installment information."}}}}}}}},"paymentSystems":{"type":"array","description":"Information on payment systems.","items":{"type":"object","description":"Payment system information.","properties":{"id":{"type":"integer","description":"Payment system ID."},"name":{"type":"string","description":"Payment system name."},"groupName":{"type":"string","description":"Payment group name."},"validator":{"type":["object","null"],"description":"Payment system validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"description":{"type":"string","description":"Description."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether a authentication is required."},"dueDate":{"type":"string","description":"Payment due date."},"availablePayments":{"type":["string","null"],"description":"Availability of payment."}}}},"payments":{"type":"array","description":"Array with information on each payment chosen by the shopper.","items":{"type":"object","description":"Payment information.","properties":{"paymentSystem":{"type":"integer","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"group":{"type":"string","description":"Payment system group."},"installments":{"type":"integer","description":"Selected number of installments."},"installmentsInterestRate":{"type":"number","description":"Installments' interest rate."},"installmentsValue":{"type":"integer","description":"Value of the installments."},"value":{"type":"integer","description":"Total value assigned to this payment."},"referenceValue":{"type":"integer","description":"Reference value used to calculate total order value with interest."},"hasDefaultBillingAddress":{"type":"boolean","description":"Indicates whether billing address for this payment is the default address."}}}},"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"type":"string","description":"Gift card."}},"giftCardMessages":{"type":"array","description":"Array of gift card messages.","items":{"type":"string","description":"Gift card message."}},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Available account."}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"availableAssociations":{"type":"object","description":"Available associations."}}},"selectableGifts":{"type":"array","description":"Array containing the data of the items selected as a gift.","items":{"type":"string","description":"Selected gift item."}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs."},"postalCode":{"type":["string","null"],"description":"Postal code."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"logisticsInfo":{"type":"array","description":"Array with logistics information on each item of the `items` array in the `orderForm`.","items":{"description":"Logistics information of a item.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index of item in items array."},"addressId":{"type":["string","null"],"description":"Address ID."},"selectedSla":{"type":["string","null"],"description":"Selected SLA. For example, `normal` or `express`. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer. For example, `\"delivery\"` or `\"pickup-in-point\"`."},"quantity":{"type":"integer","description":"Quantity."},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Country that the item may be shipped to."}},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"type":"object","description":"Object with delivery infomation.","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"availableDeliveryWindows":{"type":"object","description":"This object contains information about the delivery window available to the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"deliveryWindow":{"type":"object","description":"In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information."},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"type":"object","description":"Object containing delivery channel ID.","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"purchaseConditions":{"type":"object","description":"Purchase conditions information.","properties":{"itemPurchaseConditions":{"type":"array","description":"List of objects containing purchase condition information on each item in the order.","items":{"type":"object","description":"Purchase condition information.","properties":{"id":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller ID."}},"slas":{"type":"array","description":"Information on available SLAs.","items":{"type":"object","description":"SLA information.","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"type":"object","description":"Object with delivery inforamtion.","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment. Ex. `vtex.subscription.weekly`."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"availableDeliveryWindows":{"type":"object","description":"This object contains information about the delivery window available to the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"deliveryWindow":{"type":"object","description":"In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information."},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."}}}}}},"pickupPoints":{"type":"array","description":"Array containing pickup points information.","items":{"type":"string","description":"Pickup points."}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"totals":{"type":"array","description":"Information on order totals.","items":{"type":"object","description":"Order information.","properties":{"id":{"type":"string","description":"Total ID."},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value."}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"type":"object","description":"Object containing item metadata.","properties":{"id":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"seller":{"type":"string","description":"Seller."},"assemblyOptions":{"type":"array","description":"Assembly options information.","items":{"type":"string","description":"Assembly option.","properties":{"id":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"name":{"type":"string","description":"Item name."},"required":{"type":"boolean","description":"Indicates whether the item is required."},"inputValues":{"type":"object","description":"Input values information."},"composition":{"type":["string","null"],"description":"Composition information."}}}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used to simulate a cart in VTEX Checkout. + + It receives an SKU ID, the quantity of items in the cart and the seller ID. + + It returns all information about the cart, such as the selling price of each item, pricing and promotion data, payment and logistics info. + + This request is useful whenever you need to know the availability of fulfilling an order for a specific cart setting, since the API response will let you know the updated price, inventory and shipping data. + + >⚠️ The fields (`sku id`, `quantity`, `seller`, `country`, `postalCode` and `geoCoordinates`) are just examples of content that you can simulate in your cart. You can add more fields to the request as per your need. Access the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) guide to check the available fields. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `RnbBehavior` | query | This parameter defines which promotions apply to the simulation. Use `0` for simulations at cart stage, which means all promotions apply. In case of window simulation use `1`, which indicates promotions that apply nominal discounts over the total purchase value shouldn't be considered on the simulation. Note that if this not sent, the parameter is `1`. | + | `sc` | query | Trade Policy (Sales Channel) identification. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Change price of an SKU in a cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Change price of an SKU in a cart.yml new file mode 100644 index 0000000000..de14834a80 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Change price of an SKU in a cart.yml @@ -0,0 +1,111 @@ +info: + name: Change price of an SKU in a cart + type: http + seq: 9 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + - name: itemIndex + value: "0" + type: path + body: + type: json + data: |- + { + "price": 10000 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request changes the price of an SKU in a cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + You need to inform which cart you are referring to, by sending its `orderFormId` and what is the item whose price you want to change, by sending its `itemIndex`. + + + You also need to pass the new price value in the body. + + + Remember that, to use this endpoint, the feature of *manual price* must be active. To check if it's active, use the [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm) endpoint. To make it active, use the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) endpoint, making the `allowManualPrice` field `true`. + + + > Whenever you use this request to change the price of an item, all items in that cart with the same SKU are affected by this change. This applies even to items that share the SKU but have been separated into different objects in the `items` array due to customizations or attachments, for example. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose items will have the price changed. | + | `itemIndex` | path | (Required) The index of the item in the cart. Each cart item is identified by an index, starting in 0. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Delete manual price of an SKU in a cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Delete manual price of an SKU in a cart.yml new file mode 100644 index 0000000000..c77b16d6a6 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Delete manual price of an SKU in a cart.yml @@ -0,0 +1,101 @@ +info: + name: Delete manual price of an SKU in a cart + type: http + seq: 10 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + - name: itemIndex + value: "0" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price - Schema is valid", function () { + const schema = {"type":"object","description":"This object is empty."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request deletes the manual price previously set for an SKU in a cart, reverting the item to its original price. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + You need to inform which cart you are referring to, by sending its `orderFormId`, and which item should have its manual price deleted, by sending its `itemIndex`. + + Remember that, to use this endpoint, the feature of *manual price* must be active. To check if it's active, use the [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm) endpoint. To make it active, use the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) endpoint, making the `allowManualPrice` field `true`. + + > Whenever you use this request to delete the manual price of an item, all items in that cart with the same SKU are affected by this change. This applies even to items that share the SKU but have been separated into different objects in the `items` array due to customizations or attachments, for example. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose item will have the manual price deleted. | + | `itemIndex` | path | (Required) The index of the item in the cart. Each cart item is identified by an index, starting in 0. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Get cart information by ID.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Get cart information by ID.yml new file mode 100644 index 0000000000..3de5493a2e --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Get cart information by ID.yml @@ -0,0 +1,97 @@ +info: + name: Get cart information by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: refreshOutdatedData + value: "true" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/orderForm/:orderFormId - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all information associated to a given shopping cart. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + > This request has a time out of 45 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | Checkout | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose information you want to retrieve. | + | `refreshOutdatedData` | query | It is possible to use the [Update cart items request](https://developers.vtex.com/vtex-rest-api/reference/cart-update#itemsupdate) so as to allow outdated information in the `orderForm`, which may improve performance in some cases. To guarantee that all cart information is updated, send this request with this parameter as `true`. We recommend doing this in the final stages of the shopping experience, starting from the checkout page. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Get current or create a new cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Get current or create a new cart.yml new file mode 100644 index 0000000000..5e18ba1d7c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Get current or create a new cart.yml @@ -0,0 +1,205 @@ +info: + name: Get current or create a new cart + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pub/orderForm" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: forceNewCart + value: "true" + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pub/orderForm - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pub/orderForm - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pub/orderForm - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pub/orderForm - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + You can use this request to get your current shopping cart information (`orderFormId`) or to create a new cart. + + **Important**: To create a new empty shopping cart you need to send this request with the query param `forceNewCart=true`. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` obtained in response is the identification code of the newly created cart. + + + > This request has a time out of 45 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `forceNewCart` | query | Use this query parameter to create a new empty shopping cart. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "9ceee0fde6db489fbc682a0e2ab13a86", + "salesChannel": "1", + "loggedIn": false, + "isCheckedIn": false, + "storeId": "1", + "checkedInPickupPointId": "21", + "allowManualPrice": false, + "canEditData": true, + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "userType": "User type", + "ignoreProfileData": false, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "document": "12345678900", + "documentType": "cpf", + "phone": "+5500123456789", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "551100988887777", + "isCorporate": false, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": null + }, + "paymentData": { + "installmentOptions": [], + "paymentSystems": [], + "payments": [ + { + "paymentSystem": 6, + "bin": null, + "accountId": "12", + "tokenId": null, + "value": 34390, + "referenceValue": 34390, + "giftCardRedemptionCode": null, + "giftCardProvider": null, + "giftCardId": null + } + ], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [] + }, + "marketingData": null, + "sellers": [], + "clientPreferencesData": { + "locale": "pt-BR", + "optinNewsLetter": null + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": {}, + "customData": null, + "itemMetadata": { + "items": [ + { + "id": "1", + "seller": "1", + "name": "Ração Royal Canin Feline Urinary 500g", + "skuName": "Ração Royal Canin Feline Urinary 500g", + "productId": "1", + "refId": "0001", + "ean": "123456789", + "imageUrl": "http://lojadobreno.vteximg.com.br/arquivos/ids/155450-55-55/Racao-Royal-Canin-Feline-Urinary-SO.jpg?v=637139444438700000", + "detailUrl": "/racao-royal-canin-feline-urinary/p", + "assemblyOptions": [] + } + ] + }, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "itemsOrdination": { + "criteria": "NAME", + "ascending": true + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Handle cart items.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Handle cart items.yml new file mode 100644 index 0000000000..511c0183fc --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Handle cart items.yml @@ -0,0 +1,125 @@ +info: + name: Handle cart items + type: http + seq: 8 + +http: + method: PATCH + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "orderItems": [ + { + "id": "2005", + "quantity": 3, + "seller": "1", + "index": 0, + "price": 1099, + "attachments": [ + { + "name": "Packages", + "content": { + "content": "content-example" + } + } + ], + "noSplitItem": false, + "allowedOutdatedData": [ + "paymentData" + ] + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/items - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/items - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/items - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + You can use this request to: + + + 1. Change the quantity or price of one or more items to the shopping cart. + + 2. Add a new item to the shopping cart. + + **Important**: To add a new item to the shopping cart, do not send the string `index` in the request body. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + > This request has a time out of 45 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart in which items will be handled. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 11 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Ignore profile data on checkout.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Ignore profile data on checkout.yml new file mode 100644 index 0000000000..ff4dc2dd7d --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Ignore profile data on checkout.yml @@ -0,0 +1,208 @@ +info: + name: Ignore profile data on checkout + type: http + seq: 12 + +http: + method: PATCH + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/profile" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "ignoreProfileData": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/profile - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/profile - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/profile - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/checkout/pub/orderForm/:orderFormId/profile - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + When a shopper provides an email address at Checkout, the platform tries to retrieve existing profile information for that email and add it to the shopping cart information. Use this request if you want to change this behavior for a given cart, meaning profile information will not be included in the order automatically. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + Note that this request will only work if you have not sent the `clientProfileData` to the cart yet. Sending it to a cart that already has a `clientProfileData` should return a status `403 Forbidden` error, with an `Access denied` message. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose items will have the price changed. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderFormId": "68b287ae65534704b1a1e42e47c82abc", + "salesChannel": "1", + "loggedIn": true, + "isCheckedIn": false, + "storeId": "1", + "checkedInPickupPointId": "21", + "allowManualPrice": false, + "canEditData": true, + "userProfileId": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "userType": "User type", + "ignoreProfileData": true, + "value": 0, + "messages": [], + "items": [], + "selectableGifts": [], + "totalizers": [], + "shippingData": null, + "clientProfileData": { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "document": "12345678900", + "documentType": "cpf", + "phone": "+5500123456789", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "551100988887777", + "isCorporate": false, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": null + }, + "paymentData": { + "updateStatus": "updated", + "installmentOptions": [], + "paymentSystems": [], + "payments": [ + { + "paymentSystem": 6, + "bin": null, + "accountId": "12", + "tokenId": null, + "value": 34390, + "referenceValue": 34390, + "giftCardRedemptionCode": null, + "giftCardProvider": null, + "giftCardId": null + } + ], + "giftCards": [], + "giftCardMessages": [], + "availableAccounts": [], + "availableTokens": [] + }, + "marketingData": null, + "sellers": [], + "clientPreferencesData": { + "locale": "pt-BR", + "optinNewsLetter": null + }, + "commercialConditionData": null, + "storePreferencesData": { + "countryCode": "BRA", + "saveUserData": true, + "timeZone": "E. South America Standard Time", + "currencyCode": "BRL", + "currencyLocale": 1046, + "currencySymbol": "R$", + "currencyFormatInfo": { + "currencyDecimalDigits": 2, + "currencyDecimalSeparator": ",", + "currencyGroupSeparator": ".", + "currencyGroupSize": 3, + "startsWithCurrencySymbol": true + } + }, + "giftRegistryData": null, + "openTextField": null, + "invoiceData": {}, + "customData": null, + "itemMetadata": { + "items": [ + { + "id": "1", + "seller": "1", + "name": "Ração Royal Canin Feline Urinary 500g", + "skuName": "Ração Royal Canin Feline Urinary 500g", + "productId": "1", + "refId": "0001", + "ean": "123456789", + "imageUrl": "http://lojadobreno.vteximg.com.br/arquivos/ids/155450-55-55/Racao-Royal-Canin-Feline-Urinary-SO.jpg?v=637139444438700000", + "detailUrl": "/racao-royal-canin-feline-urinary/p", + "assemblyOptions": [] + } + ] + }, + "hooksData": null, + "ratesAndBenefitsData": { + "rateAndBenefitsIdentifiers": [], + "teaser": [] + }, + "subscriptionData": null, + "itemsOrdination": { + "criteria": "NAME", + "ascending": true + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all items from shopping cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all items from shopping cart.yml new file mode 100644 index 0000000000..2a674eb28c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all items from shopping cart.yml @@ -0,0 +1,96 @@ +info: + name: Remove all items from shopping cart + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/removeAll" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: "{}" + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/removeAll - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/removeAll - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/removeAll - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/removeAll - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request removes all items from a given cart, leaving it empty. + + You must send an empty JSON in the body of the request. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + >ℹ️ Request body must always be sent with empty value "{ }" in this endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Shopping Cart Full Access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose items you want to remove. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all personal data from shopping cart.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all personal data from shopping cart.yml new file mode 100644 index 0000000000..9a80c3f40a --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Remove all personal data from shopping cart.yml @@ -0,0 +1,75 @@ +info: + name: Remove all personal data from shopping cart + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/checkout/changeToAnonymousUser/:orderFormId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/checkout/changeToAnonymousUser/:orderFormId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/checkout/changeToAnonymousUser/:orderFormId - Content-Type is text/plain", function () { + expect(String(res.getHeader("content-type"))).to.include("text/plain"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This call removes all user information, making a cart anonymous while leaving the items. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information about it. Hence, the `orderFormId` is the identification code of a given cart. + + This call works by creating a new orderForm, setting a new cookie, and returning a redirect 302 to the cart URL (`/checkout/#/orderform`). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose user's personal data you want to remove. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```text + {} + ``` diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Split a cart item.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Split a cart item.yml new file mode 100644 index 0000000000..eb7233e953 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Split a cart item.yml @@ -0,0 +1,116 @@ +info: + name: Split a cart item + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/:itemUniqueId/split" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + - name: itemUniqueId + value: 9D6E447B3FF64CEDA33B17C01379C119 + type: path + body: + type: json + data: |- + [ + { + "quantity": 1 + }, + { + "quantity": 2 + }, + { + "quantity": 1 + }, + { + "quantity": 1 + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemUniqueId/split - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemUniqueId/split - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemUniqueId/split - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/:itemUniqueId/split - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Splits a single item in a cart into multiple items, distributing its current quantity among them. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + You need to inform which cart you are referring to, by sending its `orderFormId`, and which item you want to split, by sending its `uniqueId` as the `itemUniqueId` path parameter. + + In the request body, send an array of objects, each containing a `quantity` value. The item is then split into as many new items as there are objects in the array, each new item receiving the corresponding `quantity`. The sum of all the `quantity` values sent must match the current quantity of the item being split, and each resulting item is assigned a new `uniqueId`. + + > This request fails if the item's `noSplitItem` field is set to `true`. To check or change this configuration, use the [Handle cart items](https://developers.vtex.com/docs/api-reference/checkout-api#patch-/api/checkout/pub/orderForm/-orderFormId-/items) request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the orderForm corresponding to the cart whose item will be split. | + | `itemUniqueId` | path | (Required) The `uniqueId` of the item to be split. Each cart item is identified by a unique ID, informed in the `uniqueId` field of the orderForm's `items` array. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/Update cart items.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/Update cart items.yml new file mode 100644 index 0000000000..be8ac96cd4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/Update cart items.yml @@ -0,0 +1,123 @@ +info: + name: Update cart items + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items/update" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: allowedOutdatedData + value: paymentData + type: query + disabled: true + - name: individualShippingEstimates + value: "true" + type: query + disabled: true + - name: orderFormId + value: ede846222cd44046ba6c638442c3505a + type: path + body: + type: json + data: |- + { + "orderItems": [ + { + "quantity": 3, + "index": 0 + }, + { + "quantity": 1, + "index": 1 + }, + { + "quantity": 2, + "index": 2 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/update - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/update - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/update - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items/update - Schema is valid", function () { + const schema = {"type":"object","description":"OrderForm object containing cart and order information.","properties":{"orderFormId":{"type":"string","description":"ID of the orderForm corresponding to a specific cart."},"salesChannel":{"type":"string","description":"Attribute created by the seller, in their VTEX store configuration."},"loggedIn":{"type":"boolean","description":"Indicates whether the user is logged into the store."},"isCheckedIn":{"type":"boolean","description":"Indicates whether order is checked in."},"storeId":{"type":["string","null"],"description":"ID of the store."},"allowManualPrice":{"type":"boolean","description":"Permission to modify item price manually."},"canEditData":{"type":"boolean","description":"Data can be edited."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"profileProvider":{"type":"string","description":"Profile provider."},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"string","description":"Account."}},"availableAddresses":{"type":"array","description":"Information on each available address.","items":{"description":"Address information.","type":"object","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Name of the receiver."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"city":{"type":"string","description":"City of the address."},"state":{"type":"string","description":"State of the address."},"country":{"type":"string","description":"Country of the address. ISO three-letter code."},"street":{"type":"string","description":"Street of the address."},"number":{"type":"string","description":"Number of the address."},"neighborhood":{"type":"string","description":"Neighborhood of the address."},"complement":{"description":"Complement to the shipping address, in case it applies.","type":["string","null"]},"reference":{"type":["string","null"],"description":"Reference that may help in the location of the address."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Ignore customer profile data."},"value":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented as `2499`."},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"Information on each item in the order.","items":{"description":"Item information.","type":"object","properties":{"uniqueId":{"type":"string","description":"Unique ID."},"id":{"type":"string","description":"ID of the item."},"productId":{"type":"string","description":"Product ID."},"productRefId":{"type":"string","description":"Product Ref ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"modalType":{"type":["string","null"],"description":"Modal type."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"tax":{"type":"integer","description":"Tax value in cents."},"taxCode":{"type":"string","description":"A unique identifier code assigned to a tax within the VTEX Admin."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"Manual price in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User that applied the manual price, if that is the case."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"isGift":{"type":"boolean","description":"Indicates whether item is a gift."},"additionalInfo":{"type":"object","description":"Additional information.","properties":{"dimension":{"type":["string","null"],"description":"Dimension."},"brandName":{"type":"string","description":"Brand name."},"brandId":{"type":"string","description":"Brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"preSaleDate":{"type":["string","null"],"description":"Presale date."},"productCategoryIds":{"type":"string","description":"Product category IDs."},"productCategories":{"type":"object","description":"Object, where each field is an ID from `productCategoryIds`.","properties":{"{ID}":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"quantity":{"type":"integer","description":"Quantity."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"Service information.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"object","description":"Object containing the attachment content as key-value pairs."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or taxes that apply to the item in the context of the order.","items":{"description":"Price tag information.","type":"object","properties":{"identifier":{"type":["string","null"],"description":"Promotion unique identifier."},"isPercentual":{"type":"boolean","description":"Indicates whether the `value` and `rawValue` of the price tag represent a percentage to be applied during checkout calculation. The default value is `false`. When set to `true`, the `value` and `rawValue` fields are interpreted as percentages, and the final price is calculated accordingly."},"name":{"type":"string","description":"Price tag name in the format: `{type}@{where}-{identifier}#{calculationId}`. Where:\r\n- `type` indicates whether the tag refers to a discount or tax.\r\n- `where` specifies the context, either price or shipping.\r\n- `identifier` is the promotion ID.\r\n- `calculationId` is a hash that may vary with each price calculation."},"rawValue":{"type":"number","description":"Raw price tag value with up to five decimals, sourced from the promotion configuration. This value is informational only and is not used in checkout calculations."},"value":{"type":"integer","description":"Price tag value representing either a promotion (value decrease) or a tax (value increase)."}}}},"availability":{"type":"string","description":"Availability."},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Manufacturer code."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"description":"Rounding information.","type":"object","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"string","description":"Gift."}},"totalizers":{"type":"array","description":"Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value).","items":{"type":"object","description":"Totalizer of purchases."}},"shippingData":{"type":["object","null"],"description":"Shipping information pertinent to the order.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"logisticsInfo":{"type":"array","description":"Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`.","items":{"description":"Logistics information.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index corresponding to the position of the object in the `items` array."},"selectedSla":{"type":["string","null"],"description":"SLA selected by the customer. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer."},"addressId":{"type":["string","null"],"description":"Address ID."},"slas":{"type":"array","description":"Information on available SLAs.","items":{"description":"SLA information.","type":"object","properties":{"id":{"type":"string","description":"SLA ID. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, this field returns the delivery option ID selected for this SLA, as the example `1223d5b4-52a4-442f-ab23-01345b60be48`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name. If the store uses the [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta) feature, the value of this field will show the specific delivery option name selected for this SLA, as the example `Delivery | BRA | Up to 30 hours`."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"description":"Delivery ID information.","type":"object","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"description":"Attachment details.","type":"object","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Custom values [created into attachment](https://help.vtex.com/en/tutorial/adding-an-attachment--7zHMUpuoQE4cAskqEUWScU)."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`. The unit can be `bd` for business days, `d` for days, `h` for hours, or `m` for minutes."},"shippingEstimateDate":{"type":["string","null"],"description":"When using the query parameter `individualShippingEstimates=true`, it will contain the estimated shipping date (e.g. `2023-09-09T11:29:00+00:00`), otherwise it will contain `null`."},"useIndividualShippingEstimates":{"type":"boolean","description":"Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`."},"lockTTL":{"type":["string","null"],"description":"Estimate date of delivery."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that repesent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"number","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Three letter country code."}},"itemId":{"type":"string","description":"Unique ID of the item in the cart. This ID is generated by VTEX and is used to identify the item in the cart."},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"description":"Delivery channel information.","type":"object","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}}}}},"selectedAddresses":{"type":"array","description":"Array with information on the selected addresses for the order.","items":{"description":"Selected address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` definitely belong to the shopper.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}},"availableAddresses":{"type":"array","description":"Array with information on the available addresses for the order.","items":{"description":"Available address information.","type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`."},"receiverName":{"type":["string","null"],"description":"Name of the person who is going to receive the order."},"addressId":{"type":["string","null"],"description":"Address ID."},"isDisposable":{"type":"boolean","description":"Indicates whether the address is disposable. Addresses marked as `isDisposable = true` are not saved to the shopper's profile when the order is completed, while addresses with `isDisposable = false` are saved.\r\n\r\nBehavior by address type:\r\n- `giftRegistry`, `pickup`, `search`, and `inStore`: always disposable, as they do not belong to the shopper navigating the cart.\r\n- `residential`: may be disposable. Addresses from a complete shopper profile, or entered by an authenticated shopper with a complete profile, are not disposable. All other residential addresses are disposable, including those from first-time purchases, since no complete profile exists yet.\r\n- `invoice`: does not have the `isDisposable` flag, since invoice addresses are of type `Address` rather than `ShippingAddress`. In practice, only authenticated shoppers can add invoice attachments to the cart, so they are never treated as disposable.\r\n- `commercial`: corresponds to company addresses used in B2B contexts and follows the same logic as residential addresses.\r\n\r\nWhen a residential address is marked as disposable and the profile is complete, authentication is required to complete the order. Additionally, when a disposable residential address is used to complete a purchase, saved cards cannot be used."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":["string","null"],"description":"Complement to the shipping address, in case it applies."},"reference":{"type":["string","null"],"description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"number","description":"Geocoordinates."}}}}}}},"clientProfileData":{"type":["object","null"],"description":"Customer's profile information.","properties":{"email":{"type":["string","null"],"description":"Email address."},"firstName":{"type":["string","null"],"description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Indicates whether the customer is a legal entity."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates whether profile is complete on loading."},"profileErrorOnLoading":{"type":["boolean","null"],"description":"Indicates whether profile presents error on loading."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Information on the order's payment.","properties":{"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"description":"Gift card information.","type":"object","properties":{"redemptionCode":{"type":"string","description":"Gift card redemption code."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"integer","description":"Gift card balance in cents."},"name":{"type":"string","description":"Gift card name."},"id":{"type":"string","description":"Gift card ID."},"inUse":{"type":"boolean","description":"Indicates whether gift card is in use."},"isSpecialCard":{"type":"boolean","description":"Indicates whether gift card is special."}}}},"transactions":{"type":"array","description":"Information on each transaction pertinent to the order.","items":{"description":"Transaction information.","type":["object","null"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether transaction is active."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Information on each payment.","items":{"description":"Payment information.","type":"object","properties":{"accountId":{"type":"string","description":"Account ID."},"bin":{"type":["string","null"],"description":"Bin."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystem":{"type":"string","description":"Payment system."},"referenceValue":{"type":"integer","description":"Reference value for calculating interest rates, in case it applies. Displayed in cents."},"value":{"type":"integer","description":"Value including interest, in case it applies. Displayed in cents."}}}},"sharedTransaction":{"type":"boolean","description":"Indicates whather transaction is shared."}}}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs.","properties":{"coupon":{"type":"string","description":"Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order."},"utmSource":{"type":"string","description":"UTM source."},"utmMedium":{"type":"string","description":"UTM medium."},"utmCampaign":{"type":"string","description":"UTM campaign."},"utmiPage":{"type":["string","null"],"description":"utmi_page (internal utm)."},"utmiPart":{"type":["string","null"],"description":"utmi_part (internal utm)."},"utmiCampaign":{"type":["string","null"],"description":"utmi_campaign (internal utm)."}}},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."},"minimumOrderValue":{"type":["integer","null"],"description":"Minimum order value configured at the seller, in cents."}}}},"clientPreferencesData":{"type":"object","description":"Object containing preferences from the client who placed the order.","properties":{"locale":{"type":"string","description":"Client's locale. Examples: `pt-BR` and `en-US`."},"optinNewsLetter":{"type":["boolean","null"],"description":"`true` if the client opted to receive newsletter from the store."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Object containing data from the store's configuration (stored in VTEX's License Manager)."},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":["string","null"],"description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the `orderForm`.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + You can use this request to: + + + 1. Change the quantity of one or more items in a specific cart. + + 2. Remove an item from the cart (by sending the `quantity` value = `0` in the request body). + + >ℹ️ To remove all items from the cart at the same time, use the [Remove all items](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items/removeAll?endpoint=post-/api/checkout/pub/orderForm/-orderFormId-/items/removeAll) endpoint. + + The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + + + > This request has a time out of 45 seconds. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Read Shopping Cart** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) ID of the `orderForm` corresponding to the cart whose items you want to update. | + | `allowedOutdatedData` | query | In order to optimize performance, this parameter allows some information to not be updated when there are changes in the minicart. For instance, if a shopper adds another unit of a given SKU to the cart, it may not be necessary to recalculate payment information, which could impact performance. This array accepts strings and currently the only possible value is `”paymentData”`. | + | `individualShippingEstimates` | query | Shows the product's estimated shipping date in the `shippingEstimate` field from the `orderForm`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 11 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout API/Shopping cart/folder.yml b/BrunoCollections/VTEX - Checkout API/Shopping cart/folder.yml new file mode 100644 index 0000000000..0d163d2e8d --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/Shopping cart/folder.yml @@ -0,0 +1,4 @@ +info: + name: Shopping cart + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Checkout API/environments/VTEX.yml b/BrunoCollections/VTEX - Checkout API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Checkout API/opencollection.yml b/BrunoCollections/VTEX - Checkout API/opencollection.yml new file mode 100644 index 0000000000..d52ab52f1c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout API/opencollection.yml @@ -0,0 +1,37 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Checkout API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ Check the new [Checkout onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/checkout-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about the Checkout and is organized by focusing on the developer's journey. + + The Checkout API allows you to obtain and configure information about the shopping cart and its attachments, personalization of custom fields, orderForm structure, fulfillment data, order management, and identification of the sellers delivery region. + + >ℹ️ Data modification operations (`POST`, `PATCH`, `PUT` or `DELETE` endpoints) shall not be performed in parallel in the Checkout APIs. They need to be enqueued by the client/requester. Otherwise, old values ​​can be overwritten incorrectly or competition errors may occur. + + >⚠️ All endpoints that consult or edit the orderForm can change the authentication depending on the customer context. If you are handling information from a customer with a complete profile on the store, authentication will be required. You can only access or modify the customer data for these profiles with an authenticated request. + + ## Common parameters in the documentation + + | Parameter name | Description | + |---------------------------|-----------------------------------------------------------------------------------------| + | `{{accountName}}` | Store account name | + | `{{environment}}` | The environment that will be called. Change for vtexcommercestable or vtexcommmercebeta | + | `{{X-VTEX-API-AppKey}}` | Located in the headers of the requests, user authentication key | + | `{{X-VTEX-API-AppToken}}` | Located in the headers of the requests, authentication password | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Create a new checkout configuration.yml b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Create a new checkout configuration.yml new file mode 100644 index 0000000000..e3762005bd --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Create a new checkout configuration.yml @@ -0,0 +1,130 @@ +info: + name: Create a new checkout configuration + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/configuration/ui?an=12872182" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "12872182" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "brand": { + "logo": "logo.png", + "actionColor": "Red" + }, + "cart": { + "minimumPurchaseAmount": 123, + "maximumItemsInCart": 10, + "promoCode": true, + "shippingPreview": false, + "skuPrice": "TotalOnly" + }, + "orderReview": { + "taxesToolTip": "X state tax: $10" + }, + "advanced": { + "adobeAnalyticsPlataformId1": "adobeAnalyticsPlataformId1", + "adobeAnalyticsPlataformId2": "launch-er45i4b9pp90-development.min.js", + "googleMapsApiKey": "googleMapsApiKey" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/configuration/ui - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/configuration/ui - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/configuration/ui - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/configuration/ui - Schema is valid", function () { + const schema = {"type":"object","properties":{"brand":{"type":"object","properties":{"logo":{"type":"string","description":"Store's logotype that will be displayed to the shopper during the checkout process.","example":"logo.png"},"actionColor":{"type":"string","description":"Color used for action elements, such as buttons, within the checkout interface.","example":"Red"}}},"cart":{"type":"object","properties":{"minimumPurchaseAmount":{"type":"integer","description":"Minimum purchase amount required for a shopper's cart to qualify for a purchase.","example":123},"maximumItemsInCart":{"type":"integer","description":"Maximum number of items allowed in the cart per transaction.","example":10},"promoCode":{"type":"boolean","description":"Indicates whether the cart allows promotional codes or discount coupons. Enabling this feature provides shoppers with the option to input promo codes during checkout.","example":true},"shippingPreview":{"type":"boolean","description":"Indicates whether the cart provides a preview of shipping costs before finalizing the purchase. Enabling this feature allows shoppers to view estimated shipping charges early in the checkout process.","example":false},"skuPrice":{"type":"string","description":"Specifies the pricing model used for displaying prices in the cart, either based on individual SKUs or the total price only.","enum":["TotalOnly","SkuAndTotalPrice"]}}},"orderReview":{"type":"object","description":"Object of tooltips that provide additional information regarding the order review process.","properties":{"taxesToolTip":{"type":"string","description":"This tooltip includes details such as how taxes are calculated, applicable tax rates, or explanations about specific tax-related charges.","example":"X state tax: $10"}}},"advanced":{"type":"object","description":"Object containing advanced configuration of the checkout.","properties":{"adobeAnalyticsPlataformId1":{"type":"string","description":"[Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID used for tracking analytics data.","example":"adobeAnalyticsPlataformId1"},"adobeAnalyticsPlataformId2":{"type":"string","description":"Additional [Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID for tracking analytics data.","example":"launch-er45i4b9pp90-development.min.js"},"googleMapsApiKey":{"type":"string","description":"API key used for accessing Google Maps services, such as geocoding or mapping functionality. This key is required for integrating Google Maps features into the application.","example":"googleMapsApiKey"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Creates a new checkout configuration for the store. This endpoint allows stores to define and set up a custom checkout configuration to their specific requirements. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Checkout configuration ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "brand": { + "logo": "logo.png", + "actionColor": "Red" + }, + "cart": { + "minimumPurchaseAmount": 123, + "maximumItemsInCart": 10, + "promoCode": true, + "shippingPreview": false, + "skuPrice": "TotalOnly" + }, + "orderReview": { + "taxesToolTip": "X state tax: $10" + }, + "advanced": { + "adobeAnalyticsPlataformId1": "adobeAnalyticsPlataformId1", + "adobeAnalyticsPlataformId2": "launch-er45i4b9pp90-development.min.js", + "googleMapsApiKey": "googleMapsApiKey" + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Delete checkout configuration.yml b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Delete checkout configuration.yml new file mode 100644 index 0000000000..17663593c1 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Delete checkout configuration.yml @@ -0,0 +1,58 @@ +info: + name: Delete checkout configuration + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/checkout/configuration/ui?an=12872182" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "12872182" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/checkout/configuration/ui - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Deletes an existing checkout configuration from a store. This endpoint allows developers to remove a checkout configuration that is no longer needed or has become obsolete. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Checkout configuration ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Get checkout configuration.yml b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Get checkout configuration.yml new file mode 100644 index 0000000000..d71acb8887 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Get checkout configuration.yml @@ -0,0 +1,106 @@ +info: + name: Get checkout configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/configuration/ui?an=12872182" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "12872182" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/configuration/ui - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/configuration/ui - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/configuration/ui - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/configuration/ui - Schema is valid", function () { + const schema = {"type":"object","properties":{"brand":{"type":"object","properties":{"logo":{"type":"string","description":"Store's logotype that will be displayed to the shopper during the checkout process.","example":"logo.png"},"actionColor":{"type":"string","description":"Color used for action elements, such as buttons, within the checkout interface.","example":"Red"}}},"cart":{"type":"object","properties":{"minimumPurchaseAmount":{"type":"integer","description":"Minimum purchase amount required for a shopper's cart to qualify for a purchase.","example":123},"maximumItemsInCart":{"type":"integer","description":"Maximum number of items allowed in the cart per transaction.","example":10},"promoCode":{"type":"boolean","description":"Indicates whether the cart allows promotional codes or discount coupons. Enabling this feature provides shoppers with the option to input promo codes during checkout.","example":true},"shippingPreview":{"type":"boolean","description":"Indicates whether the cart provides a preview of shipping costs before finalizing the purchase. Enabling this feature allows shoppers to view estimated shipping charges early in the checkout process.","example":false},"skuPrice":{"type":"string","description":"Specifies the pricing model used for displaying prices in the cart, either based on individual SKUs or the total price only.","enum":["TotalOnly","SkuAndTotalPrice"]}}},"orderReview":{"type":"object","description":"Object of tooltips that provide additional information regarding the order review process.","properties":{"taxesToolTip":{"type":"string","description":"This tooltip includes details such as how taxes are calculated, applicable tax rates, or explanations about specific tax-related charges.","example":"X state tax: $10"}}},"advanced":{"type":"object","description":"Object containing advanced configuration of the checkout.","properties":{"adobeAnalyticsPlataformId1":{"type":"string","description":"[Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID used for tracking analytics data.","example":"adobeAnalyticsPlataformId1"},"adobeAnalyticsPlataformId2":{"type":"string","description":"Additional [Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID for tracking analytics data.","example":"launch-er45i4b9pp90-development.min.js"},"googleMapsApiKey":{"type":"string","description":"API key used for accessing Google Maps services, such as geocoding or mapping functionality. This key is required for integrating Google Maps features into the application.","example":"googleMapsApiKey"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Retrieves a single configuration of the checkout process for the store. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Checkout configuration ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "brand": { + "logo": "logo.png", + "actionColor": "Red" + }, + "cart": { + "minimumPurchaseAmount": 123, + "maximumItemsInCart": 10, + "promoCode": true, + "shippingPreview": false, + "skuPrice": "TotalOnly" + }, + "orderReview": { + "taxesToolTip": "X state tax: $10" + }, + "advanced": { + "adobeAnalyticsPlataformId1": "adobeAnalyticsPlataformId1", + "adobeAnalyticsPlataformId2": "launch-er45i4b9pp90-development.min.js", + "googleMapsApiKey": "googleMapsApiKey" + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Update a checkout configuration.yml b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Update a checkout configuration.yml new file mode 100644 index 0000000000..0284385548 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/Update a checkout configuration.yml @@ -0,0 +1,130 @@ +info: + name: Update a checkout configuration + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/checkout/configuration/ui?an=12872182" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "12872182" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "brand": { + "logo": "logo.png", + "actionColor": "Red" + }, + "cart": { + "minimumPurchaseAmount": 123, + "maximumItemsInCart": 10, + "promoCode": true, + "shippingPreview": false, + "skuPrice": "TotalOnly" + }, + "orderReview": { + "taxesToolTip": "X state tax: $10" + }, + "advanced": { + "adobeAnalyticsPlataformId1": "adobeAnalyticsPlataformId1", + "adobeAnalyticsPlataformId2": "launch-er45i4b9pp90-development.min.js", + "googleMapsApiKey": "googleMapsApiKey" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/checkout/configuration/ui - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/checkout/configuration/ui - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/checkout/configuration/ui - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/checkout/configuration/ui - Schema is valid", function () { + const schema = {"type":"object","properties":{"brand":{"type":"object","properties":{"logo":{"type":"string","description":"Store's logotype that will be displayed to the shopper during the checkout process.","example":"logo.png"},"actionColor":{"type":"string","description":"Color used for action elements, such as buttons, within the checkout interface.","example":"Red"}}},"cart":{"type":"object","properties":{"minimumPurchaseAmount":{"type":"integer","description":"Minimum purchase amount required for a shopper's cart to qualify for a purchase.","example":123},"maximumItemsInCart":{"type":"integer","description":"Maximum number of items allowed in the cart per transaction.","example":10},"promoCode":{"type":"boolean","description":"Indicates whether the cart allows promotional codes or discount coupons. Enabling this feature provides shoppers with the option to input promo codes during checkout.","example":true},"shippingPreview":{"type":"boolean","description":"Indicates whether the cart provides a preview of shipping costs before finalizing the purchase. Enabling this feature allows shoppers to view estimated shipping charges early in the checkout process.","example":false},"skuPrice":{"type":"string","description":"Specifies the pricing model used for displaying prices in the cart, either based on individual SKUs or the total price only.","enum":["TotalOnly","SkuAndTotalPrice"]}}},"orderReview":{"type":"object","description":"Object of tooltips that provide additional information regarding the order review process.","properties":{"taxesToolTip":{"type":"string","description":"This tooltip includes details such as how taxes are calculated, applicable tax rates, or explanations about specific tax-related charges.","example":"X state tax: $10"}}},"advanced":{"type":"object","description":"Object containing advanced configuration of the checkout.","properties":{"adobeAnalyticsPlataformId1":{"type":"string","description":"[Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID used for tracking analytics data.","example":"adobeAnalyticsPlataformId1"},"adobeAnalyticsPlataformId2":{"type":"string","description":"Additional [Adobe Analytics Platform](https://business.adobe.com/products/analytics/adobe-analytics.html) ID for tracking analytics data.","example":"launch-er45i4b9pp90-development.min.js"},"googleMapsApiKey":{"type":"string","description":"API key used for accessing Google Maps services, such as geocoding or mapping functionality. This key is required for integrating Google Maps features into the application.","example":"googleMapsApiKey"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >📘 This functionality is in the beta stage and can be discontinued at any moment at VTEX's discretion. VTEX will not be responsible for any instabilities caused by its use or discontinuity. If you have any questions, please contact [our Support Center](https://support.vtex.com/hc/en-us/requests). + + Updates an existing checkout configuration for the store. This endpoint enables developers to modify and refine the settings of an existing checkout configuration according to evolving business needs or changing requirements. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Checkout configuration ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "brand": { + "logo": "logo.png", + "actionColor": "Red" + }, + "cart": { + "minimumPurchaseAmount": 123, + "maximumItemsInCart": 10, + "promoCode": true, + "shippingPreview": false, + "skuPrice": "TotalOnly" + }, + "orderReview": { + "taxesToolTip": "X state tax: $10" + }, + "advanced": { + "adobeAnalyticsPlataformId1": "adobeAnalyticsPlataformId1", + "adobeAnalyticsPlataformId2": "launch-er45i4b9pp90-development.min.js", + "googleMapsApiKey": "googleMapsApiKey" + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Configuration API/Configuration/folder.yml b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/folder.yml new file mode 100644 index 0000000000..edd9831fd4 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/Configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Configuration + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Checkout Configuration API/environments/VTEX.yml b/BrunoCollections/VTEX - Checkout Configuration API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Checkout Configuration API/opencollection.yml b/BrunoCollections/VTEX - Checkout Configuration API/opencollection.yml new file mode 100644 index 0000000000..aedc2b62fe --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Configuration API/opencollection.yml @@ -0,0 +1,27 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Checkout Configuration API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Checkout Configuration API is responsible for managing the checkout configurations of a store. The API provides endpoints for creating, retrieving, updating, and deleting checkout configurations, allowing clients to customize and optimize the checkout process according to their specific requirements. + + - `GET` [Get checkout configuration](https://developers.vtex.com/docs/api-reference/checkout-configuration-api#get-/api/checkout/configuration/ui) + - `POST` [Create a new checkout configuration](https://developers.vtex.com/docs/api-reference/checkout-configuration-api#post-/api/checkout/configuration/ui) + - `PUT` [Update a checkout configuration](https://developers.vtex.com/docs/api-reference/checkout-configuration-api#put-/api/checkout/configuration/ui) + - `DELETE` [Delete checkout configuration](https://developers.vtex.com/docs/api-reference/checkout-configuration-api#delete-/api/checkout/configuration/ui) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Start client login.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Start client login.yml new file mode 100644 index 0000000000..7d968eb241 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Start client login.yml @@ -0,0 +1,45 @@ +info: + name: Start client login + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/pub/authentication/startlogin" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/vtexid/pub/authentication/startlogin - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Initiates the authentication process for a user. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Validate client login.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Validate client login.yml new file mode 100644 index 0000000000..3a8ffee42f --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/Validate client login.yml @@ -0,0 +1,102 @@ +info: + name: Validate client login + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/pub/authentication/classic/validate?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: form-urlencoded + data: + - name: login + value: user@example.com + - name: password + value: Password123 + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/pub/authentication/classic/validate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/pub/authentication/classic/validate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/pub/authentication/classic/validate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/pub/authentication/classic/validate - Schema is valid", function () { + const schema = {"type":"object","properties":{"authStatus":{"type":"string","description":"Authentication status."},"promptMFA":{"type":"boolean","description":"Indicates if multi-factor authentication should be prompted."},"lastAttemptAvailable":{"type":["string","null"],"description":"Last attempt available."},"clientToken":{"type":["string","null"],"description":"Client token."},"authCookie":{"type":"object","description":"Authentication cookie information.","properties":{"Name":{"type":"string","description":"Cookie name."},"Value":{"type":"string","description":"Cookie value."}}},"accountAuthCookie":{"type":"object","description":"Account authentication cookie information.","properties":{"Name":{"type":"string","description":"Cookie name."},"Value":{"type":"string","description":"Cookie value."}}},"expiresIn":{"type":"integer","description":"Expiration time in seconds."},"userId":{"type":"string","description":"User identifier."},"phoneNumber":{"type":["string","null"],"description":"Phone number."},"scope":{"type":["string","null"],"description":"Scope."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Validates user credentials and returns authentication cookies. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) Account name parameter. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authStatus": "Success", + "promptMFA": false, + "lastAttemptAvailable": null, + "clientToken": null, + "authCookie": { + "Name": "VtexIdclientAutCookie_gatewayqabrmkt", + "Value": "" + }, + "accountAuthCookie": { + "Name": "VtexIdclientAutCookie_example", + "Value": "" + }, + "expiresIn": 86399, + "userId": "", + "phoneNumber": null, + "scope": null + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/folder.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/folder.yml new file mode 100644 index 0000000000..838aa7b1ec --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/Save card token.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/Save card token.yml new file mode 100644 index 0000000000..59c25e211c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/Save card token.yml @@ -0,0 +1,136 @@ +info: + name: Save card token + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/card-token-vault/tokens" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "providerId": "123579", + "card": { + "paymentSystemName": "Visa", + "paymentSystemId": "2", + "firstDigits": "411111", + "lastDigits": "1111", + "address": { + "addressType": "billing", + "postalCode": "12345678", + "street": "Main Street", + "neighborhood": "Downtown", + "city": "São Paulo", + "state": "SP", + "country": "Brazil", + "number": "123" + }, + "holderName": "John Doe" + }, + "cardTokenData": { + "type": "TOKEN_VALUE", + "value": "4111111111111111", + "expiration": "2030-12", + "label": "Primary credit card", + "useCvvForAuthorization": false + }, + "email": "user@example.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/card-token-vault/tokens - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/card-token-vault/tokens - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/card-token-vault/tokens - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/card-token-vault/tokens - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the saved card token."},"accountName":{"type":"string","description":"Account name associated with this token."},"providerId":{"type":"string","description":"ID of the payment provider."},"card":{"type":"object","description":"Card information.","properties":{"paymentSystemId":{"type":"string","description":"ID of the payment system."},"paymentSystemName":{"type":"string","description":"Name of the payment system."},"firstDigits":{"type":"string","description":"First six digits of the card."},"lastDigits":{"type":"string","description":"Last four digits of the card."},"holderName":{"type":"string","description":"Cardholder's name."},"address":{"type":"object","description":"Billing address linked to the card.","properties":{"addressType":{"type":"string","description":"Type of address."},"addressId":{"type":["string","null"],"description":"Address ID."},"postalCode":{"type":"string","description":"Postal code."},"street":{"type":"string","description":"Street name."},"neighborhood":{"type":"string","description":"Neighborhood."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State or region."},"country":{"type":"string","description":"Country."},"number":{"type":"string","description":"Street number."},"complement":{"type":["string","null"],"description":"Address complement."}}}}},"cardTokenData":{"type":"object","description":"Token information for the card.","properties":{"type":{"type":"string","description":"Type of token."},"expiration":{"type":"string","description":"Expiration in YYYY-MM format."},"value":{"type":"string","description":"Token value."},"label":{"type":"string","description":"Label for the tokenized card."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is used for authorization."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Saves a new card token to the Card Token Vault. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "EAA2FC55554448D7B56DE57D9ACDE1B1", + "accountName": "gatewayqabrmkt", + "providerId": "123579", + "card": { + "paymentSystemId": "2", + "paymentSystemName": "Visa", + "firstDigits": "712737", + "lastDigits": "4791", + "holderName": "Nicole Kuhn", + "address": { + "addressType": "billing", + "addressId": null, + "postalCode": "97802532", + "street": "61898 Joesph Via", + "neighborhood": "Sylvester Stehr", + "city": "Emardside", + "state": "KO", + "country": "British Indian Ocean Territory (Chagos Archipelago)", + "number": "4", + "complement": null + } + }, + "cardTokenData": { + "type": "TOKEN_VALUE", + "expiration": "2031-05", + "value": "7127376938244791", + "label": "01.A. Save 1 tokenized credit card via api using an external credential", + "useCvvForAuthorization": false + } + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/folder.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/folder.yml new file mode 100644 index 0000000000..a50fa22a8b --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Card token vault/folder.yml @@ -0,0 +1,4 @@ +info: + name: Card token vault + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add client profile data.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add client profile data.yml new file mode 100644 index 0000000000..f83bfa8a47 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add client profile data.yml @@ -0,0 +1,84 @@ +info: + name: Add client profile data + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderFormId + value: B0935AF4429441ABB4161111ED9D1104 + type: path + body: + type: json + data: |- + { + "email": "user@example.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderFormId":{"type":"string","description":"Unique identifier of the orderForm."},"salesChannel":{"type":"string","description":"Sales channel identifier."},"loggedIn":{"type":"boolean","description":"Indicates if the user is logged in."},"isCheckedIn":{"type":"boolean","description":"Indicates if the user is checked in."},"storeId":{"type":["string","null"],"description":"Store identifier."},"checkedInPickupPointId":{"type":["string","null"],"description":"Checked-in pickup point identifier."},"allowManualPrice":{"type":"boolean","description":"Indicates if manual price is allowed."},"canEditData":{"type":"boolean","description":"Indicates if data can be edited."},"userProfileId":{"type":["string","null"],"description":"User profile identifier."},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Indicates if profile data should be ignored."},"value":{"type":"number","description":"Total value of the order."},"messages":{"type":"array","description":"List of messages.","items":{"type":"object","description":"Message information.","properties":{"message":{"type":"string","description":"Message."}}}},"items":{"type":"array","description":"List of items in the order.","items":{"type":"object","description":"Item information.","properties":{"id":{"type":"string","description":"Identifier for the item."}}}},"selectableGifts":{"type":"array","description":"List of selectable gifts.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":"string","description":"Identifier for the selectable gift."}}}},"totalizers":{"type":"array","description":"List of totalizers.","items":{"type":"object","description":"Totalizer information.","properties":{"id":{"type":"string","description":"Identifier for the totalizer."},"name":{"type":"string","description":"Name for the totalizer."}}}},"shippingData":{"type":"object","description":"Shipping data.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}},"logisticsInfo":{"type":"array","description":"List of logistics information.","items":{"type":"object","description":"Logistics information.","properties":{"id":{"type":"string","description":"Identifier for the logistics information."}}}},"selectedAddresses":{"type":"array","description":"List of selected addresses.","items":{"type":"object","description":"Selected address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Coordinate value."}}}}},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"object","description":"Available address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}}},"pickupPoints":{"type":"array","description":"List of pickup points.","items":{"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"Identifier for the pickup point."}}}},"contactInformation":{"type":"array","description":"List of contact information.","items":{"type":"object","description":"Contact information.","properties":{"id":{"type":"string","description":"Identifier for the contact information."}}}}}},"clientProfileData":{"type":["object","null"],"description":"Client profile data.","properties":{"email":{"type":"string","description":"Email address."},"firstName":{"type":"string","description":"First name."},"lastName":{"type":"string","description":"Last name."},"document":{"type":"string","description":"Document number."},"documentType":{"type":"string","description":"Document type."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Corporate name."},"tradeName":{"type":["string","null"],"description":"Trade name."},"corporateDocument":{"type":["string","null"],"description":"Corporate document."},"stateInscription":{"type":["string","null"],"description":"State inscription."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone."},"isCorporate":{"type":"boolean","description":"Indicates if the profile is corporate."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates if the profile is complete on loading."},"profileErrorOnLoading":{"type":"boolean","description":"Indicates if there was an error loading the profile."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Payment data.","properties":{"updateStatus":{"type":"string","description":"Update status."},"installmentOptions":{"type":"array","description":"List of Installment options.","items":{"type":"object","description":"Information about the installment option.","properties":{"paymentSystem":{"type":"integer","description":"Payment system identification."},"bin":{"type":["string","null"],"description":"Card bin."},"paymentName":{"type":["string","null"],"description":"Payment name."},"paymentGroupName":{"type":["string","null"],"description":"Payment group name."},"value":{"type":"integer","description":"Total value assigned to this payment."},"installments":{"type":"array","description":"Installment information.","items":{"type":"object","description":"Installment information.","properties":{"count":{"type":"integer","description":"Count information."},"hasInterestRate":{"type":"boolean","description":"Indicates whether the payment has interest."},"interestRate":{"type":"integer","description":"Interest rate value."},"value":{"type":"integer","description":"Value of the order without the interest rate. The value is shown without separating cents."},"total":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments information.","items":{"type":"object","description":"Installment information."}}}}}}}},"paymentSystems":{"type":"array","description":"Information on payment systems.","items":{"type":"object","description":"Payment system information.","properties":{"id":{"type":"integer","description":"Payment system ID."},"name":{"type":"string","description":"Payment system name."},"groupName":{"type":"string","description":"Payment group name."},"validator":{"type":["object","null"],"description":"Payment system validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"description":{"type":"string","description":"Description."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether a authentication is required."},"dueDate":{"type":"string","description":"Payment due date."},"availablePayments":{"type":["string","null"],"description":"Availability of payment."}}}},"payments":{"type":"array","description":"Array with information on each payment chosen by the shopper.","items":{"type":"object","description":"Payment information.","properties":{"paymentSystem":{"type":"integer","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"group":{"type":"string","description":"Payment system group."},"installments":{"type":"integer","description":"Selected number of installments."},"installmentsInterestRate":{"type":"number","description":"Installments' interest rate."},"installmentsValue":{"type":"integer","description":"Value of the installments."},"value":{"type":"integer","description":"Total value assigned to this payment."},"referenceValue":{"type":"integer","description":"Reference value used to calculate total order value with interest."},"hasDefaultBillingAddress":{"type":"boolean","description":"Indicates whether billing address for this payment is the default address."}}}},"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"type":"string","description":"Gift card."}},"giftCardMessages":{"type":"array","description":"Array of gift card messages.","items":{"type":"string","description":"Gift card message."}},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"object","description":"Available account.","properties":{"accountId":{"type":"string","description":"Account identifier."},"paymentSystem":{"type":"string","description":"Payment system identifier."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Bank identification number."},"availableAddresses":{"type":"array","description":"Available addresses for this account.","items":{"type":"string","description":"Address identifier."}},"expirationDate":{"type":"string","description":"Card expiration date."},"isExpired":{"type":"boolean","description":"Indicates if the card is expired."},"accountStatus":{"type":["string","null"],"description":"Account status."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"isCardToken":{"type":"boolean","description":"Indicates if this is a card token."},"cardLabel":{"type":"string","description":"Card label."},"cardOrigin":{"type":"string","description":"Card origin."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"availableAssociations":{"type":"object","description":"Available associations.","properties":{"id":{"type":"string","description":"Identifier for the association."}}}}},"marketingData":{"type":["object","null"],"description":"Marketing data."},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."}}}},"clientPreferencesData":{"type":"object","description":"Client preferences data.","properties":{"locale":{"type":"string","description":"Locale."},"optinNewsLetter":{"type":"boolean","description":"Indicates whether the user opted in to receive the store's newsletter (`true`) or not (`false`)."},"savePersonalData":{"type":"boolean","description":"Indicates if personal data should be saved."},"savePaymentData":{"type":"boolean","description":"Indicates if payment data should be saved."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Store preferences data.","properties":{"countryCode":{"type":"string","description":"Country code."},"saveUserData":{"type":"boolean","description":"Indicates if user data should be saved."},"timeZone":{"type":"string","description":"Time zone."},"currencyCode":{"type":"string","description":"Currency code."},"currencyLocale":{"type":"number","description":"Currency locale."},"currencySymbol":{"type":"string","description":"Currency symbol."},"currencyFormatInfo":{"type":"object","description":"Currency format information.","properties":{"currencyDecimalDigits":{"type":"number","description":"Currency decimal digits."},"currencyDecimalSeparator":{"type":"string","description":"Currency decimal separator."},"currencyGroupSeparator":{"type":"string","description":"Currency group separator."},"currencyGroupSize":{"type":"number","description":"Currency group size."},"startsWithCurrencySymbol":{"type":"boolean","description":"Indicates if starts with currency symbol."}}}}},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON`, even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information."},"itemMetadata":{"type":["object","null"],"description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":["object","null"],"properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"merchantContextData":{"type":["object","null"],"description":"Merchant context data."},"purchaseAgentsData":{"type":["object","null"],"description":"Purchase agents data."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the orderForm.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Attaches client profile data to the orderForm. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) Unique identifier of the orderForm. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add items to cart.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add items to cart.yml new file mode 100644 index 0000000000..30b39938d8 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add items to cart.yml @@ -0,0 +1,90 @@ +info: + name: Add items to cart + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/items" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderFormId + value: B0935AF4429441ABB4161111ED9D1104 + type: path + body: + type: json + data: |- + { + "orderItems": [ + { + "id": 1, + "seller": "1", + "quantity": 10 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/items - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderFormId":{"type":"string","description":"Unique identifier of the orderForm."},"salesChannel":{"type":"string","description":"Sales channel through which the order was made."},"loggedIn":{"type":"boolean","description":"Whether the user is logged in."},"isCheckedIn":{"type":"boolean","description":"Indicates if the client is checked in at a pickup point."},"storeId":{"type":["string","null"],"description":"ID of the physical store where the user is checked in, if any."},"checkedInPickupPointId":{"type":["string","null"],"description":"ID of the pickup point where the client is checked in, if any."},"allowManualPrice":{"type":"boolean","description":"Indicates if manual price is allowed."},"canEditData":{"type":"boolean","description":"Specifies if user data can be edited before completing the purchase."},"userProfileId":{"type":["string","null"],"description":"ID of the user's profile if available."},"userType":{"type":["string","null"],"description":"Type of user (e.g., `'B2C'`, `'B2B'`)."},"ignoreProfileData":{"type":"boolean","description":"Indicates if profile data should be ignored for this order."},"value":{"type":"integer","description":"Total value of the order (in cents)."},"messages":{"type":"array","description":"List of system or business messages associated with the order.","items":{"type":"string","description":"Message."}},"items":{"type":"array","description":"List of items in the cart.","items":{"type":"object","description":"Item details.","properties":{"uniqueId":{"type":"string","description":"Unique identifier for the item in the cart."},"id":{"type":"string","description":"SKU identifier of the item."},"productId":{"type":"string","description":"ID of the product this SKU belongs to."},"productRefId":{"type":"string","description":"Reference ID of the product."},"refId":{"type":"string","description":"Reference ID of the SKU."},"ean":{"type":["string","null"],"description":"EAN (European Article Number) for the SKU."},"name":{"type":"string","description":"Name of the product."},"skuName":{"type":"string","description":"Name of the SKU."},"modalType":{"type":"string","description":"Type of modal that might be associated with the item."},"parentItemIndex":{"type":["integer","null"],"description":"Index for the parent item if this is a child item; otherwise, null."},"parentAssemblyBinding":{"type":["string","null"],"description":"Assembly binding information for parent item if applicable."},"assemblies":{"type":"array","description":"List of assemblies attached to this item.","items":{"type":"string","description":"Assembly information."}},"priceValidUntil":{"type":"string","format":"date-time","description":"Date and time until the current price is valid."},"tax":{"type":"integer","description":"Tax value for the item (in cents)."},"price":{"type":"integer","description":"Price of the item (in cents)."},"listPrice":{"type":"integer","description":"Original price of the item (in cents) before discounts."},"manualPrice":{"type":["number","null"],"description":"Manual price set for the item, if any."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User or system entity who applied the manual price, if any."},"sellingPrice":{"type":"integer","description":"Final price at which the item is being sold (in cents)."},"rewardValue":{"type":"integer","description":"Reward value for the item (in cents, usually for loyalty or promotion)."},"isGift":{"type":"boolean","description":"Whether the item was added as a gift."},"additionalInfo":{"type":"object","description":"Additional info for the item.","properties":{"dimension":{"type":["string","null"],"description":"Dimension information for the item, if any."},"brandName":{"type":"string","description":"Brand name of the product."},"brandId":{"type":"string","description":"Identifier for the brand."},"offeringInfo":{"type":["string","null"],"description":"Information regarding special offerings, if any."},"offeringType":{"type":["string","null"],"description":"Type of special offering, if any."},"offeringTypeId":{"type":["string","null"],"description":"ID of special offering type, if any."}}},"preSaleDate":{"type":["string","null"],"format":"date-time","description":"Date until which the item is in pre-sale (if applicable)."},"productCategoryIds":{"type":"string","description":"String of IDs for the categories the product belongs to."},"productCategories":{"type":"object","description":"Mapping of category IDs to names.","items":{"type":"string","description":"Category ID."}},"quantity":{"type":"integer","description":"Quantity of the item."},"seller":{"type":"string","description":"Identifier for the seller."},"sellerChain":{"type":"array","description":"List of sellers in the chain for this item.","items":{"type":"string","description":"Seller ID."}},"imageUrl":{"type":"string","description":"URL for the item's image."},"detailUrl":{"type":"string","description":"URL to the item's detail page."},"components":{"type":"array","description":"Item components, if the item is a bundle.","items":{"type":"string","description":"Component information."}},"bundleItems":{"type":"array","description":"List of bundle items related to this item.","items":{"type":"string","description":"Bundle item information."}},"attachments":{"type":"array","description":"List of attachments for this item.","items":{"type":"string","description":"Attachment information."}},"attachmentOfferings":{"type":"array","description":"Attachable offerings to the item.","items":{"type":"string","description":"Offering information."}},"offerings":{"type":"array","description":"List of available offerings for the item.","items":{"type":"string","description":"Offering information."}},"priceTags":{"type":"array","description":"List of price tags for the item.","items":{"type":"string","description":"Price tag information."}},"availability":{"type":"string","description":"Availability status of the item."},"measurementUnit":{"type":"string","description":"Unit used for measuring this item (e.g., 'un', 'kg')."},"unitMultiplier":{"type":"number","description":"Multiplier that indicates how many units each item represents."},"manufacturerCode":{"type":["string","null"],"description":"Code of the manufacturer, if available."},"priceDefinition":{"type":"object","description":"Price definition, including selling price and breakdown.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Selling price calculated for the item (in cents)."},"total":{"type":"integer","description":"Total price for the quantity (in cents)."},"sellingPrices":{"type":"array","description":"List with value and quantity for each price segment.","items":{"type":"object","description":"Price segment details.","properties":{"value":{"type":"integer","description":"Value of the selling price for this segment (in cents)."},"quantity":{"type":"integer","description":"Quantity of items for this price segment."}}}},"reason":{"type":["string","null"],"description":"Reason for the price, if applicable."}}},"taxCode":{"type":"string","description":"Tax code for the item."}}}},"selectableGifts":{"type":"array","description":"List of gifts that can be selected by the user.","items":{"type":"string","description":"Gift information."}},"totalizers":{"type":"array","description":"List of totalizer objects giving a breakdown of the total order amount.","items":{"type":"object","description":"Totalizer details.","properties":{"id":{"type":"string","description":"Identifier for the totalizer."},"name":{"type":"string","description":"Name for the totalizer."},"value":{"type":"integer","description":"Total value this totalizer represents (in cents)."}}}},"shippingData":{"type":"object","description":"Shipping information for the order.","properties":{"address":{"type":["object","null"],"description":"Selected shipping address, or null if not set."},"logisticsInfo":{"type":"array","description":"List of logistics options for each cart item.","items":{"type":"object","description":"Logistics information for an item.","properties":{"itemIndex":{"type":"integer","description":"Index position of the item in the cart."},"selectedSla":{"type":["string","null"],"description":"Selected SLA (Shipping Level Agreement) option, if any."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Selected delivery channel, if any."},"addressId":{"type":["string","null"],"description":"ID of the address being used for delivery."},"slas":{"type":"array","description":"List of available SLAs for this item.","items":{"type":"string","description":"SLA information."}},"shipsTo":{"type":"array","description":"Countries this item can ship to (ISO 3166-1).","items":{"type":"string","description":"Country code."}},"itemId":{"type":"string","description":"ID of the item in the order."},"deliveryChannels":{"type":"array","description":"Delivery channels available for this item.","items":{"type":"object","description":"Delivery channel details.","properties":{"id":{"type":"string","description":"Identifier for the delivery channel."}}}}}}},"selectedAddresses":{"type":"array","description":"Addresses selected for delivery.","items":{"type":"string","description":"Address information."}},"availableAddresses":{"type":"array","description":"Addresses available to select for delivery.","items":{"type":"string","description":"Address information."}},"pickupPoints":{"type":"array","description":"List of pickup points available to select.","items":{"type":"string","description":"Pickup point information."}},"contactInformation":{"type":"array","description":"Contact information objects for delivery.","items":{"type":"string","description":"Contact information."}}}},"clientProfileData":{"type":["object","null"],"description":"Client profile data (personal details), if available.","properties":{"email":{"type":"string","description":"Email address."},"firstName":{"type":"string","description":"First name."},"lastName":{"type":"string","description":"Last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":"string","description":"Company name, if the customer is a legal entity."},"tradeName":{"type":"string","description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":"string","description":"Company document, if the customer is a legal entity."},"stateInscription":{"type":"string","description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":"string","description":"Company phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"Whether the customer is a legal entity."},"userProfileId":{"type":"string","description":"User profile ID."},"customerClass":{"type":"string","description":"Customer class."}}},"paymentData":{"type":"object","description":"Object containing payment information for the order.","properties":{"updateStatus":{"type":"string","description":"Status of the last payment data update."},"installmentOptions":{"type":"array","description":"List of installment payment options available.","items":{"description":"Installment option details.","type":"object","properties":{"paymentSystem":{"type":"string","description":"Identifier for the payment system (as string)."},"bin":{"type":["string","null"],"description":"BIN (Bank Identification Number) or null."},"paymentName":{"type":["string","null"],"description":"Name of the payment, if available."},"paymentGroupName":{"type":["string","null"],"description":"Name of the payment group."},"value":{"type":"integer","description":"Total value for this payment method option (in cents)."},"installments":{"type":"array","description":"Installment options for this payment method.","items":{"type":"object","description":"Installment options for this payment method.","properties":{"count":{"type":"integer","description":"Number of payment installments."},"hasInterestRate":{"type":"boolean","description":"Indicates if this installment has interest."},"interestRate":{"type":"number","description":"Interest rate (percentage) for installment."},"value":{"type":"integer","description":"Value per installment (in cents)."},"total":{"type":"integer","description":"Total value across all installments (in cents)."},"sellerMerchantInstallments":{"type":"array","description":"Installment details for each merchant or seller.","items":{"type":"object","description":"Seller merchant installment details.","properties":{"id":{"type":"string","description":"ID of the merchant or seller."},"count":{"type":"integer","description":"How many installments."},"hasInterestRate":{"type":"boolean","description":"Whether interest is applied."},"interestRate":{"type":"number","description":"Interest rate, if any."},"value":{"type":"integer","description":"Installment value for this merchant."},"total":{"type":"integer","description":"Installment total for this merchant."}}}}}}}}}},"paymentSystems":{"type":"array","description":"List of all available payment systems on the store.","items":{"type":"object","description":"Payment system details.","properties":{"id":{"type":"integer","description":"Identifier for the payment system."},"name":{"type":"string","description":"Name of the payment system."},"groupName":{"type":"string","description":"Group name for the payment system."},"validator":{"type":"object","description":"Validation patterns and masks for payment details.","properties":{"regex":{"type":["string","null"],"description":"Regex for payment field validation, or null."},"mask":{"type":["string","null"],"description":"Mask pattern for input fields, or null."},"cardCodeRegex":{"type":["string","null"],"description":"Regex for validating the card security code or null."},"cardCodeMask":{"type":["string","null"],"description":"Mask for the card code input, or null."},"weights":{"type":["array","null"],"description":"Weights to be used for Luhn algorithm or similar, or null.","items":{"description":"Weight value.","type":"integer"}},"useCvv":{"type":"boolean","description":"Specifies if the payment requires CVV."},"useExpirationDate":{"type":"boolean","description":"Specifies if an expiration date is required."},"useCardHolderName":{"type":"boolean","description":"Specifies if cardholder's name is required."},"useBillingAddress":{"type":"boolean","description":"Specifies if a billing address is required."}}},"stringId":{"type":"string","description":"String identifier for the payment system."},"template":{"type":"string","description":"Template identifier for this payment type."},"requiresDocument":{"type":"boolean","description":"Whether a document is required."},"displayDocument":{"type":"boolean","description":"Whether document field is displayed."},"isCustom":{"type":"boolean","description":"Whether this is a custom payment method."},"description":{"type":["string","null"],"description":"Description for the payment system, or null."},"requiresAuthentication":{"type":"boolean","description":"Whether payment authentication is required."},"dueDate":{"type":"string","format":"date-time","description":"Due date for deferred payments (if any)."},"availablePayments":{"type":["object","null"],"description":"Details for available payments, or null."}}}},"payments":{"type":"array","description":"List of payment transactions for the order.","items":{"type":"object","description":"Payment transaction details.","properties":{"id":{"type":"string","description":"ID of the payment transaction."}}}},"giftCards":{"type":"array","description":"Gift cards used for payment (if any).","items":{"type":"string","description":"Gift card information."}},"giftCardMessages":{"type":"array","description":"List of messages relating to gift card payment.","items":{"type":"string","description":"Message information."}},"availableAccounts":{"type":"array","description":"Payment accounts available to use.","items":{"type":"object","description":"Payment account information.","properties":{"accountId":{"type":"string","description":"Account identifier."},"paymentSystem":{"type":"string","description":"Payment system identifier."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Bank identification number."},"availableAddresses":{"type":"array","description":"Available addresses for this account.","items":{"type":"string","description":"Address identifier."}},"expirationDate":{"type":"string","description":"Card expiration date."},"isExpired":{"type":"boolean","description":"Indicates if the card is expired."},"accountStatus":{"type":["string","null"],"description":"Account status."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"isCardToken":{"type":"boolean","description":"Indicates if this is a card token."},"cardLabel":{"type":"string","description":"Card label."},"cardOrigin":{"type":"string","description":"Card origin."}}}},"availableTokens":{"type":"array","description":"Payment tokens available to use.","items":{"type":"string","description":"Payment token information."}},"availableAssociations":{"type":"object","description":"Associations of available payments.","properties":{"id":{"type":"string","description":"ID of the association."}}}}},"marketingData":{"type":["object","null"],"description":"Marketing data (UTM parameters, campaigns, etc)."},"sellers":{"type":"array","description":"List of sellers involved in the order.","items":{"type":"object","description":"Seller information.","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller's name."},"logo":{"type":"string","description":"Seller's logo URL."},"minimumOrderValue":{"type":"integer","description":"Minimum value for orders from this seller (in cents)."}}}},"clientPreferencesData":{"type":"object","description":"Client preferences, such as locale and opt-in status.","properties":{"locale":{"type":"string","description":"Locale selected by the client (e.g. pt-BR)."},"optinNewsLetter":{"type":["boolean","null"],"description":"Whether client has opted in to newsletter."},"savePersonalData":{"type":"boolean","description":"Whether to save client's personal data."},"savePaymentData":{"type":"boolean","description":"Whether to allow client's payment data to be saved."}}},"commercialConditionData":{"type":["object","null"],"description":"Commercial condition data for the order if any."},"storePreferencesData":{"type":"object","description":"Preferences and settings for the store processing the order.","properties":{"countryCode":{"type":"string","description":"Store's country code (ISO 3166-1)."},"saveUserData":{"type":"boolean","description":"Flag to indicate if the user's data should be saved."},"timeZone":{"type":"string","description":"Time zone for the store."},"currencyCode":{"type":"string","description":"The ISO code of the store's currency."},"currencyLocale":{"type":"integer","description":"Locale code for formatting currency."},"currencySymbol":{"type":"string","description":"Symbol used for the currency."},"currencyFormatInfo":{"type":"object","description":"Formatting conventions for the store's currency.","properties":{"currencyDecimalDigits":{"type":"integer","description":"Number of decimal digits for currency formatting."},"currencyDecimalSeparator":{"type":"string","description":"Decimal separator for currency formatting."},"currencyGroupSeparator":{"type":"string","description":"Group separator for currency formatting."},"currencyGroupSize":{"type":"integer","description":"Number of digits in each group."},"startsWithCurrencySymbol":{"type":"boolean","description":"Whether the currency symbol appears before the value."}}}}},"giftRegistryData":{"type":["object","null"],"description":"Information about a gift registry if used.","properties":{"id":{"type":"string","description":"ID of the gift registry."}}},"openTextField":{"type":["string","null"],"description":"Open text field for notes or special instructions."},"invoiceData":{"type":["object","null"],"description":"Invoice data object if provided."},"customData":{"type":["object","null"],"description":"Customer additional information.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details."}},"customFields":{"type":["array","null"],"description":"Customizable fields created by the store.","items":{"type":["object","null"],"description":"Customizable fields details.","properties":{"linkedEntity":{"type":"object","description":"Linked entity.","properties":{"type":{"type":"string","description":"Linked entity type.","enum":["order","item","address"]},"id":{"type":"string","description":"Linked entity ID."}}},"fields":{"type":"array","description":"Custom fields.","items":{"type":"object","description":"Custom fields details.","properties":{"name":{"type":"string","description":"Custom field name."},"value":{"type":"string","description":"Custom field value."},"refId":{"type":"string","description":"Custom field reference ID."}}}}}}}}},"itemMetadata":{"type":"object","description":"Metadata information for each item in the order.","properties":{"items":{"type":"array","description":"Metadata and detail information for items.","items":{"type":"object","description":"Item metadata details.","properties":{"id":{"type":"string","description":"SKU identifier of the item."},"seller":{"type":"string","description":"Seller identifier."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product identifier."},"refId":{"type":"string","description":"Reference ID of the SKU."},"ean":{"type":["string","null"],"description":"EAN (European Article Number) for the SKU."},"imageUrl":{"type":"string","description":"Image URL representing the product."},"detailUrl":{"type":"string","description":"URL for the product detail page."},"assemblyOptions":{"type":"array","description":"Possible assembly options for the SKU.","items":{"type":"object","description":"Assembly option details.","properties":{"id":{"type":"string","description":"ID of the assembly option."}}}}}}}}},"hooksData":{"type":["object","null"],"description":"Information about hooks processed during the order."},"ratesAndBenefitsData":{"type":"object","description":"Data on rates (discounts, promotions) and associated benefits.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List of identifiers for the applied rates and benefits.","items":{"type":"object","description":"Rate and benefit identifier details.","properties":{"id":{"type":"string","description":"ID of the rate and benefit identifier."}}}},"teaser":{"type":"array","description":"Teaser data for current order's benefits.","items":{"type":"object","description":"Teaser details.","properties":{"id":{"type":"string","description":"ID of the teaser."}}}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information attached to the order, if any."},"merchantContextData":{"type":["object","null"],"description":"Merchant context custom data, if any."},"purchaseAgentsData":{"type":["object","null"],"description":"Data about purchase agents related to the order."},"itemsOrdination":{"type":["object","null"],"description":"Metadata information on item ordination (sorting) in the order."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds items to the orderForm. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) Unique identifier of the orderForm. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 26 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add payment data.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add payment data.yml new file mode 100644 index 0000000000..90dd260c76 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Add payment data.yml @@ -0,0 +1,101 @@ +info: + name: Add payment data + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderFormId + value: B0935AF4429441ABB4161111ED9D1104 + type: path + body: + type: json + data: |- + { + "payments": [ + { + "hasDefaultBillingAddress": true, + "installmentsInterestRate": null, + "referenceValue": 20100, + "bin": "223435", + "accountId": "4A660C0DEA2D477C996D88C6D3FFB7C0", + "value": 20100, + "paymentSystem": "2", + "installments": 1 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/attachments/paymentData - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderFormId":{"type":"string","description":"Unique identifier of the orderForm."},"salesChannel":{"type":"string","description":"Sales channel identifier."},"loggedIn":{"type":"boolean","description":"Indicates if the user is logged in."},"isCheckedIn":{"type":"boolean","description":"Indicates if the user is checked in."},"storeId":{"type":["string","null"],"description":"Store identifier."},"checkedInPickupPointId":{"type":["string","null"],"description":"Checked-in pickup point identifier."},"allowManualPrice":{"type":"boolean","description":"Indicates if manual price is allowed."},"canEditData":{"type":"boolean","description":"Indicates if data can be edited."},"userProfileId":{"type":["string","null"],"description":"User profile identifier."},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Indicates if profile data should be ignored."},"value":{"type":"number","description":"Total value of the order."},"messages":{"type":"array","description":"List of messages.","items":{"type":"object","description":"Message information.","properties":{"message":{"type":"string","description":"Message."}}}},"items":{"type":"array","description":"List of items in the order.","items":{"type":"object","description":"Item information.","properties":{"id":{"type":"string","description":"Identifier for the item."}}}},"selectableGifts":{"type":"array","description":"List of selectable gifts.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":"string","description":"Identifier for the selectable gift."}}}},"totalizers":{"type":"array","description":"List of totalizers.","items":{"type":"object","description":"Totalizer information.","properties":{"id":{"type":"string","description":"Identifier for the totalizer."},"name":{"type":"string","description":"Name for the totalizer."}}}},"shippingData":{"type":"object","description":"Shipping data.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}},"logisticsInfo":{"type":"array","description":"List of logistics information.","items":{"type":"object","description":"Logistics information.","properties":{"id":{"type":"string","description":"Identifier for the logistics information."}}}},"selectedAddresses":{"type":"array","description":"List of selected addresses.","items":{"type":"object","description":"Selected address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Coordinate value."}}}}},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"object","description":"Available address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}}},"pickupPoints":{"type":"array","description":"List of pickup points.","items":{"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"Identifier for the pickup point."}}}},"contactInformation":{"type":"array","description":"List of contact information.","items":{"type":"object","description":"Contact information.","properties":{"id":{"type":"string","description":"Identifier for the contact information."}}}}}},"clientProfileData":{"type":["object","null"],"description":"Client profile data.","properties":{"email":{"type":"string","description":"Email address."},"firstName":{"type":"string","description":"First name."},"lastName":{"type":"string","description":"Last name."},"document":{"type":"string","description":"Document number."},"documentType":{"type":"string","description":"Document type."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Corporate name."},"tradeName":{"type":["string","null"],"description":"Trade name."},"corporateDocument":{"type":["string","null"],"description":"Corporate document."},"stateInscription":{"type":["string","null"],"description":"State inscription."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone."},"isCorporate":{"type":"boolean","description":"Indicates if the profile is corporate."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates if the profile is complete on loading."},"profileErrorOnLoading":{"type":"boolean","description":"Indicates if there was an error loading the profile."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Payment data.","properties":{"updateStatus":{"type":"string","description":"Update status."},"installmentOptions":{"type":"array","description":"List of Installment options.","items":{"type":"object","description":"Information about the installment option.","properties":{"paymentSystem":{"type":"integer","description":"Payment system identification."},"bin":{"type":["string","null"],"description":"Card bin."},"paymentName":{"type":["string","null"],"description":"Payment name."},"paymentGroupName":{"type":["string","null"],"description":"Payment group name."},"value":{"type":"integer","description":"Total value assigned to this payment."},"installments":{"type":"array","description":"Installment information.","items":{"type":"object","description":"Installment information.","properties":{"count":{"type":"integer","description":"Count information."},"hasInterestRate":{"type":"boolean","description":"Indicates whether the payment has interest."},"interestRate":{"type":"integer","description":"Interest rate value."},"value":{"type":"integer","description":"Value of the order without the interest rate. The value is shown without separating cents."},"total":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments information.","items":{"type":"object","description":"Installment information."}}}}}}}},"paymentSystems":{"type":"array","description":"Information on payment systems.","items":{"type":"object","description":"Payment system information.","properties":{"id":{"type":"integer","description":"Payment system ID."},"name":{"type":"string","description":"Payment system name."},"groupName":{"type":"string","description":"Payment group name."},"validator":{"type":["object","null"],"description":"Payment system validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"description":{"type":"string","description":"Description."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether a authentication is required."},"dueDate":{"type":"string","description":"Payment due date."},"availablePayments":{"type":["string","null"],"description":"Availability of payment."}}}},"payments":{"type":"array","description":"Array with information on each payment chosen by the shopper.","items":{"type":"object","description":"Payment information.","properties":{"paymentSystem":{"type":"integer","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"group":{"type":"string","description":"Payment system group."},"installments":{"type":"integer","description":"Selected number of installments."},"installmentsInterestRate":{"type":"number","description":"Installments' interest rate."},"installmentsValue":{"type":"integer","description":"Value of the installments."},"value":{"type":"integer","description":"Total value assigned to this payment."},"referenceValue":{"type":"integer","description":"Reference value used to calculate total order value with interest."},"hasDefaultBillingAddress":{"type":"boolean","description":"Indicates whether billing address for this payment is the default address."}}}},"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"type":"string","description":"Gift card."}},"giftCardMessages":{"type":"array","description":"Array of gift card messages.","items":{"type":"string","description":"Gift card message."}},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"object","description":"Available account.","properties":{"accountId":{"type":"string","description":"Account identifier."},"paymentSystem":{"type":"string","description":"Payment system identifier."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Bank identification number."},"availableAddresses":{"type":"array","description":"Available addresses for this account.","items":{"type":"string","description":"Address identifier."}},"expirationDate":{"type":"string","description":"Card expiration date."},"isExpired":{"type":"boolean","description":"Indicates if the card is expired."},"accountStatus":{"type":["string","null"],"description":"Account status."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"isCardToken":{"type":"boolean","description":"Indicates if this is a card token."},"cardLabel":{"type":"string","description":"Card label."},"cardOrigin":{"type":"string","description":"Card origin."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"availableAssociations":{"type":"object","description":"Available associations.","properties":{"id":{"type":"string","description":"Identifier for the association."}}}}},"marketingData":{"type":["object","null"],"description":"Marketing data."},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."}}}},"clientPreferencesData":{"type":"object","description":"Client preferences data.","properties":{"locale":{"type":"string","description":"Locale."},"optinNewsLetter":{"type":"boolean","description":"Indicates whether the user opted in to receive the store's newsletter (`true`) or not (`false`)."},"savePersonalData":{"type":"boolean","description":"Indicates if personal data should be saved."},"savePaymentData":{"type":"boolean","description":"Indicates if payment data should be saved."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Store preferences data.","properties":{"countryCode":{"type":"string","description":"Country code."},"saveUserData":{"type":"boolean","description":"Indicates if user data should be saved."},"timeZone":{"type":"string","description":"Time zone."},"currencyCode":{"type":"string","description":"Currency code."},"currencyLocale":{"type":"number","description":"Currency locale."},"currencySymbol":{"type":"string","description":"Currency symbol."},"currencyFormatInfo":{"type":"object","description":"Currency format information.","properties":{"currencyDecimalDigits":{"type":"number","description":"Currency decimal digits."},"currencyDecimalSeparator":{"type":"string","description":"Currency decimal separator."},"currencyGroupSeparator":{"type":"string","description":"Currency group separator."},"currencyGroupSize":{"type":"number","description":"Currency group size."},"startsWithCurrencySymbol":{"type":"boolean","description":"Indicates if starts with currency symbol."}}}}},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON`, even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information."},"itemMetadata":{"type":["object","null"],"description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":["object","null"],"properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"merchantContextData":{"type":["object","null"],"description":"Merchant context data."},"purchaseAgentsData":{"type":["object","null"],"description":"Purchase agents data."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the orderForm.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Attaches payment information to the orderForm. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Storefront permissions + + The storefront user logged in using endpoint [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) must have a storefront role with the following [storefront permissions](https://developers.vtex.com/docs/guides/storefront-permissions) to be able to successfully run this request. + + | Resource key | Predefined storefront role | + | - | - | + | UseAdHocCard | Personal Cards User | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) Unique identifier of the orderForm. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Place order.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Place order.yml new file mode 100644 index 0000000000..8de3764ed0 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/Place order.yml @@ -0,0 +1,88 @@ +info: + name: Place order + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForm/:orderFormId/transaction" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderFormId + value: B0935AF4429441ABB4161111ED9D1104 + type: path + body: + type: json + data: |- + { + "savePersonalData": true, + "optinNewsLetter": true, + "value": 20100, + "referenceValue": 20100, + "interestValue": 0 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForm/:orderFormId/transaction - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":["string","null"],"description":"Unique identifier of the cart."},"merchantTransactions":{"type":"array","description":"Information on each merchant transaction.","items":{"description":"Merchant transaction information.","type":"object","properties":{"id":{"type":"string","description":"ID of the seller."},"transactionId":{"type":"string","description":"ID of the transaction in the platform."},"merchantName":{"type":"string","description":"Name of the merchant responsible for the sale."},"payments":{"type":"array","description":"Information on each payment pertinent to the transaction.","items":{"description":"Payment information.","type":"object","properties":{"paymentSystem":{"type":"integer","description":"Payment system."},"bin":{"type":["string","null"],"description":"Payment bin."},"accountId":{"type":["string","null"],"description":"Account ID."},"tokenId":{"type":["string","null"],"description":"Token ID."},"value":{"type":"integer","description":"Total value to be paid in this payment."},"referenceValue":{"type":"integer","description":"Reference value over which interests may be applied."},"giftCardRedemptionCode":{"type":["string","null"],"description":"Gift card redemption code."},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."}}}}}}},"receiverUri":{"type":["string","null"],"description":"Receiver URI."},"gatewayCallbackTemplatePath":{"type":["string","null"],"description":"Gateway callback template path."},"orderGroup":{"type":["string","null"],"description":"Order group."},"orderFormId":{"type":"string","description":"Unique identifier of the orderForm."},"salesChannel":{"type":"string","description":"Sales channel identifier."},"loggedIn":{"type":"boolean","description":"Indicates if the user is logged in."},"isCheckedIn":{"type":"boolean","description":"Indicates if the user is checked in."},"storeId":{"type":["string","null"],"description":"Store identifier."},"checkedInPickupPointId":{"type":["string","null"],"description":"Checked-in pickup point identifier."},"allowManualPrice":{"type":"boolean","description":"Indicates if manual price is allowed."},"canEditData":{"type":"boolean","description":"Indicates if data can be edited."},"userProfileId":{"type":["string","null"],"description":"User profile identifier."},"userType":{"type":["string","null"],"description":"User type."},"ignoreProfileData":{"type":"boolean","description":"Indicates if profile data should be ignored."},"value":{"type":"number","description":"Total value of the order."},"messages":{"type":"array","description":"List of messages.","items":{"type":"object","description":"Message information.","properties":{"message":{"type":"string","description":"Message."}}}},"items":{"type":"array","description":"List of items in the order.","items":{"type":"object","description":"Item information.","properties":{"id":{"type":"string","description":"Identifier for the item."}}}},"selectableGifts":{"type":"array","description":"List of selectable gifts.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":"string","description":"Identifier for the selectable gift."}}}},"totalizers":{"type":"array","description":"List of totalizers.","items":{"type":"object","description":"Totalizer information.","properties":{"id":{"type":"string","description":"Identifier for the totalizer."},"name":{"type":"string","description":"Name for the totalizer."}}}},"shippingData":{"type":"object","description":"Shipping data.","properties":{"address":{"type":["object","null"],"description":"Address information.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}},"logisticsInfo":{"type":"array","description":"List of logistics information.","items":{"type":"object","description":"Logistics information.","properties":{"id":{"type":"string","description":"Identifier for the logistics information."}}}},"selectedAddresses":{"type":"array","description":"List of selected addresses.","items":{"type":"object","description":"Selected address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Coordinate value."}}}}},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"object","description":"Available address details.","properties":{"addressType":{"type":"string","description":"Address type."},"receiverName":{"type":"string","description":"Receiver name."},"addressId":{"type":"string","description":"Address identifier."},"isDisposable":{"type":"boolean","description":"Indicates if the address is disposable."},"editable":{"type":"boolean","description":"Indicates if the address is editable."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":["string","null"],"description":"Address complement."},"reference":{"type":["string","null"],"description":"Address reference."},"geoCoordinates":{"type":"array","description":"Geographic coordinates.","items":{"type":"number","description":"Geographic coordinate."}}}}},"pickupPoints":{"type":"array","description":"List of pickup points.","items":{"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"Identifier for the pickup point."}}}},"contactInformation":{"type":"array","description":"List of contact information.","items":{"type":"object","description":"Contact information.","properties":{"id":{"type":"string","description":"Identifier for the contact information."}}}}}},"clientProfileData":{"type":["object","null"],"description":"Client profile data.","properties":{"email":{"type":"string","description":"Email address."},"firstName":{"type":"string","description":"First name."},"lastName":{"type":"string","description":"Last name."},"document":{"type":"string","description":"Document number."},"documentType":{"type":"string","description":"Document type."},"phone":{"type":"string","description":"Phone number."},"corporateName":{"type":["string","null"],"description":"Corporate name."},"tradeName":{"type":["string","null"],"description":"Trade name."},"corporateDocument":{"type":["string","null"],"description":"Corporate document."},"stateInscription":{"type":["string","null"],"description":"State inscription."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone."},"isCorporate":{"type":"boolean","description":"Indicates if the profile is corporate."},"profileCompleteOnLoading":{"type":"boolean","description":"Indicates if the profile is complete on loading."},"profileErrorOnLoading":{"type":"boolean","description":"Indicates if there was an error loading the profile."},"customerClass":{"type":["string","null"],"description":"Customer class."}}},"paymentData":{"type":"object","description":"Payment data.","properties":{"updateStatus":{"type":"string","description":"Update status."},"installmentOptions":{"type":"array","description":"List of Installment options.","items":{"type":"object","description":"Information about the installment option.","properties":{"paymentSystem":{"type":"integer","description":"Payment system identification."},"bin":{"type":["string","null"],"description":"Card bin."},"paymentName":{"type":["string","null"],"description":"Payment name."},"paymentGroupName":{"type":["string","null"],"description":"Payment group name."},"value":{"type":"integer","description":"Total value assigned to this payment."},"installments":{"type":"array","description":"Installment information.","items":{"type":"object","description":"Installment information.","properties":{"count":{"type":"integer","description":"Count information."},"hasInterestRate":{"type":"boolean","description":"Indicates whether the payment has interest."},"interestRate":{"type":"integer","description":"Interest rate value."},"value":{"type":"integer","description":"Value of the order without the interest rate. The value is shown without separating cents."},"total":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments information.","items":{"type":"object","description":"Installment information."}}}}}}}},"paymentSystems":{"type":"array","description":"Information on payment systems.","items":{"type":"object","description":"Payment system information.","properties":{"id":{"type":"integer","description":"Payment system ID."},"name":{"type":"string","description":"Payment system name."},"groupName":{"type":"string","description":"Payment group name."},"validator":{"type":["object","null"],"description":"Payment system validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether a authentication is required."},"dueDate":{"type":"string","description":"Payment due date."},"availablePayments":{"type":["string","null"],"description":"Availability of payment."}}}},"payments":{"type":"array","description":"Array with information on each payment chosen by the shopper.","items":{"type":"object","description":"Payment information.","properties":{"paymentSystem":{"type":"integer","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"group":{"type":"string","description":"Payment system group."},"installments":{"type":"integer","description":"Selected number of installments."},"installmentsInterestRate":{"type":"number","description":"Installments' interest rate."},"installmentsValue":{"type":"integer","description":"Value of the installments."},"value":{"type":"integer","description":"Total value assigned to this payment."},"referenceValue":{"type":"integer","description":"Reference value used to calculate total order value with interest."},"hasDefaultBillingAddress":{"type":"boolean","description":"Indicates whether billing address for this payment is the default address."}}}},"giftCards":{"type":"array","description":"Gift card information, if it applies to the order.","items":{"type":"string","description":"Gift card."}},"giftCardMessages":{"type":"array","description":"Array of gift card messages.","items":{"type":"string","description":"Gift card message."}},"availableAccounts":{"type":"array","description":"Available accounts.","items":{"type":"object","description":"Available account.","properties":{"accountId":{"type":"string","description":"Account identifier."},"paymentSystem":{"type":"string","description":"Payment system identifier."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Bank identification number."},"availableAddresses":{"type":"array","description":"Available addresses for this account.","items":{"type":"string","description":"Address identifier."}},"expirationDate":{"type":"string","description":"Card expiration date."},"isExpired":{"type":"boolean","description":"Indicates if the card is expired."},"accountStatus":{"type":["string","null"],"description":"Account status."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"isCardToken":{"type":"boolean","description":"Indicates if this is a card token."},"cardLabel":{"type":"string","description":"Card label."},"cardOrigin":{"type":"string","description":"Card origin."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"availableAssociations":{"type":"object","description":"Available associations.","properties":{"id":{"type":"string","description":"Identifier for the association."}}}}},"marketingData":{"type":["object","null"],"description":"Marketing data."},"sellers":{"type":"array","description":"Information on each seller.","items":{"description":"Seller information.","type":"object","properties":{"id":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo."}}}},"clientPreferencesData":{"type":"object","description":"Client preferences data.","properties":{"locale":{"type":"string","description":"Locale."},"optinNewsLetter":{"type":"boolean","description":"Indicates whether the user opted in to receive the store's newsletter (`true`) or not (`false`)."},"savePersonalData":{"type":"boolean","description":"Indicates if personal data should be saved."},"savePaymentData":{"type":"boolean","description":"Indicates if payment data should be saved."}}},"commercialConditionData":{"type":["object","null"],"description":"Object containing commercial condition information."},"storePreferencesData":{"type":"object","description":"Store preferences data.","properties":{"countryCode":{"type":"string","description":"Country code."},"saveUserData":{"type":"boolean","description":"Indicates if user data should be saved."},"timeZone":{"type":"string","description":"Time zone."},"currencyCode":{"type":"string","description":"Currency code."},"currencyLocale":{"type":"number","description":"Currency locale."},"currencySymbol":{"type":"string","description":"Currency symbol."},"currencyFormatInfo":{"type":"object","description":"Currency format information.","properties":{"currencyDecimalDigits":{"type":"number","description":"Currency decimal digits."},"currencyDecimalSeparator":{"type":"string","description":"Currency decimal separator."},"currencyGroupSeparator":{"type":"string","description":"Currency group separator."},"currencyGroupSize":{"type":"number","description":"Currency group size."},"startsWithCurrencySymbol":{"type":"boolean","description":"Indicates if starts with currency symbol."}}}}},"giftRegistryData":{"type":["object","null"],"description":"Gift registry list information."},"openTextField":{"type":["string","null"],"description":"Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON`, even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api)."},"invoiceData":{"type":["object","null"],"description":"Invoice data including billing address.","properties":{"address":{"type":"object","description":"Billing address.","properties":{"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State name."},"country":{"type":"string","description":"Country."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"complement":{"type":"string","description":"Address complement."},"reference":{"type":"string","description":"Reference for location."},"geoCoordinates":{"type":"array","description":"Geographic coordinates (latitude, longitude).","items":{"type":"number","description":"Coordinate value."}}}}}},"customData":{"type":["object","null"],"description":"Customer additional information."},"itemMetadata":{"type":["object","null"],"description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"description":"Item metadata.","type":["object","null"],"properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"name":{"type":"string","description":"Product name."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"Ref ID."},"ean":{"type":["string","null"],"description":"European Article Number."},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."}}}}}},"hooksData":{"type":["object","null"],"description":"Hooks information."},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"string","description":"Benefit identifier."}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"string","description":"Benefit teaser."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"merchantContextData":{"type":["object","null"],"description":"Merchant context data."},"purchaseAgentsData":{"type":["object","null"],"description":"Purchase agents data."},"itemsOrdination":{"type":["object","null"],"description":"Object containing information about the ordering of items within the orderForm.","properties":{"criteria":{"type":"string","description":"Criteria adopted to order the items in the list."},"ascending":{"type":"boolean","description":"Indicates whether the ordering is ascending."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Processes the order and creates a transaction. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderFormId` | path | (Required) Unique identifier of the orderForm. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 26 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/folder.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/folder.yml new file mode 100644 index 0000000000..7a75a65d83 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Checkout operations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Checkout operations + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get card.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get card.yml new file mode 100644 index 0000000000..f7b3d8401a --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get card.yml @@ -0,0 +1,103 @@ +info: + name: Get card + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/accounts/:accountId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountId + value: 4A660C0DEA2D477C996D88C6D3FFB7C0 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/accounts/:accountId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/accounts/:accountId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/accounts/:accountId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/accounts/:accountId - Schema is valid", function () { + const schema = {"type":"object","properties":{"bin":{"type":"string","description":"BIN (Bank Identification Number)."},"lastDigits":{"type":"string","description":"Last four digits of the card."},"expiryMonth":{"type":"string","description":"Expiry month."},"expiryYear":{"type":"string","description":"Expiry year."},"mask":{"type":"string","description":"Masked card number."},"paymentSystem":{"type":"integer","description":"Payment system identifier."},"paymentSystemName":{"type":"string","description":"Payment system name."},"address":{"type":"string","description":"JSON string containing address information. The JSON must include the following address information `addressType`, `addressId`, `postalCode`, `street`,`neighborhood`, `city`, `state`,`country`, `number`, `complement`."},"document":{"type":["string","null"],"description":"Document associated with the card."},"label":{"type":"string","description":"Label or description for the tokenized card."},"tokens":{"type":"array","description":"List of tokens associated with the card.","items":{"type":"object","description":"Token details.","properties":{"providerId":{"type":"string","description":"Provider identifier."},"type":{"type":"string","description":"Token type."},"value":{"type":"string","description":"Token value."},"expiration":{"type":"string","description":"Token expiration date."},"href":{"type":["string","null"],"description":"Token URL reference."},"providerCardTokentId":{"type":"string","description":"Provider card token identifier."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"extraData":{"type":["object","null"],"description":"Additional data."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves card information by account ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountId` | path | (Required) Unique identifier of the account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "bin": "123231", + "lastDigits": "1231", + "expiryMonth": "05", + "expiryYear": "2031", + "mask": "1231 1231 1231 1231", + "paymentSystem": 2, + "paymentSystemName": "Visa", + "address": "{\"addressType\":\"billing\",\"addressId\":null,\"postalCode\":\"73065772\",\"street\":\"17395 Gutmann Expressway\",\"neighborhood\":\"John Doe\",\"city\":\"Dublin\",\"state\":\"FO\",\"country\":\"Guadeloupe\",\"number\":\"4\",\"complement\":null}", + "document": null, + "label": "01.A. Save 1 tokenized credit card via api using an external credential", + "tokens": [ + { + "providerId": "123579", + "type": "TOKEN_VALUE", + "value": "1231123112311231", + "expiration": "2031-05", + "href": null, + "providerCardTokentId": "A9FC15D4B46241BCBBE13AA6C29DA721", + "useCvvForAuthorization": false, + "extraData": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get transaction details.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get transaction details.yml new file mode 100644 index 0000000000..0fa55812ba --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/Get transaction details.yml @@ -0,0 +1,83 @@ +info: + name: Get transaction details + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: 1234567890ABC + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"status":{"type":"string","description":"Transaction status.","enum":["Approved"]},"transactionId":{"type":"string","description":"Transaction ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves detailed information about a specific transaction. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Unique identifier of the transaction. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "status": "Approved", + "transactionId": "1234567890ABC" + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/List payments.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/List payments.yml new file mode 100644 index 0000000000..9ce79ee30c --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/List payments.yml @@ -0,0 +1,94 @@ +info: + name: List payments + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/payments?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: transactionId + value: 1234567890ABC + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/transactions/:transactionId/payments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments - Schema is valid", function () { + const schema = {"type":"array","description":"List of payments.","items":{"type":"object","description":"Payment object with fields.","properties":{"id":{"type":"string","description":"Payment ID."},"fields":{"type":"array","description":"Payment fields.","items":{"type":"object","description":"Payment field name and value.","properties":{"name":{"type":"string","description":"Field name."},"value":{"type":"string","description":"Field value."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of payments associated with a transaction. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Unique identifier of the transaction. | + | `an` | query | (Required) Account name parameter. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "payment-id-123", + "fields": [ + { + "name": "accountId", + "value": "4A660C0DEA2D477C996D88C6D3FFB7C0" + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/folder.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/folder.yml new file mode 100644 index 0000000000..711633ade7 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Payment gateway/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment gateway + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Create profile.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Create profile.yml new file mode 100644 index 0000000000..7c9717605f --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Create profile.yml @@ -0,0 +1,115 @@ +info: + name: Create profile + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/profile-system/pvt/profiles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "personalData": { + "email": "user@example.com", + "firstName": "John", + "lastName": "Doe", + "document": "01234567890", + "documentType": "cpf", + "gender": "M", + "homePhone": "+5511999999999", + "cellPhone": "+5522999999999", + "businessPhone": "+5522988888888", + "isPJ": false + }, + "addresses": { + "0": { + "addressId": "12345678-1234-1234-1234-123456789012", + "receiverName": "John Doe", + "isDisposable": false, + "addressType": "residential", + "postalCode": "12345678", + "street": "Main Street", + "neighborhood": "Downtown", + "city": "São Paulo", + "state": "SP", + "country": "BRA", + "number": "123" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/profile-system/pvt/profiles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/profile-system/pvt/profiles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/profile-system/pvt/profiles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/profile-system/pvt/profiles - Schema is valid", function () { + const schema = {"type":"object","description":"Profile information.","properties":{"profileId":{"type":"string","description":"Unique identifier for the created profile."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new Storefront user profile in the Profile System with personal data and addresses. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Vtex ID | User Management | **Create User** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "profileId": "12345678-1234-1234-1234-123456789012" + } + ``` diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Delete profile.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Delete profile.yml new file mode 100644 index 0000000000..6198e64f02 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Delete profile.yml @@ -0,0 +1,61 @@ +info: + name: Delete profile + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/profile-system/pvt/profiles/:profileId/personalData?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: profileId + value: 12345678-1234-1234-1234-123456789012 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/profile-system/pvt/profiles/:profileId/personalData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/profile-system/pvt/profiles/:profileId/personalData - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes personal data for a specific profile. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) Unique identifier of the profile. | + | `an` | query | (Required) Account name parameter. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Get profile cards.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Get profile cards.yml new file mode 100644 index 0000000000..081e1a28aa --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/Get profile cards.yml @@ -0,0 +1,78 @@ +info: + name: Get profile cards + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/profile-system/pvt/profiles/:profileId/vcs-checkout" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: profileId + value: 12345678-1234-1234-1234-123456789012 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/profile-system/pvt/profiles/:profileId/vcs-checkout - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/profile-system/pvt/profiles/:profileId/vcs-checkout - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/profile-system/pvt/profiles/:profileId/vcs-checkout - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/profile-system/pvt/profiles/:profileId/vcs-checkout - Schema is valid", function () { + const schema = {"type":"object","properties":{"paymentData":{"type":"string","description":"JSON string containing payment data with available accounts."},"orderFormIds":{"type":"string","description":"JSON array string of orderForm IDs."},"lastOrderTimestamp":{"type":"string","description":"Timestamp of the last order."},"lastUserPurchases":{"type":"string","description":"JSON array string of last user purchases."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of cards associated with a profile. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + >ℹ️ This endpoint must use the `accountAuthCookie` value generated from the [Validate client login](https://developers.vtex.com/docs/api-reference/checkout-custom-card-payment-api#post-/api/vtexid/pub/authentication/classic/validate) endpoint. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) Unique identifier of the profile. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 5 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/folder.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/folder.yml new file mode 100644 index 0000000000..ee02143034 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/Profile management/folder.yml @@ -0,0 +1,4 @@ +info: + name: Profile management + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/environments/VTEX.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Checkout Custom Card Payment API/opencollection.yml b/BrunoCollections/VTEX - Checkout Custom Card Payment API/opencollection.yml new file mode 100644 index 0000000000..78f0b11b36 --- /dev/null +++ b/BrunoCollections/VTEX - Checkout Custom Card Payment API/opencollection.yml @@ -0,0 +1,24 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Checkout Custom Card Payment API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Checkout Custom Card Cayment API allows flows for credit card tokenization in VTEX, covering profile management, card token vault operations, checkout processes, payment gateway interactions, and authentication workflows. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Create custom field settings.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Create custom field settings.yml new file mode 100644 index 0000000000..933a0b9269 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Create custom field settings.yml @@ -0,0 +1,104 @@ +info: + name: Create custom field settings + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/customFieldSettings/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "name": "PO Number", + "enabled": true, + "required": false, + "level": "item", + "type": "option", + "additionalData": "Additional validation rules" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/customFieldSettings/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/customFieldSettings/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/customFieldSettings/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/customFieldSettings/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing the created custom field information.","properties":{"Id":{"type":"string","description":"Auto-generated GUID for the custom field, prefixed with the data entity name."},"Href":{"type":"string","description":"Direct URL to the created custom field document."},"DocumentId":{"type":"string","description":"Identifier of the custom field document (GUID without prefix)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates and configures a custom field for a specific contract. You can define the field name, type, level, and whether it is enabled or required. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "customFieldSettings-89f1da93-6917-4cbf-894e-1f1399682826c", + "Href": "https://accountName.myvtex.com.br/api/dataentities/customFieldSettings/documents/89f1da93-6917-4cbf-894e-1f1399682826c?_schema=v1", + "DocumentId": "89f1da93-6917-4cbf-894e-1f1399682826c" + } + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Delete custom field setting.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Delete custom field setting.yml new file mode 100644 index 0000000000..d42a2ca51a --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Delete custom field setting.yml @@ -0,0 +1,65 @@ +info: + name: Delete custom field setting + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/customFieldSettings/documents/:documentId?_schema=v1" + headers: + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: documentId + value: 89f1da93-6917-4cbf-894e-1f1399682826c + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/customFieldSettings/documents/:documentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/customFieldSettings/documents/:documentId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the custom field settings document associated with the given document ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `documentId` | path | (Required) Unique identifier of the custom field settings document to delete. | + | `_schema` | query | (Required) Schema version to use for the request. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Get custom field settings.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Get custom field settings.yml new file mode 100644 index 0000000000..7a926c1b7f --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Get custom field settings.yml @@ -0,0 +1,131 @@ +info: + name: Get custom field settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/customFieldSettings/search?_schema=v1&_fields=_all&_where=contractId={{contractId}}" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: _fields + value: _all + type: query + - name: _where + value: contractId={{contractId}} + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/customFieldSettings/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/customFieldSettings/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/customFieldSettings/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/customFieldSettings/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array of custom fields settings objects.","items":{"type":"object","description":"Custom fields settings object.","properties":{"id":{"type":"string","description":"Unique identifier of the custom field instance."},"dataEntityId":{"type":"string","description":"Identifier of the data entity to which the field belongs."},"accountId":{"type":"string","description":"Identifier of the account associated with the field."},"accountName":{"type":"string","description":"Name of the account associated with the field."},"followers":{"type":"array","description":"List of users following this field (usually empty).","items":{"type":"string","description":"User identifier."}},"schemas":{"type":"array","description":"List of applicable schema versions for this field.","items":{"type":"string","description":"Schema version."}},"contractId":{"type":"string","description":"Identifier of the contract associated with the field."},"name":{"type":"string","description":"Name of the custom fields."},"enabled":{"type":"boolean","description":"Indicates whether the field is enabled."},"required":{"type":"boolean","description":"Indicates whether the field is mandatory."},"level":{"type":"string","description":"Level at which the field is applied. Possible values: `item`, `order`, `address`."},"type":{"type":"string","description":"Type of the field. Possible values: `text`, `number`, `option`."},"additionalData":{"type":["string","null"],"description":"Additional field for extra information."},"createdBy":{"type":"string","description":"ID of the user who created the field."},"createdBy_USER":{"type":"object","description":"Details of the user who created the field.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"createdIn":{"type":"string","format":"date-time","description":"Date and time when the field was created (ISO 8601 format)."},"lastInteractionBy":{"type":"string","description":"ID of the user who last interacted with the field."},"lastInteractionBy_USER":{"type":"object","description":"Details of the user who last interacted with the field.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"lastInteractionIn":{"type":"string","format":"date-time","description":"Date and time of the last interaction with the field (ISO 8601 format)."},"tags":{"type":"array","description":"List of tags associated with the field (usually empty).","items":{"type":"string","description":"Tag value."}},"dataInstanceId":{"type":"string","description":"Identifier of the data instance (usually equal to `id`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the settings of custom fields for a given contract. The response includes field configuration details such as name, type, level, and whether the field is enabled or required. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema version to use for the request. This query string defines which schema version to apply when retrieving data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. Use `_all` to return all fields, or specify individual fields like `id,contractId,name`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_where` | query | (Required) Filter expression to search documents using Master Data v2 query syntax. Use `contractId={{contractId}}` to filter custom field settings by contract. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "id": "34575ee8-80c1-458d-b75a-7492b36513e3", + "dataEntityId": "customFieldSettings", + "accountId": "6e41729c-a5ca-4f37-a46f-62315ef3a56a", + "accountName": "connections", + "followers": [], + "schemas": [ + "v1" + ], + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "name": "PO Number", + "enabled": true, + "required": false, + "level": "item", + "type": "option", + "additionalData": "teste", + "createdBy": "6ce199d2-8a85-4e83-831c-389dcb64c0c1", + "createdBy_USER": { + "Id": "6ce199d2-8a85-4e83-831c-389dcb64c0c1", + "Login": "user@vtex.com", + "Name": null + }, + "createdIn": "2025-09-24T12:32:08.6879184Z", + "lastInteractionBy": "6ce199d2-8a85-4e83-831c-389dcb64c0c1", + "lastInteractionBy_USER": { + "Id": "6ce199d2-8a85-4e83-831c-389dcb64c0c1", + "Login": "user@vtex.com", + "Name": null + }, + "lastInteractionIn": "2025-09-24T12:32:08.6879204Z", + "tags": [], + "dataInstanceId": "34575ee8-80c1-458d-b75a-7492b36513e3" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Update custom field settings.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Update custom field settings.yml new file mode 100644 index 0000000000..da60df3781 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/Update custom field settings.yml @@ -0,0 +1,104 @@ +info: + name: Update custom field settings + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/customFieldSettings/documents/:documentId?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: documentId + value: 89f1da93-6917-4cbf-894e-1f1399682826c + type: path + body: + type: json + data: |- + { + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "name": "PO Number", + "enabled": true, + "required": false, + "level": "item", + "type": "option", + "additionalData": "Updated validation rules" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/customFieldSettings/documents/:documentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/customFieldSettings/documents/:documentId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/customFieldSettings/documents/:documentId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/customFieldSettings/documents/:documentId - Schema is valid", function () { + const schema = {"type":"object","description":"Empty response body on successful update."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the configuration of an existing custom field. This endpoint allows you to enable or disable a custom field, mark it as required, define the level (`item`, `order`, or `address`), and set its type (`text`, `number`, or `option`). You can also provide optional `additionalData` for custom validations, allowed values, or integration rules. Each request handles a single custom field configuration. The field is identified by its auto-generated ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `documentId` | path | (Required) Unique identifier of the custom field settings document to update. | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field settings/folder.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/folder.yml new file mode 100644 index 0000000000..bfe7eae883 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field settings/folder.yml @@ -0,0 +1,4 @@ +info: + name: Custom field settings + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/Create custom field value.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Create custom field value.yml new file mode 100644 index 0000000000..5c3485d7b4 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Create custom field value.yml @@ -0,0 +1,102 @@ +info: + name: Create custom field value + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "value": "CC3", + "auxId": null, + "description": "Cost Center 3" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/customFieldValues/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/customFieldValues/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing the created custom field value information.","properties":{"Id":{"type":"string","description":"Unique identifier of the created value, prefixed with the data entity name."},"Href":{"type":"string","description":"Direct URL to access the value document created."},"DocumentId":{"type":"string","description":"The value ID without the data entity prefix."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a value for an existing custom field for a given contract. If you are creating a value for a custom field configured with level `address`, you must send a valid address ID in the field `auxId`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "customFieldValues-07d12677-08d8-11f0-b37f-e1ae31409099", + "Href": "https://accountName.myvtex.com.br/api/dataentities/customFieldValues/documents/07d12677-08d8-11f0-b37f-e1ae31409099", + "DocumentId": "07d12677-08d8-11f0-b37f-e1ae31409099" + } + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/Delete custom field value.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Delete custom field value.yml new file mode 100644 index 0000000000..a1b7b4d606 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Delete custom field value.yml @@ -0,0 +1,69 @@ +info: + name: Delete custom field value + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:customFieldValueId?_fields=_all&_schema=v1" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + - name: _schema + value: v1 + type: query + - name: customFieldValueId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific custom field value document. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `customFieldValueId` | path | (Required) Unique identifier of the custom field value document. | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. This query string parameter allows you to specify which fields to include. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/Get custom field value.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Get custom field value.yml new file mode 100644 index 0000000000..275854ed88 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Get custom field value.yml @@ -0,0 +1,122 @@ +info: + name: Get custom field value + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:customFieldValueId?_fields=_all&_schema=v1" + headers: + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + - name: _schema + value: v1 + type: query + - name: customFieldValueId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Schema is valid", function () { + const schema = {"type":"object","description":"Custom field value document object.","properties":{"id":{"type":"string","description":"The ID of the custom field value document."},"dataEntityId":{"type":"string","description":"The ID of the data entity (`customFieldValues`)."},"accountId":{"type":"string","description":"Unique identifier of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"followers":{"type":"array","description":"Array of followers for this document.","items":{"type":"string","description":"Follower identifier."}},"schemas":{"type":"array","description":"Array of schemas associated with this document.","items":{"type":"string","description":"Schema version."}},"customFieldId":{"type":"string","description":"The ID of the custom field (from `customFieldSettings`)."},"contractId":{"type":"string","description":"The ID of the contract to which this value belongs."},"auxId":{"type":["string","null"],"description":"Optional auxiliary ID (e.g., address ID) used for fields with level `address`."},"value":{"type":"string","description":"The actual value of the custom field."},"description":{"type":["string","null"],"description":"Optional description explaining what the value represents."},"createdBy":{"type":"string","description":"ID of the user who created the document."},"createdBy_USER":{"type":"object","description":"Metadata about the creator.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"createdIn":{"type":"string","format":"date-time","description":"Timestamp when the document was created."},"lastInteractionBy":{"type":"string","description":"ID of the last user who modified the document."},"lastInteractionBy_USER":{"type":"object","description":"Metadata about the last interacting user.","properties":{"Id":{"type":"string","description":"Unique identifier of the user."},"Login":{"type":"string","description":"Login email of the user."},"Name":{"type":["string","null"],"description":"Name of the user."}}},"lastInteractionIn":{"type":"string","format":"date-time","description":"Timestamp of the last modification."},"tags":{"type":"array","description":"Tags associated with the document.","items":{"type":"string","description":"Tag value."}},"dataInstanceId":{"type":"string","description":"Unique identifier of the data instance."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific custom field value document by its ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `customFieldValueId` | path | (Required) Unique identifier of the custom field value document. | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. This query string parameter allows you to specify which fields to include. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "a50012d0-c01f-465d-b4bc-e33b38d7437a", + "dataEntityId": "customFieldValues", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "store", + "followers": [], + "schemas": [], + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "contractId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "auxId": null, + "value": "CC3", + "description": "Some details about the value", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdBy_USER": { + "Id": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "Login": "user@vtex.com", + "Name": null + }, + "createdIn": "2025-04-11T18:24:14.8763277Z", + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionBy_USER": { + "Id": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "Login": "user@vtex.com", + "Name": null + }, + "lastInteractionIn": "2025-04-11T18:24:14.8763277Z", + "tags": [], + "dataInstanceId": "a50012d0-c01f-465d-b4bc-e33b38d7437a" + } + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/Search custom field values.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Search custom field values.yml new file mode 100644 index 0000000000..86f3f9eefc --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Search custom field values.yml @@ -0,0 +1,128 @@ +info: + name: Search custom field values + type: http + seq: 5 + +http: + method: GET + url: '{{baseUrl}}/api/dataentities/customFieldValues/search?_schema=v1&_fields=_all&_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}"' + headers: + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: _fields + value: _all + type: query + - name: _where + value: contractId={{contractId}} AND customFieldId="{{customFieldId}}" + type: query + - name: _sort + value: value ASC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/customFieldValues/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/customFieldValues/search - Schema is valid", function () { + const schema = {"type":"array","description":"Array of custom field value objects matching the search criteria.","items":{"type":"object","description":"Custom field value search result object.","properties":{"id":{"type":"string","description":"The unique ID of the custom field value document."},"contractId":{"type":"string","description":"The ID of the contract associated with the custom field."},"customFieldId":{"type":"string","description":"The ID of the custom field (from `customFieldSettings`)."},"auxId":{"type":["string","null"],"description":"Optional auxiliary ID (e.g., address ID) used for fields with level `address`."},"value":{"type":"string","description":"The value stored in the custom field."},"description":{"type":["string","null"],"description":"Optional text describing what the value represents."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves custom field values filtered by contract ID, custom field ID, and optionally by specific value. Results can be sorted by value. + + You can use the `_where` query parameter to filter results: + - To get all values: `_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}"` + - To get a specific value: `_where=contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND value="{{value}}"` + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema version to use for the request. This query string defines which schema version to apply when retrieving data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `_fields` | query | (Required) Comma-separated list of field names to be returned in the response. Use `_all` to return all fields, or specify individual fields like `id,contractId,value`. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_where` | query | (Required) Filter expression to search documents using Master Data v2 query syntax. You can combine multiple conditions using `AND`. Examples: - Get all values for a contract: `contractId={{contractId}}` - Filter by contract and custom field: `contractId={{contractId}} AND customFieldId="{{customFieldId}}"` - Filter by specific value: `contractId={{contractId}} AND customFieldId="{{customFieldId}}" AND value="{{value}}"` Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `_sort` | query | Defines the field and order for sorting results. Use the pattern `{fieldName} {ASC\|DESC}`. For example, `value ASC` sorts results by the `value` field in ascending order. Learn more about [searching documents in Master Data v2](https://developers.vtex.com/docs/guides/search-documents-in-master-data). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "e5130781-32ed-11f0-b37f-942217c27f9b", + "contractId": "1124b2d8-32eb-11f0-b37f-e2557e6b18d5", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": null, + "value": "CC1", + "description": "Cost Center 1" + }, + { + "id": "f6240892-43fe-22f1-c48a-053328d28f0c", + "contractId": "1124b2d8-32eb-11f0-b37f-e2557e6b18d5", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": null, + "value": "CC2", + "description": "Cost Center 2" + }, + { + "id": "a7351903-54ff-33f2-d59b-164439e39g1d", + "contractId": "1124b2d8-32eb-11f0-b37f-e2557e6b18d5", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "auxId": null, + "value": "CC3", + "description": "Cost Center 3" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/Update custom field value.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Update custom field value.yml new file mode 100644 index 0000000000..988b4d397b --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/Update custom field value.yml @@ -0,0 +1,79 @@ +info: + name: Update custom field value + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/customFieldValues/documents/:customFieldValueId?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: customFieldValueId + value: a50012d0-c01f-465d-b4bc-e33b38d7437a + type: path + body: + type: json + data: |- + { + "contractId": "123e4567-e89b-12d3-a456-426614174000", + "customFieldId": "a7f2b3d4-5c6e-7f89-0123-456789abcdef", + "value": "CC3", + "auxId": null, + "description": "Details about the value" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/customFieldValues/documents/:customFieldValueId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the value of a specific custom field for a given contract. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `customFieldValueId` | path | (Required) Unique identifier of the custom field value document. | + | `_schema` | query | (Required) Schema version to use for the request. This query string parameter defines which schema version to apply when retrieving or manipulating data. Learn more about [Master Data schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Custom Fields API/Custom field values/folder.yml b/BrunoCollections/VTEX - Custom Fields API/Custom field values/folder.yml new file mode 100644 index 0000000000..d4dcab1994 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/Custom field values/folder.yml @@ -0,0 +1,4 @@ +info: + name: Custom field values + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Custom Fields API/environments/VTEX.yml b/BrunoCollections/VTEX - Custom Fields API/environments/VTEX.yml new file mode 100644 index 0000000000..264b31ee9f --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/environments/VTEX.yml @@ -0,0 +1,14 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: myvtex + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com + - name: contractId + value: "" + - name: customFieldId + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Custom Fields API/opencollection.yml b/BrunoCollections/VTEX - Custom Fields API/opencollection.yml new file mode 100644 index 0000000000..2346cb7771 --- /dev/null +++ b/BrunoCollections/VTEX - Custom Fields API/opencollection.yml @@ -0,0 +1,42 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Custom Fields API + +request: + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Custom Fields API allows you to create, manage, and apply custom fields to contracts and orders in VTEX. Custom fields enable you to capture additional business-specific information at different levels: `item`, `order`, or `address`. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + This API is divided into three main sections: + + ### Custom field settings + Configure custom field definitions for contracts, including field name, type, level, and validation rules. + + - `GET` [Get custom field settings](https://developers.vtex.com/docs/api-reference/custom-fields-api#get-/api/dataentities/customFieldSettings/search) + - `POST` [Create custom field setting](https://developers.vtex.com/docs/api-reference/custom-fields-api#post-/api/dataentities/customFieldSettings/documents) + - `PATCH` [Update custom field setting](https://developers.vtex.com/docs/api-reference/custom-fields-api#patch-/api/dataentities/customFieldSettings/documents/-documentId-) + - `DELETE` [Delete custom field setting](https://developers.vtex.com/docs/api-reference/custom-fields-api#delete-/api/dataentities/customFieldSettings/documents/-documentId-) + + ### Custom field values + Manage the actual values assigned to custom fields for specific contracts. + - `POST` [Create custom field value](https://developers.vtex.com/docs/api-reference/custom-fields-api#post-/api/dataentities/customFieldValues/documents) + - `GET` [Get custom field value](https://developers.vtex.com/docs/api-reference/custom-fields-api#get-/api/dataentities/customFieldValues/documents/-customFieldValueId-) + - `PATCH` [Update custom field value](https://developers.vtex.com/docs/api-reference/custom-fields-api#patch-/api/dataentities/customFieldValues/documents/-customFieldValueId-) + - `DELETE` [Delete custom field value](https://developers.vtex.com/docs/api-reference/custom-fields-api#delete-/api/dataentities/customFieldValues/documents/-customFieldValueId-) + - `GET` [Search custom field values](https://developers.vtex.com/docs/api-reference/custom-fields-api#get-/api/dataentities/customFieldValues/search) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Add an account holder.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Add an account holder.yml new file mode 100644 index 0000000000..ca7d2d26a2 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Add an account holder.yml @@ -0,0 +1,100 @@ +info: + name: Add an account holder + type: http + seq: 13 + +http: + method: POST + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/holders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "claims": { + "email": "email@domain.com" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/holders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/holders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/holders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/holders - Schema is valid", function () { + const schema = {"required":["level","claims","id","createdAt"],"type":"object","properties":{"level":{"type":"number","description":"Holder hierarchy. The value `2` indicates that the holder is a dependent of the account's main holder."},"claims":{"required":["email"],"type":"object","description":"New holder information.","properties":{"email":{"type":"string","description":"Holder email."}}},"id":{"type":"string","description":"Holder identification."},"createdAt":{"type":"string","description":"Date of appointment of the holder."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a new account holder to the [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). This new user can share the account's credit limit with users already registered on the account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "level": 2, + "claims": { + "email": "holdertest@holder.com.br" + }, + "id": "054a67b342164018a0f291636c1669f1", + "createdAt": "2023-11-10T18:33:58.402627Z" + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Cancel a pre-authorization.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Cancel a pre-authorization.yml new file mode 100644 index 0000000000..bfa6ca57ba --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Cancel a pre-authorization.yml @@ -0,0 +1,63 @@ +info: + name: Cancel a pre-authorization + type: http + seq: 12 + +http: + method: DELETE + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: transactionId + value: B2E754DCD7304D22866CB6F221CF0FEB + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a pre-authorization created by the [Create a Pre-Authorization](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts/-creditAccountId-/transactions) endpoint. + + >⚠️ The pre-authorization can only be deleted by this endpoint if it was created with the `settled` field set to `false` previously. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Create Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `transactionId` | path | (Required) Pre-authorization identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Change credit limit of an account.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Change credit limit of an account.yml new file mode 100644 index 0000000000..ce9afdff5e --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Change credit limit of an account.yml @@ -0,0 +1,104 @@ +info: + name: Change credit limit of an account + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/creditlimit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "value": 5500 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/creditlimit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/creditlimit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/creditlimit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/creditlimit - Schema is valid", function () { + const schema = {"required":["id","balance","status","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"status":{"type":"string","description":"Credit customer account status."},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Increases or decreases the credit limit of a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Edit credits** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "balance": -15, + "status": "Open", + "creditLimit": 5500, + "updatedAt": "2023-11-22T19:35:40.0047136Z", + "createdAt": "2023-11-09T17:39:52.151897Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 5500, + "preAuthorizedCredit": 0, + "email": "test@test.com", + "tolerance": 0.3, + "availableBalance": 5500 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Change tolerance of an account.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Change tolerance of an account.yml new file mode 100644 index 0000000000..8a49d29783 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Change tolerance of an account.yml @@ -0,0 +1,104 @@ +info: + name: Change tolerance of an account + type: http + seq: 15 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/tolerance" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "value": 0.3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/tolerance - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/tolerance - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/tolerance - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/tolerance - Schema is valid", function () { + const schema = {"required":["id","balance","status","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"status":{"type":"string","description":"Credit customer account status."},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Modifies the credit tolerance amount to increase the credit limit on a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "balance": -15, + "status": "Open", + "creditLimit": 12500, + "updatedAt": "2023-11-10T18:49:50.8074778Z", + "createdAt": "2023-11-09T17:39:52.151897Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 12444.99, + "preAuthorizedCredit": 55.92, + "email": "test@test.com.br", + "tolerance": 0.3, + "availableBalance": 12444.99 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Close an account.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Close an account.yml new file mode 100644 index 0000000000..052fd7e61f --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Close an account.yml @@ -0,0 +1,108 @@ +info: + name: Close an account + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "document": "32222222222", + "documentType": "CPF", + "email": "email@domain.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId - Schema is valid", function () { + const schema = {"required":["id","balance","document","status","documentType","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"document":{"type":"string","description":"Account owner document."},"status":{"type":"string","description":"Credit customer account status."},"documentType":{"type":"string","description":"Document type.","enum":["CPF","CNPJ","Other"]},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Closes a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "32222222222_CPF", + "balance": 0, + "document": "32222222222", + "status": "Closed", + "documentType": "CPF", + "creditLimit": 500, + "updatedAt": "2023-11-09T14:36:09.0201326Z", + "createdAt": "2023-11-09T14:31:27.0775349Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 500, + "preAuthorizedCredit": 0, + "email": "test3@teste.com", + "tolerance": 1, + "availableBalance": 500 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Create a pre-authorization.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Create a pre-authorization.yml new file mode 100644 index 0000000000..62c9e794d0 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Create a pre-authorization.yml @@ -0,0 +1,103 @@ +info: + name: Create a pre-authorization + type: http + seq: 10 + +http: + method: POST + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "value": 49.7, + "settle": true, + "installments": 1, + "expirationDate": "2023-11-25" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions - Schema is valid", function () { + const schema = {"required":["id","value","installments"],"type":"object","properties":{"id":{"type":"string","description":"Pre-Authorization identification."},"value":{"type":"number","description":"Pre-Authorization value."},"expirationDate":{"type":"string","description":"Pre-Authorization expiration date."},"installments":{"type":"number","description":"Number of installments."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a Pre-Authorization. Also known as authorization hold, card authorization or pre-auth, pre-authorization is the practice of holding this balance as unavailable until either the merchant clears the transaction, also called settlement, or the hold *falls off*. + + This operation does not appear in statements, but the available balance will be updated. + + The result of this operation is generating a `transactionId` (pre-authorization identification) to use in a settlement. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Create Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5d96bcdf0fbc46e1866a05f721f31623", + "value": 49.7, + "expirationDate": "2023-11-25T00:00:00", + "installments": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Create or update settlement.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Create or update settlement.yml new file mode 100644 index 0000000000..99b7d929f0 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Create or update settlement.yml @@ -0,0 +1,102 @@ +info: + name: Create or update settlement + type: http + seq: 9 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/settlement" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: transactionId + value: B2E754DCD7304D22866CB6F221CF0FEB + type: path + body: + type: json + data: |- + { + "value": 49.95 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/settlement - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/settlement - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/settlement - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/settlement - Schema is valid", function () { + const schema = {"required":["value","id"],"type":"object","properties":{"value":{"type":"number","description":"Invoice value."},"id":{"type":"string","description":"Identification of the pre-authorization generated when creating the order. This number plus the information `-01` indicates the number of the invoice created."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates an invoice or update its value for an order placed in the store that used customer credit as a payment method. + + >ℹ️ If payment for the order is made in installments, you can create an invoice for each installment. The first invoice will be due in 30 days, and subsequent invoices will be due 30 days after the previous invoice. + + . + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Create Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `transactionId` | path | (Required) Pre-authorization identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": 49.95, + "id": "B2E754DCD7304D22866CB6F221CF0FEB" + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Decrease balance of an account.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Decrease balance of an account.yml new file mode 100644 index 0000000000..eef7feb222 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Decrease balance of an account.yml @@ -0,0 +1,95 @@ +info: + name: Decrease balance of an account + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/statements/:statementId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: statementId + value: 451924c579a6759cf6e112a + type: path + body: + type: json + data: |- + { + "value": "-15" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/statements/:statementId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/statements/:statementId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/statements/:statementId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/statements/:statementId - Schema is valid", function () { + const schema = {"required":["value"],"type":"object","properties":{"value":{"type":"string","description":"Value debited from the account balance."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a debit value updating the account balance. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Edit credits** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `statementId` | path | (Required) Statement identification. This is the same `transactionId` value obtained from the [Account statements](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-) endpoint response body. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + -15.0 + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Delete an account holder.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Delete an account holder.yml new file mode 100644 index 0000000000..937d533afd --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Delete an account holder.yml @@ -0,0 +1,91 @@ +info: + name: Delete an account holder + type: http + seq: 14 + +http: + method: DELETE + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/holders/:holderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: holderId + value: 524bc947d2b37a1a759ba3d174b58f9b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/holders/:holderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/holders/:holderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/holders/:holderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/holders/:holderId - Schema is valid", function () { + const schema = {"required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Identification of the holder deleted from the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an account holder from the [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `holderId` | path | (Required) Holder identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "054a67b342164018a0f291636c1669f1" + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Get account statements.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Get account statements.yml new file mode 100644 index 0000000000..fc2110ddb3 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Get account statements.yml @@ -0,0 +1,130 @@ +info: + name: Get account statements + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/statements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/statements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/statements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/statements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/statements - Schema is valid", function () { + const schema = {"required":["statements","currentBalance","intervalBalance","previousBalance"],"type":"object","properties":{"statements":{"type":"array","description":"Statements information.","items":{"required":["value","date","origin"],"type":"object","description":"Object with information about each statement.","properties":{"value":{"type":"number","description":"Operation value."},"date":{"type":"string","description":"Operation date."},"doneby":{"type":"string","description":"Email of the person responsible for the operation."},"origin":{"type":"string","description":"Operation origin.","enum":["Credit","Invoice","Payment","Statement"]},"metadata":{"type":"object","description":"Metadata information.","properties":{"transactionId":{"type":"string","description":"Transaction identification."},"numberOfInstallments":{"type":"number","description":"Number of installments."}}}}}},"currentBalance":{"type":"number","description":"Current balance value."},"intervalBalance":{"type":"number","description":"Interval balance. Indicates the balance between debits and credits made since the account was opened. Negative values ​​indicate that there were more debits than new credits in the account."},"previousBalance":{"type":"number","description":"Current balance value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU) statements. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Read Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "statements": [ + { + "value": -5.01, + "date": "2023-11-09T18:26:43.3361896Z", + "origin": "Invoice", + "metadata": { + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "numberOfInstallments": 1 + } + }, + { + "value": -15, + "date": "2023-11-09T18:48:32.1436064Z", + "doneBy": "ricardo.silva@vtex.com.br", + "origin": "Statement" + }, + { + "value": -500, + "date": "2023-11-09T19:38:04.3798157Z", + "origin": "Credit" + }, + { + "value": -200, + "date": "2023-11-09T19:40:08.9716204Z", + "origin": "Credit" + }, + { + "value": 200, + "date": "2023-11-09T19:40:14.5497445Z", + "origin": "Credit" + }, + { + "value": 5.01, + "date": "2023-11-17T19:33:32.6653898Z", + "origin": "Payment", + "metadata": { + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "installment": 1 + } + } + ], + "currentBalance": -15, + "intervalBalance": -1110.9, + "previousBalance": 0 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Open an account.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Open an account.yml new file mode 100644 index 0000000000..a3c15f29c5 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Open an account.yml @@ -0,0 +1,108 @@ +info: + name: Open an account + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/creditcontrol/accounts" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "document": "11111111111", + "documentType": "CPF", + "email": "test@test.com", + "creditLimit": "1100", + "description": "Not applicable.", + "tolerance": "0.2" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/creditcontrol/accounts - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/creditcontrol/accounts - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/creditcontrol/accounts - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/creditcontrol/accounts - Schema is valid", function () { + const schema = {"required":["id","balance","document","status","documentType","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"document":{"type":"string","description":"Account owner document."},"status":{"type":"string","description":"Credit customer account status."},"documentType":{"type":"string","description":"Document type. Possible values: `CPF`, `CNPJ` or `Other`."},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Opens a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU) on your store. + + >⚠️ This request should only be used if you do not have an account yet registered. If you already have an account (open or closed) and want to create or modify an account, go to [Update account information](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "11111111111_CPF", + "balance": 0, + "document": "11111111111", + "status": "Open", + "documentType": "CPF", + "creditLimit": 1100, + "updatedAt": "2023-11-09T13:29:01.2505088Z", + "createdAt": "2023-11-09T13:29:01.1567887Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 1100, + "preAuthorizedCredit": 0, + "email": "ricardo@teste.com.br", + "tolerance": 0.2, + "availableBalance": 1100 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Partially or totally refund a settlement.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Partially or totally refund a settlement.yml new file mode 100644 index 0000000000..72596fd290 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Partially or totally refund a settlement.yml @@ -0,0 +1,95 @@ +info: + name: Partially or totally refund a settlement + type: http + seq: 16 + +http: + method: POST + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/refunds" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: transactionId + value: B2E754DCD7304D22866CB6F221CF0FEB + type: path + body: + type: json + data: |- + { + "value": 30 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/refunds - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/refunds - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/refunds - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId/refunds - Schema is valid", function () { + const schema = {"required":["value"],"type":"object","properties":{"value":{"type":"number","description":"Refunded amount."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Refunds a value from an already settled transaction. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Create Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `transactionId` | path | (Required) Pre-authorization identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 30 + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Retrieve an account by ID.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Retrieve an account by ID.yml new file mode 100644 index 0000000000..2bc9ee5dd5 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Retrieve an account by ID.yml @@ -0,0 +1,100 @@ +info: + name: Retrieve an account by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId - Schema is valid", function () { + const schema = {"required":["id","balance","document","status","documentType","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"document":{"type":"string","description":"Account owner document."},"status":{"type":"string","description":"Credit customer account status."},"documentType":{"type":"string","description":"Document type. Possible values: `CPF`, `CNPJ` or `Other`."},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU) by the credit account identification. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Read Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "11111111111_CPF", + "balance": 0, + "document": "11111111111", + "status": "Open", + "documentType": "CPF", + "creditLimit": 1100, + "updatedAt": "2023-11-09T13:29:01.2505088Z", + "createdAt": "2023-11-09T13:29:01.1567887Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 1100, + "preAuthorizedCredit": 0, + "email": "ricardo@teste.com.br", + "tolerance": 0.2, + "availableBalance": 1100 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Search all accounts.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Search all accounts.yml new file mode 100644 index 0000000000..dac75f3e82 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Search all accounts.yml @@ -0,0 +1,197 @@ +info: + name: Search all accounts + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/accounts" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: from + value: "1" + type: query + disabled: true + - name: to + value: "40" + type: query + disabled: true + - name: status + value: Paid + type: query + disabled: true + - name: email + value: test@test.com + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/accounts - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/accounts - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/accounts - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/accounts - Schema is valid", function () { + const schema = {"required":["data","summary"],"type":"object","properties":{"data":{"type":"array","description":"Data information.","items":{"type":"object","description":"Object with information about each account.","required":["id","balance","document","status","documentType","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"document":{"type":"string","description":"Account owner document."},"status":{"type":"string","description":"Credit customer account status. This value will always come as `Open`. If an account is closed (`Closed`), it will not be displayed in the response body of this endpoint.","enum":["Open","Closed"]},"documentType":{"type":"string","description":"Document type.","enum":["CPF","CNPJ","Other"]},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}},"summary":{"required":["count"],"type":"object","description":"Summary information.","properties":{"count":{"type":"integer","description":"Number of customer credit accounts in the store."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of all [customer credit accounts](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU) in the store. + + >ℹ️ You can use the queries below (individually or combined) to obtain a more accurate search result. If your store has more than 20 customer credit accounts and you do not use any queries in the call, only the first 20 account records will appear in the response body. + + >ℹ️ Query params can be used individually or combined. + + ### Queries to filter results + + - **By the location of the accounts in the list (quantity of accounts)**: `?from={int}&to={int}` + - **By status**: `?status={Open, Closed or Cancelled}` + - **By email**: `?email={string}` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Read Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `from` | query | Indicates the starting position of the credit customer account to be searched in the account list. Example, value `1` indicates that the first account in the list will be returned. | + | `to` | query | Indicates the final position of the credit customer account to be searched in the account list. Example, if the value of `from` is equal to `1` and `to` is `40`, information from 40 accounts will be displayed in the response body of the request. | + | `status` | query | Indicates the status of the accounts to be searched for. | + | `email` | query | Indicates the email registered to the account to be searched. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "39f5f920-149f-11ha-b5b0-2vb896d3212f", + "balance": 0, + "document": "4354353453454", + "status": "Open", + "documentType": "CPF", + "creditLimit": 2000, + "updatedAt": "2020-01-02T15:26:40.3425717Z", + "createdAt": "2019-12-04T14:06:02.7905117Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 2000, + "preAuthorizedCredit": 0, + "email": "wtest@gmail.com", + "tolerance": 20, + "availableBalance": 2000 + }, + { + "id": "71d3f4e5-9164-11ea-918f-93b2a93cb9ba", + "balance": 0, + "document": "10120312", + "status": "Open", + "documentType": "CPF", + "creditLimit": 1, + "updatedAt": "2020-05-08T19:16:40.7202156Z", + "createdAt": "2020-05-08T19:16:40.5951631Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 1, + "preAuthorizedCredit": 0, + "email": "etest@yahoo.com", + "tolerance": 0, + "availableBalance": 1 + }, + { + "id": "111111111_CPF", + "balance": 0, + "document": "111111111", + "status": "Open", + "documentType": "CPF", + "creditLimit": 500, + "updatedAt": "2020-06-30T18:35:25.5793275Z", + "createdAt": "2020-06-30T18:35:25.5011788Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 500, + "preAuthorizedCredit": 0, + "email": "atest@test.com", + "tolerance": 1, + "availableBalance": 500 + }, + { + "id": "2222222222_CPF", + "balance": 0, + "document": "2222222222", + "status": "Open", + "documentType": "CPF", + "creditLimit": 100, + "updatedAt": "2020-07-07T21:08:07.1796362Z", + "createdAt": "2020-06-30T19:57:50.4832597Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 100, + "preAuthorizedCredit": 0, + "email": "dtest@hotmail.com", + "tolerance": 0, + "availableBalance": 100 + }, + { + "id": "91d1f2e5-8169-11ea-728f-53b2a03cb8bc", + "balance": 0, + "document": "0000000000", + "status": "Open", + "documentType": "CPF", + "creditLimit": 5000, + "updatedAt": "2020-07-28T18:50:46.7315579Z", + "createdAt": "2020-06-30T18:49:35.424369Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 5000, + "preAuthorizedCredit": 0, + "email": "test@test.com", + "tolerance": 0, + "availableBalance": 5000 + } + ], + "summary": { + "count": 5 + } + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Update a pre-authorization.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Update a pre-authorization.yml new file mode 100644 index 0000000000..d1e23cec40 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Update a pre-authorization.yml @@ -0,0 +1,107 @@ +info: + name: Update a pre-authorization + type: http + seq: 11 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: transactionId + value: B2E754DCD7304D22866CB6F221CF0FEB + type: path + body: + type: json + data: |- + { + "value": 55, + "settle": true, + "installments": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/transactions/:transactionId - Schema is valid", function () { + const schema = {"required":["id","value","installments"],"type":"object","properties":{"id":{"type":"string","description":"Pre-Authorization identification."},"value":{"type":"number","description":"Pre-Authorization value."},"installments":{"type":"number","description":"Number of installments."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information for a specific pre-authorization request. + + >⚠️ This call can only be used for pre-authorizations that have not yet been captured or canceled. + + Also known as authorization hold, card authorization or pre-auth, pre-authorization is the practice of holding this balance as unavailable until either the merchant clears the transaction, also called settlement, or the hold *falls off*. + + This operation does not appear in statements but the available balance will be updated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Statements | **Create Statements** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `transactionId` | path | (Required) Pre-authorization identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "d86454d23a624417b90af3876a31b981", + "value": 55, + "installments": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/Update account information.yml b/BrunoCollections/VTEX - Customer Credit API/Account/Update account information.yml new file mode 100644 index 0000000000..51b208367b --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/Update account information.yml @@ -0,0 +1,110 @@ +info: + name: Update account information + type: http + seq: 5 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + body: + type: json + data: |- + { + "email": "test1@test.com", + "document": "111111111111", + "documentType": "CPF", + "creditLimit": 3400, + "tolerance": 0.25 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId - Schema is valid", function () { + const schema = {"required":["id","balance","status","creditLimit","updatedAt","createdAt","availableCredit","preAuthorizedCredit","email","tolerance","availableBalance"],"type":"object","properties":{"id":{"type":"string","description":"Credit customer account identification."},"balance":{"type":"number","description":"Account balance value. If this number is negative, it means that the account has a debit instead of a credit to be used."},"document":{"type":"string","description":"Account owner document."},"status":{"type":"string","description":"Credit customer account status."},"documentType":{"type":"string","description":"Document type.","enum":["CPF","CNPJ","Other"]},"creditLimit":{"type":"number","description":"Maximum credit amount on the account."},"updatedAt":{"type":"string","description":"Date of the last update made to the account."},"createdAt":{"type":"string","description":"Account creation date."},"description":{"type":"string","description":"This field is deprecated."},"availableCredit":{"type":"number","description":"Credit amount available on the account."},"preAuthorizedCredit":{"type":"number","description":"Credit value that can only be used by the account owner after the merchant releases a specific purchase transaction."},"email":{"type":"string","description":"Account owner email."},"tolerance":{"type":"number","description":"Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount."},"availableBalance":{"type":"number","description":"Balance available for use on the account."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information on a [customer credit account](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Checking Accounts | **Create Checking Accounts** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "30c59e60-895f-11ee-917a-1117db360d00", + "balance": 0, + "document": "111111111111", + "status": "Open", + "documentType": "CPF", + "creditLimit": 3400, + "updatedAt": "2023-11-22T19:06:07.4014762Z", + "createdAt": "2023-11-22T17:47:22.9450309Z", + "description": "This field is deprecated and is returned as an empty string.", + "availableCredit": 3400, + "preAuthorizedCredit": 0, + "email": "test1@test.com", + "tolerance": 0.25, + "availableBalance": 3400 + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Account/folder.yml b/BrunoCollections/VTEX - Customer Credit API/Account/folder.yml new file mode 100644 index 0000000000..d95e67eb70 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Account/folder.yml @@ -0,0 +1,4 @@ +info: + name: Account + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Cancel invoice.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Cancel invoice.yml new file mode 100644 index 0000000000..f7e4d5435c --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Cancel invoice.yml @@ -0,0 +1,61 @@ +info: + name: Cancel invoice + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: invoiceId + value: A424887D0F2D45028FE5C96E9B0E1A2D-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the status of a specific invoice (`invoiceId`) to `Cancelled`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Create Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `invoiceId` | path | (Required) Invoice identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Change invoice.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Change invoice.yml new file mode 100644 index 0000000000..74172426be --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Change invoice.yml @@ -0,0 +1,74 @@ +info: + name: Change invoice + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: friendlyId + value: u8KFsGDk-1 + type: query + disabled: true + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: invoiceId + value: A424887D0F2D45028FE5C96E9B0E1A2D-01 + type: path + body: + type: json + data: |- + { + "status": "Paid", + "observation": "BF 2023 customer invoice.", + "paymentLink": "https://paymentlink.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates invoice's `status`, `observation` and `paymentLink` attributes. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Create Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `invoiceId` | path | (Required) Invoice identification. | + | `friendlyId` | query | Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Mark an invoice as paid.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Mark an invoice as paid.yml new file mode 100644 index 0000000000..8cc0bef28e --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Mark an invoice as paid.yml @@ -0,0 +1,107 @@ +info: + name: Mark an invoice as paid + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/payments" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: invoiceId + value: A424887D0F2D45028FE5C96E9B0E1A2D-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/payments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/payments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/payments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/payments - Schema is valid", function () { + const schema = {"required":["id","friendlyId","status","value","accountId","creditValue","createdAt","updatedAt","originalDueDate","dueDate","installment","orderId","transactionId","numberOfInstallments","creditAccountId"],"type":"object","properties":{"id":{"type":"string","description":"Invoice identification."},"friendlyId":{"type":"string","description":"Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment."},"status":{"type":"string","description":"Invoice status.","enum":["Opened","Paid","Cancelled"]},"value":{"type":"number","description":"Invoice value."},"accountId":{"type":"string","description":"Account identification. It is the same `checkingAccountId` parameter used in other Customer Credit API endpoints."},"creditValue":{"type":"number","description":"Credit value."},"createdAt":{"type":"string","description":"Invoice creation date."},"updatedAt":{"type":"string","description":"Date of the last update made to the invoice."},"originalDueDate":{"type":"string","description":"Original invoice expiration date."},"dueDate":{"type":"string","description":"Modified invoice expiration date."},"installment":{"type":"number","description":"Identification of installment number."},"orderId":{"type":"string","description":"Identification of the order that generated the invoice."},"transactionId":{"type":"string","description":"Identification of the invoice transaction. This is the same number as the `id` field, removing the last three characters."},"numberOfInstallments":{"type":"number","description":"Number of installments."},"creditAccountId":{"type":"string","description":"Credit account identification. It is the same `accountId` parameter used in other Customer Credit API endpoints."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Records the payment of an invoice. + + This operation causes a balance restore with the invoice value to the checking account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Pay Invoice** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `invoiceId` | path | (Required) Invoice identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "A424887D0F2D45028FE5C96E9B0E1A2D-01", + "friendlyId": "u8KFsGDk-1", + "status": "Paid", + "value": 5.01, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-09T18:26:43.2112234Z", + "updatedAt": "2023-11-09T18:26:43.289316Z", + "originalDueDate": "2023-12-09T18:26:43.2112234Z", + "dueDate": "2023-12-09T18:26:43.2112234Z", + "installment": 1, + "orderId": "1375060513100-01", + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Postpone an invoice.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Postpone an invoice.yml new file mode 100644 index 0000000000..96686a9188 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Postpone an invoice.yml @@ -0,0 +1,71 @@ +info: + name: Postpone an invoice + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/postponement" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: invoiceId + value: A424887D0F2D45028FE5C96E9B0E1A2D-01 + type: path + body: + type: json + data: |- + { + "dueDays": 10 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId/postponement - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Postpones an invoice by the amount of time defined on the `dueDays` field (number of days for the invoice to be postponed by). + + This operation updates the invoice field `dueDate`. + + >⚠️ Before making this request, access the endpoint [Retrieve store configuration](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/storeconfig) to check whether the option to postpone invoice is enabled in the store (`invoicePostponementLimit: value greater than 0` and `postponementEnabled: true`). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Create Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `invoiceId` | path | (Required) Invoice identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoice by ID.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoice by ID.yml new file mode 100644 index 0000000000..1a361745d5 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoice by ID.yml @@ -0,0 +1,105 @@ +info: + name: Retrieve invoice by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + - name: invoiceId + value: A424887D0F2D45028FE5C96E9B0E1A2D-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices/:invoiceId - Schema is valid", function () { + const schema = {"required":["id","friendlyId","status","value","accountId","creditValue","createdAt","updatedAt","originalDueDate","dueDate","installment","orderId","transactionId","numberOfInstallments","creditAccountId"],"type":"object","properties":{"id":{"type":"string","description":"Invoice identification."},"friendlyId":{"type":"string","description":"Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment."},"status":{"type":"string","description":"Invoice status.","enum":["Opened","Paid","Cancelled"]},"value":{"type":"number","description":"Invoice value."},"accountId":{"type":"string","description":"Account identification. It is the same `checkingAccountId` parameter used in other Customer Credit API endpoints."},"creditValue":{"type":"number","description":"Credit value."},"createdAt":{"type":"string","description":"Invoice creation date."},"updatedAt":{"type":"string","description":"Date of the last update made to the invoice."},"originalDueDate":{"type":"string","description":"Original invoice expiration date."},"dueDate":{"type":"string","description":"Modified invoice expiration date."},"installment":{"type":"number","description":"Identification of installment number."},"orderId":{"type":"string","description":"Identification of the order that generated the invoice."},"transactionId":{"type":"string","description":"Identification of the invoice transaction. This is the same number as the `id` field, removing the last three characters."},"numberOfInstallments":{"type":"number","description":"Number of installments."},"creditAccountId":{"type":"string","description":"Credit account identification. It is the same `accountId` parameter used in other Customer Credit API endpoints."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns data from a specific invoice using `invoiceId`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Read Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `invoiceId` | path | (Required) Invoice identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "A424887D0F2D45028FE5C96E9B0E1A2D-01", + "friendlyId": "u8KFsGDk-1", + "status": "Opened", + "value": 50.01, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-09T18:26:43.2112234Z", + "updatedAt": "2023-11-09T18:26:43.289316Z", + "originalDueDate": "2023-12-09T18:26:43.2112234Z", + "dueDate": "2023-12-09T18:26:43.2112234Z", + "installment": 1, + "orderId": "1375060513100-01", + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoices by Customer Credit account ID.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoices by Customer Credit account ID.yml new file mode 100644 index 0000000000..81effd4a66 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Retrieve invoices by Customer Credit account ID.yml @@ -0,0 +1,128 @@ +info: + name: Retrieve invoices by Customer Credit account ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/accounts/:creditAccountId/invoices" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/accounts/:creditAccountId/invoices - Schema is valid", function () { + const schema = {"required":["data","summary"],"type":"object","properties":{"data":{"type":"array","description":"Data information.","items":{"required":["id","friendlyId","status","value","accountId","creditValue","createdAt","updatedAt","originalDueDate","dueDate","installment","orderId","transactionId","numberOfInstallments","creditAccountId"],"type":"object","description":"Object with information about each invoice.","properties":{"id":{"type":"string","description":"Invoice identification."},"friendlyId":{"type":"string","description":"Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment."},"status":{"type":"string","description":"Invoice status.","enum":["Opened","Paid","Cancelled"]},"value":{"type":"number","description":"Invoice value."},"accountId":{"type":"string","description":"Account identification. It is the same `checkingAccountId` parameter used in other Customer Credit API endpoints."},"creditValue":{"type":"number","description":"Credit value."},"createdAt":{"type":"string","description":"Invoice creation date."},"updatedAt":{"type":"string","description":"Date of the last update made to the invoice."},"originalDueDate":{"type":"string","description":"Original invoice expiration date."},"dueDate":{"type":"string","description":"Modified invoice expiration date."},"installment":{"type":"number","description":"Identification of installment number."},"orderId":{"type":"string","description":"Identification of the order that generated the invoice."},"transactionId":{"type":"string","description":"Identification of the invoice transaction. This is the same number as the `id` field, removing the last three characters."},"numberOfInstallments":{"type":"number","description":"Number of installments."},"creditAccountId":{"type":"string","description":"Credit account identification. It is the same `accountId` parameter used in other Customer Credit API endpoints."}}}},"summary":{"required":["total","count"],"type":"object","description":"Summary information.","properties":{"total":{"type":"number","description":"Total amount payable (sum of invoices listed with status `Open`)."},"count":{"type":"integer","description":"Number of invoices listed."},"totalPaid":{"type":"integer","description":"Total amount paid (sum of invoices listed with status `Paid`)."},"totalCancelled":{"type":"integer","description":"Total amount canceled (sum of invoices listed with status `Cancelled`)."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns associated invoices given a specific `creditAccountId`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Read Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `creditAccountId` | path | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "A424887D0F2D45028FE5C96E9B0E1A2D-01", + "friendlyId": "u8KFsGDk-1", + "status": "Opened", + "value": 5.01, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-09T18:26:43.2112234Z", + "updatedAt": "2023-11-09T18:26:43.289316Z", + "originalDueDate": "2023-12-09T18:26:43.2112234Z", + "dueDate": "2023-12-09T18:26:43.2112234Z", + "installment": 1, + "orderId": "1375060513100-01", + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + }, + { + "id": "742F1758D81F4E93BC2A3F8A382D44A8-01", + "friendlyId": "8UfrLSCc-1", + "status": "Opened", + "value": 0.91, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-10T19:46:50.551354Z", + "updatedAt": "2023-11-10T19:46:50.6295313Z", + "originalDueDate": "2023-12-10T19:46:50.551354Z", + "dueDate": "2023-12-10T19:46:50.551354Z", + "installment": 1, + "orderId": "1375070513102-01", + "transactionId": "742F1758D81F4E93BC2A3F8A382D44A8", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + } + ], + "summary": { + "total": 5.92, + "count": 2, + "totalPaid": 0, + "totalCancelled": 0 + } + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/Search all invoices.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/Search all invoices.yml new file mode 100644 index 0000000000..46460c4134 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/Search all invoices.yml @@ -0,0 +1,222 @@ +info: + name: Search all invoices + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/invoices?creditAccountId=01bce461-9g03-12ds-8217-b3d39271e15b" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: from + value: "1" + type: query + disabled: true + - name: to + value: "300" + type: query + disabled: true + - name: createdDateFrom + value: 2023-01-20 + type: query + disabled: true + - name: createdDateTo + value: 2023-01-25 + type: query + disabled: true + - name: dueDateFrom + value: 2023-01-20 + type: query + disabled: true + - name: dueDateTo + value: 2023-01-25 + type: query + disabled: true + - name: value + value: "101.22" + type: query + disabled: true + - name: status + value: Paid + type: query + disabled: true + - name: friendlyId + value: u8KFsGDk-1 + type: query + disabled: true + - name: observation + value: Some observation about the invoice + type: query + disabled: true + - name: creditAccountId + value: 01bce461-9g03-12ds-8217-b3d39271e15b + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/invoices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/invoices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/invoices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/invoices - Schema is valid", function () { + const schema = {"required":["data","summary"],"type":"object","properties":{"data":{"type":"array","description":"Data information.","items":{"required":["id","friendlyId","status","value","accountId","creditValue","createdAt","updatedAt","originalDueDate","dueDate","installment","orderId","transactionId","numberOfInstallments","creditAccountId"],"type":"object","description":"Object with information about each invoice.","properties":{"id":{"type":"string","description":"Invoice identification."},"friendlyId":{"type":"string","description":"Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment."},"status":{"type":"string","description":"Invoice status.","enum":["Opened","Paid","Cancelled"]},"value":{"type":"number","description":"Invoice value."},"accountId":{"type":"string","description":"Account identification. It is the same `creditAccountId` parameter used in other Customer Credit API endpoints."},"creditValue":{"type":"number","description":"Credit value."},"createdAt":{"type":"string","description":"Invoice creation date."},"resolvedAt":{"type":["string","null"],"description":"Invoice closing date."},"updatedAt":{"type":"string","description":"Date of the last update made to the invoice."},"paymentLink":{"type":["string","null"],"description":"Link (URL) created to direct the customer to an invoice payment environment (optional)."},"originalDueDate":{"type":"string","description":"Original invoice expiration date."},"dueDate":{"type":"string","description":"Modified invoice expiration date."},"installment":{"type":"number","description":"Identification of installment number."},"orderId":{"type":"string","description":"Identification of the order that generated the invoice."},"observation":{"type":["string","null"],"description":"Observation notes about the invoice."},"transactionId":{"type":"string","description":"Identification of the invoice transaction. This is the same number as the `id` field, removing the last three characters."},"numberOfInstallments":{"type":"number","description":"Number of installments."},"creditAccountId":{"type":"string","description":"Credit account identification. It is the same `accountId` parameter used in other Customer Credit API endpoints."}}}},"summary":{"required":["total","count"],"type":"object","description":"Summary information.","properties":{"total":{"type":"number","description":"Total amount payable (sum of invoices listed with status `Open`)."},"count":{"type":"integer","description":"Number of invoices listed."},"totalPaid":{"type":"number","description":"Total amount paid (sum of invoices listed with status `Paid`)."},"totalCancelled":{"type":"number","description":"Total amount canceled (sum of invoices listed with status `Cancelled`)."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of invoices related to payment orders created through [customer credit accounts](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + >ℹ️ Query parameters can be used individually or combined to filter invoice results. + + ### Queries to filter results + + - **By the location of the invoices in the list (quantity of invoices)**: `?from={int}&to={int}` + - **By creation date**: `?createdDateFrom={dateISO8601}&createDateTo={dateISO8601}`. The dates should be in ISO8601 format. + - **By due date**: `?dueDateFrom={dateISO8601}&dueDateTo={dateISO8601}`. The dates should be in ISO8601 format. + - **By value**: `?value={decimal}` + - **By status**: `?status={string}` + - **By Id**: `?friendlyId={string}` + - **By observation**: `?observation={string}` + - **By creditAccountId**: `?creditAccountId={creditAcountId}` + + ### Combining filters + + You can use the `op` query parameter to specify if filters will be evaluated as `AND` or `OR` for the query. The default behavior when there is more than one query parameter is `AND`. + + Example: + + For the query `?value=100&status=Paid`, the criteria will build **value = 100 AND status = Paid**. + + For the same query, adding the `op` parameter (`?value=100&status=Paid&op=or`), the criteria will build **value = 100 OR status = Paid**. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Invoices | **Read Invoices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `from` | query | Indicates the starting position of the invoice to be searched in the invoice list. For example, the value `1` indicates that the first invoice in the list will be returned. | + | `to` | query | Indicates the final position of the invoice to be searched in the invoice list. For example, if the value of `from` is equal to `1` and `to` is `300`, information from 300 invoices will be displayed in the response body of the request. | + | `createdDateFrom` | query | Indicates the initial creation date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format. | + | `createdDateTo` | query | Indicates the final creation date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format. | + | `dueDateFrom` | query | Indicates the initial due date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format. | + | `dueDateTo` | query | Indicates the final due date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format. | + | `value` | query | Indicates the value of the invoices to be searched for. It must be completed with a decimal value. | + | `status` | query | Indicates the status of the invoices to be searched for. | + | `friendlyId` | query | Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment. | + | `observation` | query | Observation notes about the invoice. | + | `creditAccountId` | query | (Required) Credit account identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "A424887D0F2D45028FE5C96E9B0E1A2D-01", + "friendlyId": "u8KFsGDk-1", + "status": "Paid", + "value": 5.01, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-09T18:26:43.2112234Z", + "resolvedAt": "2023-11-13T19:12:17.2778233Z", + "updatedAt": "2023-11-13T19:12:17.3403115Z", + "paymentLink": "https://www.teste.com.br", + "originalDueDate": "2023-12-09T18:26:43.2112234Z", + "dueDate": "2023-12-09T18:26:43.2112234Z", + "installment": 1, + "orderId": "1375060513100-01", + "observation": "Open test", + "transactionId": "A424887D0F2D45028FE5C96E9B0E1A2D", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + }, + { + "id": "742F1758D81F4E93BC2A3F8A382D44A8-01", + "friendlyId": "8UfrLSCc-1", + "status": "Opened", + "value": 0.91, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-10T19:46:50.551354Z", + "updatedAt": "2023-11-14T12:07:21.9823956Z", + "originalDueDate": "2023-12-10T19:46:50.551354Z", + "dueDate": "2023-12-18T19:46:50.551354Z", + "installment": 1, + "orderId": "1375070513102-01", + "transactionId": "742F1758D81F4E93BC2A3F8A382D44A8", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + }, + { + "id": "742235D7E5E840798EC28A02EBA9E855-01", + "friendlyId": "mvOEfmdk-1", + "status": "Cancelled", + "value": 1.21, + "accountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b", + "creditValue": 0, + "createdAt": "2023-11-13T18:05:39.1334296Z", + "resolvedAt": "2023-11-13T19:25:22.1919688Z", + "updatedAt": "2023-11-13T19:25:22.3326219Z", + "originalDueDate": "2023-12-13T18:05:39.1334296Z", + "dueDate": "2023-12-13T18:05:39.1334296Z", + "installment": 1, + "orderId": "1376020513104-01", + "transactionId": "742235D7E5E840798EC28A02EBA9E855", + "numberOfInstallments": 1, + "creditAccountId": "fcba59e0-7f26-11ee-ba3c-511336e1518b" + } + ], + "summary": { + "total": 0.91, + "count": 3, + "totalPaid": 5.01, + "totalCancelled": 1.21 + } + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Invoices/folder.yml b/BrunoCollections/VTEX - Customer Credit API/Invoices/folder.yml new file mode 100644 index 0000000000..80a88c2aa4 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Invoices/folder.yml @@ -0,0 +1,4 @@ +info: + name: Invoices + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Create or change store configuration.yml b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Create or change store configuration.yml new file mode 100644 index 0000000000..34d3c7dbd1 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Create or change store configuration.yml @@ -0,0 +1,150 @@ +info: + name: Create or change store configuration + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/creditcontrol/storeconfig" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "dailyInterestRate": 0.01, + "invoicePostponementLimit": 2, + "taxRate": 0.4, + "maxPostponementDays": 3, + "defaultCreditValue": 150, + "maxPreAuthorizationGrowthRate": 0.1, + "myCreditsEnabled": true, + "toleranceEnabled": true, + "automaticCheckingAccountCreationEnabled": true, + "postponementEnabled": true, + "notificationsSettings": { + "daysPrior": [ + { + "days": 1, + "timeOfDay": "16:00:00" + }, + { + "days": 1, + "timeOfDay": "16:00:00" + } + ], + "daysAfter": [ + { + "days": 0, + "timeOfDay": "12:00:00" + }, + { + "days": 0, + "timeOfDay": "12:00:00" + } + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/creditcontrol/storeconfig - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/creditcontrol/storeconfig - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/creditcontrol/storeconfig - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/creditcontrol/storeconfig - Schema is valid", function () { + const schema = {"required":["dailyInterestRate","invoicePostponementLimit","taxRate","maxPostponementDays","defaultCreditValue","postponementEnabled","automaticCheckingAccountCreationEnabled","toleranceEnabled","myCreditsEnabled","maxPreAuthorizationGrowthRate"],"type":"object","properties":{"dailyInterestRate":{"type":"number","description":"Daily interest rate (percent 0.1 = 10%)."},"invoicePostponementLimit":{"type":"number","description":"Maximum number of postponements allowed."},"taxRate":{"type":"number","description":"Tax rate value (percent 0.1 = 10%)."},"maxPostponementDays":{"type":"number","description":"Maximum number of days of postponement."},"defaultCreditValue":{"type":"number","description":"Default credit amount."},"postponementEnabled":{"type":"boolean","description":"Postponement option activated.","default":false},"automaticCheckingAccountCreationEnabled":{"type":"boolean","description":"Allows users who have not previously received credit to complete an order.","default":false},"toleranceEnabled":{"type":"boolean","description":"Allows orders to be placed even if they exceed X % of the account's credit limit.","default":false},"myCreditsEnabled":{"type":"boolean","description":"Show the [My Credits](https://help.vtex.com/en/tutorial/customer-credit-overview--1uIqTjWxIIIEW0COMg4uE0#my-credits) page on storefront.","default":false},"maxPreAuthorizationGrowthRate":{"type":"number","description":"Pre-authorization growth rate value (percent 0.1 = 10%)."},"notificationsSettings":{"type":"object","description":"Notification settings information.","properties":{"daysPrior":{"type":"array","description":"Notification information sent before invoice payment date.","items":{"required":["days","timeOfDay"],"type":"object","description":"Object with information about the moment when the notification is sent.","properties":{"days":{"type":"integer","description":"How many days before the invoice payment date is the notification sent."},"timeOfDay":{"type":"string","description":"Notification sending time."}}}},"daysAfter":{"type":"array","description":"Notification information sent after invoice payment date.","items":{"required":["days","timeOfDay"],"type":"object","description":"Object with information about the moment when the notification is sent.","properties":{"days":{"type":"integer","description":"How many days after the invoice payment date is the notification sent."},"timeOfDay":{"type":"string","description":"Notification sending time."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or changes store configuration data related to [customer credit accounts](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Store Configuration | **Edit Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "dailyInterestRate": 0.01, + "invoicePostponementLimit": 2, + "taxRate": 0.4, + "maxPostponementDays": 3, + "defaultCreditValue": 150, + "postponementEnabled": false, + "automaticCheckingAccountCreationEnabled": false, + "toleranceEnabled": false, + "myCreditsEnabled": false, + "maxPreAuthorizationGrowthRate": 0.1, + "notificationsSettings": { + "daysPrior": [ + { + "days": 5, + "timeOfDay": "12:00:00" + }, + { + "days": 1, + "timeOfDay": "12:00:00" + }, + { + "days": 0, + "timeOfDay": "12:00:00" + } + ], + "daysAfter": [ + { + "days": 3, + "timeOfDay": "12:00:00" + } + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Retrieve store configuration.yml b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Retrieve store configuration.yml new file mode 100644 index 0000000000..d61d2ae898 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/Retrieve store configuration.yml @@ -0,0 +1,113 @@ +info: + name: Retrieve store configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/creditcontrol/storeconfig" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/creditcontrol/storeconfig - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/creditcontrol/storeconfig - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/creditcontrol/storeconfig - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/creditcontrol/storeconfig - Schema is valid", function () { + const schema = {"required":["dailyInterestRate","invoicePostponementLimit","taxRate","maxPostponementDays","defaultCreditValue","postponementEnabled","automaticCheckingAccountCreationEnabled","toleranceEnabled","myCreditsEnabled","maxPreAuthorizationGrowthRate"],"type":"object","properties":{"dailyInterestRate":{"type":"number","description":"Daily interest rate (percent 0.1 = 10%)."},"invoicePostponementLimit":{"type":"number","description":"Maximum number of postponements allowed."},"taxRate":{"type":"number","description":"Tax rate value (percent 0.1 = 10%)."},"maxPostponementDays":{"type":"number","description":"Maximum number of days of postponement."},"defaultCreditValue":{"type":"number","description":"Default credit amount."},"postponementEnabled":{"type":"boolean","description":"Postponement option activated.","default":false},"automaticCheckingAccountCreationEnabled":{"type":"boolean","description":"Allows users who have not previously received credit to complete an order.","default":false},"toleranceEnabled":{"type":"boolean","description":"Allows orders to be placed even if they exceed X % of the account's credit limit.","default":false},"myCreditsEnabled":{"type":"boolean","description":"Show the [My Credits](https://help.vtex.com/en/tutorial/customer-credit-overview--1uIqTjWxIIIEW0COMg4uE0#my-credits) page on storefront.","default":false},"maxPreAuthorizationGrowthRate":{"type":"number","description":"Pre-authorization growth-rate value (percent 0.1 = 10%)."},"notificationsSettings":{"type":"object","description":"Notification settings information.","properties":{"daysPrior":{"type":"array","description":"Notification information sent before invoice payment date.","items":{"required":["days","timeOfDay"],"type":"object","description":"Object with information about the moment when the notification is sent.","properties":{"days":{"type":"integer","description":"How many days before the invoice payment date is the notification sent."},"timeOfDay":{"type":"string","description":"Notification sending time."}}}},"daysAfter":{"type":"array","description":"Notification information sent after invoice payment date.","items":{"required":["days","timeOfDay"],"type":"object","description":"Object with information about the moment when the notification is sent.","properties":{"days":{"type":"integer","description":"How many days after the invoice payment date is the notification sent."},"timeOfDay":{"type":"string","description":"Notification sending time."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets store configuration data related to [customer credit accounts](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/7FHLd0cmxqqGeEUuc8uioU). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Credit Control | Main | **Main Access** | + | Credit Control | Store Configuration | **Read Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "dailyInterestRate": 0, + "invoicePostponementLimit": 0, + "taxRate": 0, + "maxPostponementDays": 0, + "defaultCreditValue": 2000, + "postponementEnabled": false, + "automaticCheckingAccountCreationEnabled": false, + "toleranceEnabled": false, + "myCreditsEnabled": false, + "maxPreAuthorizationGrowthRate": 0, + "notificationsSettings": { + "daysPrior": [ + { + "days": 5, + "timeOfDay": "12:00:00" + }, + { + "days": 1, + "timeOfDay": "12:00:00" + }, + { + "days": 0, + "timeOfDay": "12:00:00" + } + ], + "daysAfter": [ + { + "days": 3, + "timeOfDay": "12:00:00" + } + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Customer Credit API/Store Configuration/folder.yml b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/folder.yml new file mode 100644 index 0000000000..22ccebf889 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/Store Configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Store Configuration + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Customer Credit API/environments/VTEX.yml b/BrunoCollections/VTEX - Customer Credit API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Customer Credit API/opencollection.yml b/BrunoCollections/VTEX - Customer Credit API/opencollection.yml new file mode 100644 index 0000000000..8ca603171d --- /dev/null +++ b/BrunoCollections/VTEX - Customer Credit API/opencollection.yml @@ -0,0 +1,69 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Customer Credit API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + With Customer Credit your store can enable **credit payments** through the checkout. You can also control **invoices** and the **credit limits** of your clients. + + Learn more about Customer Credit in our [Help Center article](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/36grlQ69NK6OCuioeekyCs). + + Additionally, you can find more information on installment payments for an order in the `customData` field found in the [Get Order](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders/-orderId-) endpoint of the Orders API. This includes the number of installments, amount and due dates. + + All requests need an authorization header. This API allows two kinds of authorization: + + 1. Authorization header containing the VTEX ID authentication token. + 2. VTEX Appkey and Apptoken headers. + + Read [Authentication](https://developers.vtex.com/docs/guides/authentication) for more information about authentication options. + + ## Customer Credit API Index + + ### Invoices + + - `GET` [Search all invoices](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/invoices) + - `GET` [Retrieve Invoice by Id](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-/invoices/-invoiceId-) + - `PUT` [Change Invoice](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/invoices/-invoiceId-) + - `DELETE` [Cancel Invoice](https://developers.vtex.com/docs/api-reference/customer-credit-api#delete-/api/creditcontrol/accounts/-creditAccountId-/invoices/-invoiceId-) + - `GET` [Retrieve invoices by Customer Credit account ID](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-/invoices) + - `POST` [Mark an invoice as Paid](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts/-creditAccountId-/invoices/-invoiceId-/payments) + - `PUT` [Postpone an invoice](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/invoices/-invoiceId-/postponement) + + ### Account + + - `GET` [Search all accounts](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts) + - `POST` [Open an account](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts) + - `GET` [Retrieve an account by Id](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-) + - `DELETE` [Close an account](https://developers.vtex.com/docs/api-reference/customer-credit-api#delete-/api/creditcontrol/accounts/-creditAccountId-) + - `PUT` [Update account information](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-) + - `GET` [Account statements](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-/statements) + - `PUT` [Change credit limit of an account](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/creditlimit) + - `PUT` [Decrease balance of an account](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/statements/-statementId-) + - `PUT` [Create or Update Settlement](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/transactions/-transactionId-/settlement) + - `POST` [Create a Pre-Authorization](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts/-creditAccountId-/transactions) + - `PUT` [Update a Pre-Authorization](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/transactions/-transactionId-) + - `DELETE` [Cancel a Pre-Authorization](https://developers.vtex.com/docs/api-reference/customer-credit-api#delete-/api/creditcontrol/accounts/-creditAccountId-/transactions/-transactionId-) + - `POST` [Add an account Holder](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts/-creditAccountId-/holders) + - `DELETE` [Delete an account holder](https://developers.vtex.com/docs/api-reference/customer-credit-api#delete-/api/creditcontrol/accounts/-creditAccountId-/holders/-holderId-) + - `PUT` [Change tolerance of an account](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/accounts/-creditAccountId-/tolerance) + - `POST` [Partial or Total Refund a Settlement](https://developers.vtex.com/docs/api-reference/customer-credit-api#post-/api/creditcontrol/accounts/-creditAccountId-/transactions/-transactionId-/refunds) + + ### Store Configuration + + - `GET` [Retrieve store configuration](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/storeconfig) + - `PUT` [Create or change store configuration](https://developers.vtex.com/docs/api-reference/customer-credit-api#put-/api/creditcontrol/storeconfig) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/Erase customer data.yml b/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/Erase customer data.yml new file mode 100644 index 0000000000..419c76b6c6 --- /dev/null +++ b/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/Erase customer data.yml @@ -0,0 +1,132 @@ +info: + name: Erase customer data + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/user-rights/createAndProcessDeleteUserData" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: mystore + type: query + disabled: true + body: + type: json + data: |- + { + "email": "john@mail.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Schema is valid", function () { + const schema = {"type":"object","properties":{"uuid":{"type":"string","description":"User data rights request unique identifier in [UUID](https://www.uuidtools.com/what-is-uuid) format."},"requestType":{"type":"string","description":"Type of user data rights request."},"email":{"type":"string","description":"Client email."},"status":{"type":"string","description":"Status of the user data rights request."},"dataResponse":{"type":"string","description":"Escaped JSON containing information about the status of data deletion on each VTEX system that stores client data."},"requestTime":{"type":"string","description":"Date of the user data rights request in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)format."},"applications":{"type":"array","description":"Array containing an object for each VTEX application that stores client data.","items":{"type":"object","description":"Object containing information about user data status in each VTEX application that stores client data.","properties":{"application":{"type":"string","description":"Abbreviated name of the application, which can be `chk` (Checkout), `orders` (Order Management System), `profileSystemV2` (PII Profile System) or `vid` (VTEX ID)."},"status":{"type":"string","description":"Status of client data in the given application. The possible values are:\n\r- `Completed` - Processing completed successfully.\n\r- `Error` - An unexpected error occurred during the process. You must make a new request.\n\r- `PendingCheck` - Pending validation. Unable to perform validation on one or more services.\n\r- `Blocked` - Pending validation. One or more services are unable to fulfill the deletion request. You need to wait and make a new request in the future.\n\r- `PendingDeletion` - It was not possible to delete data in one or more services. You must make a new request."},"errorDetail":{"type":"string","description":"In case of error, this field contains an explanatory error message. Otherwise, this field is an empty string."},"updateAt":{"type":"string","description":"Date of the latest update in client data in the given application, in UTC format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a given customer's data collected in your store by Checkout, Orders, VTEX ID and Profile System. + + > Only orders with `invoiced` or `canceled` status are erased in this request. + + >❗ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + >⚠️ This endpoint is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | User Rights | user-rights-request | **Write user rights requests** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "uuid": "3e2f53dc-b099-4dc8-9727-581b2a97f39c", + "requestType": "Removal", + "email": "pedido2@vtexchallenge.com", + "status": "Completed", + "dataResponse": "{\r\n \"VTEX Checkout\": [],\r\n \"orders\": {\r\n \"dataStatus\": {\r\n \"status\": \"anonymized\",\r\n \"reason\": \"Sensitive information was anonymized rather than deleted to preserve the store metrics.\",\r\n \"evidence\": \"Anonymized [0] orders\",\r\n \"dryRun\": true\r\n },\r\n \"orders\": []\r\n },\r\n \"Profile System PII API\": {},\r\n \"VTEX ID\": {\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.4\",\r\n \"title\": \"Not Found\",\r\n \"status\": 404,\r\n \"traceId\": \"00-65d5abf9263b07eb185beee49e2075dc-b67b373e2e93dcf8-00\"\r\n }\r\n}", + "requestTime": "2023-09-05T17:19:33.1969022-03:00", + "applications": [ + { + "application": "chk", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:23" + }, + { + "application": "orders", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:25" + }, + { + "application": "profileSystemV2", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:26" + }, + { + "application": "vid", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:29" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/folder.yml b/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/folder.yml new file mode 100644 index 0000000000..6859224839 --- /dev/null +++ b/BrunoCollections/VTEX - Data Subject Rights/Data Subject Rights/folder.yml @@ -0,0 +1,4 @@ +info: + name: Data Subject Rights + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Data Subject Rights/environments/VTEX.yml b/BrunoCollections/VTEX - Data Subject Rights/environments/VTEX.yml new file mode 100644 index 0000000000..05d498023d --- /dev/null +++ b/BrunoCollections/VTEX - Data Subject Rights/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: http://api.vtex.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Data Subject Rights/opencollection.yml b/BrunoCollections/VTEX - Data Subject Rights/opencollection.yml new file mode 100644 index 0000000000..ce1a236004 --- /dev/null +++ b/BrunoCollections/VTEX - Data Subject Rights/opencollection.yml @@ -0,0 +1,30 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Data Subject Rights + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >❗ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + >⚠️ The **Data Subject Rights API - PII data architecture** is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + According to data protection policies, such as [GDPR and LGPD](https://vtex.com/us-en/privacy-and-agreements/vtex-commitment/), companies using customer personal data are required to delete collected information upon the customer's request. + + Data Subject Rights API allows stores using the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus) to erase user data collected by Checkout, Orders, VTEX ID and Profile System, without depending on the VTEX Support flow described in the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Default Values API/Default values/Create default values.yml b/BrunoCollections/VTEX - Default Values API/Default values/Create default values.yml new file mode 100644 index 0000000000..42dcc4a429 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/Default values/Create default values.yml @@ -0,0 +1,125 @@ +info: + name: Create default values + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/defaultValues/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "a6d958c2-25ba-4f4d-9a0a-6b56e458426c", + "defaultValues": [ + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "4498bd3d-7eaf-11f0-b37f-cc2298c87c12" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "7852aef0-7eb3-11f0-b37f-bfdc92dec2f6" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "9952aef0-7eb3-11f0-b37f-bfdc92dec2e6" + }, + { + "entity": "creditCard", + "entityValueId": "EDE0B17747B24EFC9650B6C6B3E06C5F" + }, + { + "entity": "address/billing", + "entityValueId": "747b9bed-d6f4-4cf5-b9d1-4944f9825470" + }, + { + "entity": "address/shipping", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da72d" + }, + { + "entity": "customFieldValues/{{customFieldId}}/{{auxId}}", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da723" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/defaultValues/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/defaultValues/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/defaultValues/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/defaultValues/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing document information.","properties":{"Id":{"type":"string","description":"Unique identifier of the created document."},"Href":{"type":"string","description":"Direct link to the created document."},"DocumentId":{"type":"string","description":"The document ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a document with a set of default values for a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "c90354e8-08d6-11f0-b37f-daebda928cfa", + "Href": "http://store.myvtex.com/api/dataentities/defaultValues/documents/c90354e8-08d6-11f0-b37f-daebda928cfa", + "DocumentId": "c90354e8-08d6-11f0-b37f-daebda928cfa" + } + ``` diff --git a/BrunoCollections/VTEX - Default Values API/Default values/Delete default values.yml b/BrunoCollections/VTEX - Default Values API/Default values/Delete default values.yml new file mode 100644 index 0000000000..3c3d177985 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/Default values/Delete default values.yml @@ -0,0 +1,58 @@ +info: + name: Delete default values + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/defaultValues/documents/:unitId" + headers: + - name: Accept + value: application/json + params: + - name: unitId + value: in occaecat + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/defaultValues/documents/:unitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all default values for a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier of the organizational unit. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Default Values API/Default values/Get default values.yml b/BrunoCollections/VTEX - Default Values API/Default values/Get default values.yml new file mode 100644 index 0000000000..ab243d7a85 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/Default values/Get default values.yml @@ -0,0 +1,128 @@ +info: + name: Get default values + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/defaultValues/documents/:unitId?_schema=v1&_fields=id,defaultValues" + headers: + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + - name: _fields + value: id,defaultValues + type: query + - name: unitId + value: in occaecat + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/defaultValues/documents/:unitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/defaultValues/documents/:unitId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/defaultValues/documents/:unitId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/defaultValues/documents/:unitId - Schema is valid", function () { + const schema = {"type":"object","description":"Default values for the organizational unit.","properties":{"id":{"type":"string","description":"Unique identifier of the organizational unit."},"defaultValues":{"type":"array","description":"An array of default value objects configured for this organizational unit.","items":{"type":"object","description":"Default value object defining entity-specific defaults.","properties":{"entity":{"type":"string","description":"The name of the entity. Possible values:
•`address/shipping`
•`address/billing`
•`creditCard`
•`customFieldValues/{{customFieldId}}` for regular custom fields (e.g., PO Number, Cost Center, Release) where `{{customFieldId}}` is the `DocumentId` from Create Custom Field Settings
•`customFieldValues/{{customFieldId}}/{{auxId}}` for Location custom fields where `{{customFieldId}}` is the `DocumentId` returned by the Create Custom Field Settings endpoint (e.g., `89f1da93-6917-4cbf-894e-1f1399682826c`) and `{{auxId}}` is the address ID (only for Location custom fields)."},"entityValueId":{"type":"string","description":"The ID of the entity value associated with the entity."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the default values for a specific organization unit in the VTEX Data Entity by making a GET request. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier of the organizational unit. | + | `_schema` | query | (Required) Schema version. | + | `_fields` | query | (Required) Comma-separated list of fields to return. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "a6d958c2-25ba-4f4d-9a0a-6b56e458426c", + "defaultValues": [ + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "4498bd3d-7eaf-11f0-b37f-cc2298c87c12" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "7852aef0-7eb3-11f0-b37f-bfdc92dec2f6" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "9952aef0-7eb3-11f0-b37f-bfdc92dec2e6" + }, + { + "entity": "creditCard", + "entityValueId": "EDE0B17747B24EFC9650B6C6B3E06C5F" + }, + { + "entity": "address/billing", + "entityValueId": "747b9bed-d6f4-4cf5-b9d1-4944f9825470" + }, + { + "entity": "address/shipping", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da72d" + }, + { + "entity": "customFieldValues/{{customFieldId}}/{{auxId}}", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da723" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Default Values API/Default values/Update default values.yml b/BrunoCollections/VTEX - Default Values API/Default values/Update default values.yml new file mode 100644 index 0000000000..e736f123f6 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/Default values/Update default values.yml @@ -0,0 +1,103 @@ +info: + name: Update default values + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/defaultValues/documents/:unitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: unitId + value: in occaecat + type: path + body: + type: json + data: |- + { + "id": "a6d958c2-25ba-4f4d-9a0a-6b56e458426c", + "defaultValues": [ + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "4498bd3d-7eaf-11f0-b37f-cc2298c87c12" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "7852aef0-7eb3-11f0-b37f-bfdc92dec2f6" + }, + { + "entity": "customFieldValues/{{customFieldId}}", + "entityValueId": "9952aef0-7eb3-11f0-b37f-bfdc92dec2e6" + }, + { + "entity": "creditCard", + "entityValueId": "EDE0B17747B24EFC9650B6C6B3E06C5F" + }, + { + "entity": "address/billing", + "entityValueId": "747b9bed-d6f4-4cf5-b9d1-4944f9825470" + }, + { + "entity": "address/shipping", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da72d" + }, + { + "entity": "customFieldValues/{{customFieldId}}/{{auxId}}", + "entityValueId": "45c50497-b67f-40ee-85ec-eddaa23da723" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/defaultValues/documents/:unitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/defaultValues/documents/:unitId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the default values for a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier of the organizational unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Default Values API/Default values/folder.yml b/BrunoCollections/VTEX - Default Values API/Default values/folder.yml new file mode 100644 index 0000000000..2e0a2e4965 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/Default values/folder.yml @@ -0,0 +1,4 @@ +info: + name: Default values + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Default Values API/environments/VTEX.yml b/BrunoCollections/VTEX - Default Values API/environments/VTEX.yml new file mode 100644 index 0000000000..d269f777b6 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/environments/VTEX.yml @@ -0,0 +1,14 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - name: auxId + value: "" + - name: customFieldId + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Default Values API/opencollection.yml b/BrunoCollections/VTEX - Default Values API/opencollection.yml new file mode 100644 index 0000000000..d5c0632139 --- /dev/null +++ b/BrunoCollections/VTEX - Default Values API/opencollection.yml @@ -0,0 +1,37 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Default Values API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Default values are purchase details, such as addresses and credit cards, that you can configure for an organizational unit to be automatically pre-filled at checkout. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Authentication + + You can authenticate requests to these APIs by sending a VTEX user token in a header named `VtexIdclientAutCookie`. Learn more in [API authentication using user tokens](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens). + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}`| Name of the VTEX account. Used as part of the URL. | + | `{{environment}}`| Environment to use. The default value is `vtexcommercestable`. Used in the URL. | + | `{{X-VTEX-API-AppKey}}` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + | `{{X-VTEX-API-AppToken}}` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery Promise/folder.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery Promise/folder.yml new file mode 100644 index 0000000000..3a3d0189f9 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery Promise/folder.yml @@ -0,0 +1,8 @@ +info: + name: Delivery Promise + type: folder + seq: 1 + +docs: + content: Operations related to the delivery promise. + type: text/markdown diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update delivery promises for an external seller's item.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update delivery promises for an external seller's item.yml new file mode 100644 index 0000000000..d36b19cab8 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update delivery promises for an external seller's item.yml @@ -0,0 +1,108 @@ +info: + name: Update delivery promises for an external seller's item + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/delivery-promises/external-sellers/:sellerId/items/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: TALD41516202766265 + type: path + - name: itemId + value: 11167-10968-34 + type: path + body: + type: json + data: |- + { + "availability": 12, + "promises": [ + { + "availability": 9, + "deliveryChannel": "delivery", + "deliveryZoneIds": [ + "BRA_COUNTRY" + ], + "id": "Prime5Days", + "name": "Same Week", + "deliveryTime": "5.00:00:00" + }, + { + "availability": 3, + "deliveryChannel": "pickup-in-point", + "deliveryZoneIds": [ + "BRA_COUNTRY" + ], + "id": "Prime2Day", + "name": "Same Day", + "deliveryTime": "1.00:00:00" + } + ], + "timestamp": "2025-08-07T14:52:20" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/delivery-promises/external-sellers/:sellerId/items/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates one or more delivery promises of a single [external seller's](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus) item, identified by the path parameter `itemId`. + + The Delivery Promise Notification API notifies the VTEX store of the external seller's product availability and delivery promises — that is, in which delivery zones, times, and methods the product is available. + + >ℹ️ This API is intended only for [**external sellers**](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus). It is not required for [franchise accounts](https://help.vtex.com/en/docs/tutorials/what-is-a-franchise-account), sellers using [VTEX Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal), or [VTEX sellers](https://help.vtex.com/en/tutorial/integrating-with-marketplace) already integrated into the [marketplace ecosystem](https://help.vtex.com/en/tutorial/integrating-with-marketplace). In these cases, availability and delivery options are managed natively by VTEX. + + Use this endpoint to update one or more delivery promises of a single external seller's item. A `PATCH` request always targets a single `itemId`, but you can update as many promises as needed within that item. + + Each promise to be updated must be identified by `id` (the same value previously sent as `deliveryInfo.id` in a `PUT` request). This field is required because, without it, the API cannot determine which promise of that item should be updated. + + >ℹ️ Before running a `PATCH` for an item, that item must have been previously created with a `PUT` request. `PATCH` is an update operation whose key is the `id` previously sent in the Update external product availability request. + + ## Making a SKU unavailable + + To make a SKU unavailable for a given delivery context, send a `PATCH` request with `availability: 0`. This action explicitly updates the [Delivery Promise](https://help.vtex.com/en/tutorial/delivery-promise-beta--p9EJH9GgxL0JceA6dBswd) state. Unlike [Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal) integrations, this change is not automatically propagated and must be triggered via API. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Delivery Promises | ProductAvailability | **Notify Product Availability Change** | + | | | | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) External seller identifier. | + | `itemId` | path | (Required) Item identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update external product availability.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update external product availability.yml new file mode 100644 index 0000000000..90e2c4dac1 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/Update external product availability.yml @@ -0,0 +1,110 @@ +info: + name: Update external product availability + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/delivery-promises/external-sellers/:sellerId/products?an=veniam" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: veniam + type: query + - name: sellerId + value: veniam + type: path + body: + type: json + data: |- + [ + { + "itemId": "1234", + "productId": "XPTO", + "availability": 7, + "promises": [ + { + "availability": 5, + "deliveryChannel": "delivery", + "deliveryZoneIds": [ + "BRA_COUNTRY" + ], + "deliveryInfo": { + "id": "Prime5Days", + "name": "Same Week", + "deliveryTime": "5.00:00:00" + } + }, + { + "availability": 3, + "deliveryChannel": "pickup-in-point", + "deliveryZoneIds": [ + "BRA_COUNTRY" + ], + "deliveryInfo": { + "id": "Prime2Day", + "name": "Same Day", + "deliveryTime": "1.00:00:00" + } + } + ] + } + ] + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/delivery-promises/external-sellers/:sellerId/products - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or fully updates delivery promises for one or more [external seller's](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus) items, notifying VTEX of changes in product availability and delivery promises. + + The Delivery Promise Notification API notifies the VTEX store of the external seller's product availability and delivery promises — that is, in which delivery zones, times, and methods the product is available. + + >ℹ️ This API is intended only for [**external sellers**](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus). It is not required for [franchise accounts](https://help.vtex.com/en/docs/tutorials/what-is-a-franchise-account), sellers using [VTEX Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal), or [VTEX sellers](https://help.vtex.com/en/tutorial/integrating-with-marketplace) already integrated into the [marketplace ecosystem](https://help.vtex.com/en/tutorial/integrating-with-marketplace). In these cases, availability and delivery options are managed natively by VTEX. + + Use this endpoint to **create or fully replace** the delivery promises for one or more external sellers' items. Each request sends the complete set of promises for the items included in the payload. + + ## Making a SKU unavailable + + To make a SKU unavailable for a given delivery context, send a `PUT` request with `availability: 0`. This action explicitly updates the [Delivery Promise](https://help.vtex.com/en/tutorial/delivery-promise-beta--p9EJH9GgxL0JceA6dBswd) state. Unlike [Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal) integrations, this change is not automatically propagated and must be triggered via API. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Delivery Promises | ProductAvailability | **Notify Product Availability Change** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) The seller's ID registered in the marketplace. | + | `an` | query | (Required) The account name receiving the notification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/folder.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/folder.yml new file mode 100644 index 0000000000..78b91afb42 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/Delivery promise (2)/folder.yml @@ -0,0 +1,4 @@ +info: + name: Delivery promise + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/environments/VTEX.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Delivery Promise Notification API/opencollection.yml b/BrunoCollections/VTEX - Delivery Promise Notification API/opencollection.yml new file mode 100644 index 0000000000..62b8fcc916 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Notification API/opencollection.yml @@ -0,0 +1,46 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Delivery Promise Notification API + +docs: + content: |- + [Delivery Promise (Beta)](https://help.vtex.com/en/tutorial/delivery-promise-beta--p9EJH9GgxL0JceA6dBswd) is VTEX's solution that allows customers to view only the products they can buy in their shopping experience, considering both the product availability in the seller inventory and the valid shipping methods for their delivery address. + + The Delivery Promise Notification API notifies the VTEX store of the [external seller's](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus) product availability and delivery promises — that is, in which delivery zones, times, and methods the product is available. + + >ℹ️ This feature is in beta, which means that we are working to improve it. If you have any questions, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + ## Delivery Promise + + - `PUT` [Update product availability](https://developers.vtex.com/docs/api-reference/delivery-promise-notification-api#put-/delivery-promises/external-sellers/-sellerId-/products) + + - `PATCH` [Update delivery promises for an external seller's item](https://developers.vtex.com/docs/api-reference/delivery-promise-notification-api#patch-/delivery-promises/external-sellers/-sellerId-/items/-itemId-) + + ## When to use this API + + This API is intended only for [**external sellers**](https://help.vtex.com/en/tutorial/integration-guide-for-marketplaces-seller-non-vtex--yMji0ow0rQuYgQsg26Kus). It is not required for: + + - [Franchise accounts](https://help.vtex.com/en/docs/tutorials/what-is-a-franchise-account). + - Sellers using [VTEX Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal). + - [VTEX sellers](https://help.vtex.com/en/tutorial/integrating-with-marketplace) already integrated into the [marketplace ecosystem](https://help.vtex.com/en/tutorial/integrating-with-marketplace). + + In these cases, availability and delivery options are managed natively by VTEX. + + ### `PUT` vs `PATCH` + + - Use `PUT` [Update product availability](https://developers.vtex.com/docs/api-reference/delivery-promise-notification-api#put-/delivery-promises/external-sellers/-sellerId-/products) when you want to **create or fully replace** all promises for one or more items. + - Use `PATCH` [Update delivery promises for an external seller's item](https://developers.vtex.com/docs/api-reference/delivery-promise-notification-api#patch-/delivery-promises/external-sellers/-sellerId-/items/-itemId-) when you want to **update specific promises** for a single item. + + >ℹ️ Before running a `PATCH` for an item, that item must have been previously created with a `PUT` request. `PATCH` is an update operation whose key is the `id` previously sent in the `PUT` request. + + ## Making a SKU unavailable + + To make a SKU unavailable for a given delivery context, send a request with `availability: 0`. This action explicitly updates the [Delivery Promise](https://help.vtex.com/en/tutorial/delivery-promise-beta--p9EJH9GgxL0JceA6dBswd) state. Unlike [Seller Portal](https://help.vtex.com/en/docs/tutorials/how-to-set-up-your-store-on-seller-portal) integrations, this change is not automatically propagated and must be triggered via API. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Get delivery suggestions.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Get delivery suggestions.yml new file mode 100644 index 0000000000..e2aff1fba7 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Get delivery suggestions.yml @@ -0,0 +1,174 @@ +info: + name: Get delivery suggestions + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/delivery-promise-suggestions?products[0].productId=123&deliveryZonesHash=abc123def456&pickupsHash=xyz789uvw012" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: products[0].productId + value: "123" + type: query + - name: products[0].itemId + value: 123-1 + type: query + disabled: true + - name: deliveryZonesHash + value: abc123def456 + type: query + - name: pickupsHash + value: xyz789uvw012 + type: query + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/delivery-promise-suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/delivery-promise-suggestions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/delivery-promise-suggestions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/delivery-promise-suggestions - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing delivery suggestions for requested products.","properties":{"suggestions":{"type":"array","description":"Array of delivery suggestions, with one entry corresponding to each product in the request.","minItems":1,"maxItems":20,"items":{"type":"object","description":"Delivery suggestion for a single product.","required":["productId","suggestions"],"properties":{"productId":{"type":"string","description":"The unique identifier of the product.","nullable":false},"suggestions":{"type":"object","description":"Object containing delivery and pickup options suggestions.","required":["delivery","pickup"],"properties":{"delivery":{"type":"array","description":"Array of delivery option suggestions. An empty array indicates no delivery options are available for the current context.","items":{"type":"object","description":"Delivery option suggestion.","properties":{"id":{"type":"string","description":"The unique identifier for the specific delivery option (SLA)."},"name":{"type":"string","description":"A human-readable name for the delivery option (e.g., \"Express Delivery\")."},"slaTimeTarget":{"type":"object","description":"Object defining the time window for fulfillment.","properties":{"from":{"type":"number","description":"Minimum time for fulfillment."},"to":{"type":"number","description":"Maximum time for fulfillment."},"unit":{"type":"string","description":"Time unit: `h` for hours or `d` for days.","enum":["h","d"]}}},"conditions":{"type":"array","description":"Tags indicating why the option was selected (e.g., `fastest`, `nearest`).","items":{"type":"string","description":"Condition tag (e.g., `fastest`, `nearest`)."}}}}},"pickup":{"type":"array","description":"Array of pickup option suggestions. An empty array indicates no pickup options are available for the current context.","items":{"type":"object","description":"Pickup option suggestion.","properties":{"id":{"type":"string","description":"The unique identifier for the specific pickup option (Store)."},"name":{"type":"string","description":"A human-readable name for the pickup option (e.g., \"Downtown Store\")."},"slaTimeTarget":{"type":"object","description":"Object defining the time window for fulfillment.","properties":{"from":{"type":"number","description":"Minimum time for fulfillment."},"to":{"type":"number","description":"Maximum time for fulfillment."},"unit":{"type":"string","description":"Time unit: `h` for hours or `d` for days.","enum":["h","d"]}}},"conditions":{"type":"array","description":"Tags indicating why the option was selected (e.g., `fastest`, `nearest`).","items":{"type":"string","description":"Condition tag (e.g., `fastest`, `nearest`)."}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves delivery and pickup suggestions for products using query parameters. This method supports caching, bookmarking, and browser optimizations. The response contains suggestions for each requested product, including [available delivery and pickup options](https://help.vtex.com/docs/tutorials/delivery-options-beta#creating-delivery-options) with timing information and selection criteria tags (e.g., fastest, nearest). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `products[0].productId` | query | (Required) The unique identifier of the first product. Use index notation for multiple products (e.g., `products[0].productId`, `products[1].productId`). | + | `products[0].itemId` | query | The specific SKU ID for the first product. If omitted, all SKUs for the product are evaluated. Use index notation for multiple SKUs (e.g., `products[0].itemId`, `products[1].itemId`). | + | `deliveryZonesHash` | query | (Required) Hash representing the user's delivery context, which is a part of the fulfillment context. | + | `pickupsHash` | query | (Required) Hash representing the user's pickup context, which is a part of the fulfillment context. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "suggestions": [ + { + "productId": "123", + "suggestions": { + "delivery": [ + { + "id": "express-delivery", + "name": "Express Delivery", + "slaTimeTarget": { + "from": 0, + "to": 4, + "unit": "h" + }, + "conditions": [ + "fastest" + ] + }, + { + "id": "standard-delivery", + "name": "Standard Delivery", + "slaTimeTarget": { + "from": 1, + "to": 3, + "unit": "d" + }, + "conditions": [] + } + ], + "pickup": [ + { + "id": "store-downtown", + "name": "Downtown Store", + "slaTimeTarget": { + "from": 0, + "to": 2, + "unit": "h" + }, + "conditions": [ + "nearest" + ] + } + ] + } + }, + { + "productId": "456", + "itemId": "456-1", + "suggestions": { + "delivery": [ + { + "id": "standard-delivery", + "name": "Standard Delivery", + "slaTimeTarget": { + "from": 2, + "to": 5, + "unit": "d" + }, + "conditions": [ + "fastest" + ] + } + ], + "pickup": [] + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Search delivery suggestions.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Search delivery suggestions.yml new file mode 100644 index 0000000000..24943a7aef --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/Search delivery suggestions.yml @@ -0,0 +1,175 @@ +info: + name: Search delivery suggestions + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/delivery-promise-suggestions/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "products": [ + { + "productId": "123", + "itemId": "123-1" + }, + { + "productId": "456", + "itemId": "456-1" + } + ], + "deliveryZonesHash": "abc123def456", + "pickupsHash": "xyz789uvw012" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/delivery-promise-suggestions/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/delivery-promise-suggestions/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/delivery-promise-suggestions/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/delivery-promise-suggestions/_search - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing delivery suggestions for requested products.","properties":{"suggestions":{"type":"array","description":"Array of delivery suggestions, with one entry corresponding to each product in the request.","minItems":1,"maxItems":20,"items":{"type":"object","description":"Delivery suggestion for a single product.","required":["productId","suggestions"],"properties":{"productId":{"type":"string","description":"The unique identifier of the product.","nullable":false},"suggestions":{"type":"object","description":"Object containing delivery and pickup options suggestions.","required":["delivery","pickup"],"properties":{"delivery":{"type":"array","description":"Array of delivery option suggestions. An empty array indicates no delivery options are available for the current context.","items":{"type":"object","description":"Delivery option suggestion.","properties":{"id":{"type":"string","description":"The unique identifier for the specific delivery option (SLA)."},"name":{"type":"string","description":"A human-readable name for the delivery option (e.g., \"Express Delivery\")."},"slaTimeTarget":{"type":"object","description":"Object defining the time window for fulfillment.","properties":{"from":{"type":"number","description":"Minimum time for fulfillment."},"to":{"type":"number","description":"Maximum time for fulfillment."},"unit":{"type":"string","description":"Time unit: `h` for hours or `d` for days.","enum":["h","d"]}}},"conditions":{"type":"array","description":"Tags indicating why the option was selected (e.g., `fastest`, `nearest`).","items":{"type":"string","description":"Condition tag (e.g., `fastest`, `nearest`)."}}}}},"pickup":{"type":"array","description":"Array of pickup option suggestions. An empty array indicates no pickup options are available for the current context.","items":{"type":"object","description":"Pickup option suggestion.","properties":{"id":{"type":"string","description":"The unique identifier for the specific pickup option (Store)."},"name":{"type":"string","description":"A human-readable name for the pickup option (e.g., \"Downtown Store\")."},"slaTimeTarget":{"type":"object","description":"Object defining the time window for fulfillment.","properties":{"from":{"type":"number","description":"Minimum time for fulfillment."},"to":{"type":"number","description":"Maximum time for fulfillment."},"unit":{"type":"string","description":"Time unit: `h` for hours or `d` for days.","enum":["h","d"]}}},"conditions":{"type":"array","description":"Tags indicating why the option was selected (e.g., `fastest`, `nearest`).","items":{"type":"string","description":"Condition tag (e.g., `fastest`, `nearest`)."}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves delivery and pickup suggestions for a batch of products. The response contains suggestions for each requested product, including [available delivery and pickup options](https://help.vtex.com/docs/tutorials/delivery-options-beta#creating-delivery-options) with timing information and selection criteria tags (e.g., fastest, nearest). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--sjGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "suggestions": [ + { + "productId": "123", + "suggestions": { + "delivery": [ + { + "id": "express-delivery", + "name": "Express Delivery", + "slaTimeTarget": { + "from": 0, + "to": 4, + "unit": "h" + }, + "conditions": [ + "fastest" + ] + }, + { + "id": "standard-delivery", + "name": "Standard Delivery", + "slaTimeTarget": { + "from": 1, + "to": 3, + "unit": "d" + }, + "conditions": [] + } + ], + "pickup": [ + { + "id": "store-downtown", + "name": "Downtown Store", + "slaTimeTarget": { + "from": 0, + "to": 2, + "unit": "h" + }, + "conditions": [ + "nearest" + ] + } + ] + } + }, + { + "productId": "456", + "itemId": "456-1", + "suggestions": { + "delivery": [ + { + "id": "standard-delivery", + "name": "Standard Delivery", + "slaTimeTarget": { + "from": 2, + "to": 5, + "unit": "d" + }, + "conditions": [ + "fastest" + ] + } + ], + "pickup": [] + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/folder.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/folder.yml new file mode 100644 index 0000000000..13761b1bd1 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Delivery suggestions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Delivery suggestions + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search delivery zones.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search delivery zones.yml new file mode 100644 index 0000000000..e8b8d8f77c --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search delivery zones.yml @@ -0,0 +1,107 @@ +info: + name: Search delivery zones + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics-shipping/delivery-zones/_search/v2" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "zipCode": "04538132", + "geoCoordinates": "-46.682033,-23.590057", + "country": "BRA" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics-shipping/delivery-zones/_search/v2 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics-shipping/delivery-zones/_search/v2 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics-shipping/delivery-zones/_search/v2 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics-shipping/delivery-zones/_search/v2 - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing available delivery zones for the specified location.","properties":{"deliveryZonesIds":{"type":"array","description":"Array of delivery zones available for the location.","items":{"type":"string","description":"Unique identifier of the delivery zone."}},"deliveryZonesHash":{"type":"string","description":"Hash representing the delivery zones context. This hash is required in the [Get delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#get-/api/delivery-promise-suggestions) and the [Search delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#post-/api/delivery-promise-suggestions/_search) endpoints."},"countryCode":{"type":"string","description":"Three-letter country code (ISO 3166-1 alpha-3)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves available delivery zones based on location information. This endpoint helps determine which delivery zones are applicable for a given address, using postal code, geographic coordinates, and country. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--sjGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "deliveryZoneIds": [ + "BRA_COUNTRY", + "BRA_REGION_NORDESTE", + "BRA_SUBSTATE_PB_INTERIOR" + ], + "deliveryZonesHash": "c3e1a42f7b9d4e81aafe24ba6e7b120f", + "countryCode": "BRA" + } + ``` diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search pickup points.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search pickup points.yml new file mode 100644 index 0000000000..7e338ac179 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/Search pickup points.yml @@ -0,0 +1,265 @@ +info: + name: Search pickup points + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/logistics-shipping/pickuppoints/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: maxDistance + value: "10" + type: query + disabled: true + body: + type: json + data: |- + { + "zipCode": "01310930", + "country": "BRA", + "coordinate": { + "latitude": -23.555404663085938, + "longitude": -46.6456413269043 + } + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics-shipping/pickuppoints/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics-shipping/pickuppoints/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics-shipping/pickuppoints/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics-shipping/pickuppoints/_search - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing available pickup points for the specified location.","properties":{"pickupPointDistances":{"type":"array","description":"Array of pickup points available near the location.","items":{"type":"object","description":"Pickup point information.","properties":{"pickupId":{"type":"string","description":"Unique identifier of the pickup point."},"pickupName":{"type":"string","description":"Human-readable name of the pickup point."},"distance":{"type":"number","description":"Distance from the searched location in kilometers."},"isActive":{"type":"boolean","description":"Indicates if the pickup point is active."},"address":{"type":"object","description":"Physical address of the pickup point.","properties":{"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State or province code."},"neighborhood":{"type":"string","description":"Neighborhood name."}}},"businessHours":{"type":"array","description":"Business hours of the pickup point from Monday to Friday.","items":{"type":"object","description":"Business hours of the pickup point in a specific day of the week.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week identification, as in `0` = Sunday, `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, `5` = Friday, and `6` = Saturday.","enum":[0,1,2,3,4,5,6]},"openingTime":{"type":"string","description":"Opening time of the pickup point in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time of the pickup point in `HH:MM:SS` format."}}}}}}},"pickupPointsHash":{"type":"string","description":"Hash representing the pickup points context. This hash is required and used in the `pickupsHash` field of the [Get delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#get-/api/delivery-promise-suggestions) and the [Search delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#post-/api/delivery-promise-suggestions/_search) endpoints."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves available pickup points based on location information and distance constraints. This endpoint helps find pickup locations near a given address, using postal code, geographic coordinates, country, and optional maximum distance. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--sjGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `maxDistance` | query | Maximum distance in kilometers from the specified location to search for pickup points. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pickupPointDistances": [ + { + "pickupId": "fulfillmentqa_vtexsp", + "distance": 4.990988731384277, + "pickupName": "VTEX SP", + "isActive": true, + "address": { + "city": "São Paulo", + "neighborhood": "Itaim Bibi", + "number": "4440", + "postalCode": "04538-132", + "street": "Avenida Brigadeiro Faria Lima", + "state": "SP" + }, + "businessHours": [ + { + "dayOfWeek": 0, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 1, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 2, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 3, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 4, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 5, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 6, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + } + ] + }, + { + "pickupId": "fulfillmentqa1_vtex-sp", + "distance": 5.6930670738220215, + "pickupName": "VTEX SP", + "isActive": true, + "address": { + "city": "São Paulo", + "neighborhood": "Itaim Bibi", + "number": "4440", + "postalCode": "04538-132", + "street": "Avenida Brigadeiro Faria Lima", + "state": "SP" + }, + "businessHours": [ + { + "dayOfWeek": 0, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 1, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + }, + { + "dayOfWeek": 6, + "openingTime": "00:00:00", + "closingTime": "00:00:00" + } + ] + }, + { + "pickupId": "fulfillmentqa1_c5bc07a6-389b-4366-bf95-bdb841ebcdda", + "distance": 6.2001118659973145, + "pickupName": "VTEX Vila Olimpia", + "isActive": true, + "address": { + "city": "São Paulo", + "neighborhood": "Vila Olímpia", + "number": "s/n", + "postalCode": "04551-080", + "street": "Rua São Tomé", + "state": "SP" + }, + "businessHours": [ + { + "dayOfWeek": 0, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 1, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 2, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 3, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 4, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 5, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + }, + { + "dayOfWeek": 6, + "openingTime": "00:00:00", + "closingTime": "23:59:00" + } + ] + } + ], + "pickupPointsHash": "b92e64d0a08f4c6785e6d0319cbad19a" + } + ``` diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/folder.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/folder.yml new file mode 100644 index 0000000000..c43de3457f --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/Logistics shipping/folder.yml @@ -0,0 +1,4 @@ +info: + name: Logistics shipping + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/environments/VTEX.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Delivery Promise Suggestions API/opencollection.yml b/BrunoCollections/VTEX - Delivery Promise Suggestions API/opencollection.yml new file mode 100644 index 0000000000..b2e2006d2c --- /dev/null +++ b/BrunoCollections/VTEX - Delivery Promise Suggestions API/opencollection.yml @@ -0,0 +1,29 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Delivery Promise Suggestions API + +docs: + content: |- + The Delivery Promise Suggestions API provides real-time suggestions for delivery and pickup options based on product availability, user location, and fulfillment context for stores that use [Delivery Promise](https://help.vtex.com/docs/tutorials/delivery-promise-beta) and [Delivery Options](https://help.vtex.com/en/docs/tutorials/delivery-options-beta). It helps optimize the customer shopping experience by suggesting the best fulfillment options for each product. + + >ℹ️ This API is in beta, which means that we are working to improve it. If you have any questions, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + ## Index + + ### Logistics Shipping + + - `POST` [Search delivery zones](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#post-/api/logistics-shipping/delivery-zones/_search/v2) + - `POST` [Search pickup points](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#post-/api/logistics-shipping/pickuppoints/_search) + + ### Delivery Promise Suggestions + + - `POST` [Search delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#post-/api/delivery-promise-suggestions/_search) + - `GET` [Get delivery suggestions](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestionss-api#get-/api/delivery-promise-suggestions) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Document Contracts API/Addresses/Create address.yml b/BrunoCollections/VTEX - Document Contracts API/Addresses/Create address.yml new file mode 100644 index 0000000000..c087bf91fd --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Addresses/Create address.yml @@ -0,0 +1,108 @@ +info: + name: Create address + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/AD/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "addressLabel": "PRINCIPAL", + "postalCode": "48226", + "street": "Toringon Street", + "number": "11", + "neighborhood": "", + "complement": "", + "city": "Raleigh", + "state": "NC", + "country": "USA", + "receiverName": "Backpack-Klub-LLC", + "geoCoordinate": "", + "addressType": "commercial", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/AD/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/AD/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/AD/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/AD/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a created address.","properties":{"Id":{"type":"string","description":"The prefixed ID of the document."},"Href":{"type":"string","description":"The URL to access the created document."},"DocumentId":{"type":"string","description":"The actual document ID (UUID) within the entity."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to register a new address, also referred to as the AD data entity. + + > ⚠️ When creating addresses you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Create Applications** | + | Master Data | Application | **View logs** | + | Master Data | Form | **List Forms** | + | Master Data | Form | **Create Forms** | + | Master Data | Generic resources | **Full access to forms** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "AD-4286e252-050b-11f0-b37f-d6617047d485", + "Href": "http://qastore.myvtex.com/api/dataentities/AD/documents/4286e252-050b-11f0-b37f-d6617047d485", + "DocumentId": "4286e252-050b-11f0-b37f-d6617047d485" + } + ``` diff --git a/BrunoCollections/VTEX - Document Contracts API/Addresses/Delete address by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Addresses/Delete address by ID.yml new file mode 100644 index 0000000000..6de39b0c5b --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Addresses/Delete address by ID.yml @@ -0,0 +1,65 @@ +info: + name: Delete address by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to delete a specific address document from the `AD` data entity. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Remove Applications** | + | Master Data | Comment | **Remove Comment** | + | Master Data | Form | **Remove Form** | + | Master Data | Generic resources | **Full access to forms** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to be deleted. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Document Contracts API/Addresses/Get address by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Addresses/Get address by ID.yml new file mode 100644 index 0000000000..63b74cf6ec --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Addresses/Get address by ID.yml @@ -0,0 +1,123 @@ +info: + name: Get address by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId?_fields=_all" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for an address document.","properties":{"addressLabel":{"type":["string","null"],"description":"A user-defined label to identify the address."},"addressType":{"type":["string","null"],"description":"The type of address: `commercial` for shipping, `invoice` for billing.","enum":["commercial","invoice"]},"city":{"type":["string","null"],"description":"The city of the address."},"complement":{"type":["string","null"],"description":"Any additional information for the address (e.g., apartment, floor)."},"country":{"type":["string","null"],"description":"The country of the address in three-letter code format (e.g., `\"USA\"`)."},"countryfake":{"type":["string","null"],"description":"Placeholder or optional country value."},"geoCoordinate":{"type":["string","null"],"description":"Geographical coordinates of the address (latitude and longitude)."},"neighborhood":{"type":["string","null"],"description":"The neighborhood of the address."},"number":{"type":["string","null"],"description":"The street number of the address."},"postalCode":{"type":["string","null"],"description":"The postal code of the address. The format must be compatible with the address country postal code format. (e.g., `00000` for addresses in the USA)."},"receiverName":{"type":["string","null"],"description":"The name of the person or entity receiving at this address."},"reference":{"type":["string","null"],"description":"Optional reference point or landmark near the address."},"state":{"type":["string","null"],"description":"The state or province of the address."},"street":{"type":["string","null"],"description":"The street name of the address."},"userId":{"type":["string","null"],"description":"The ID of the user or related entity."},"id":{"type":["string","null"],"description":"Unique identifier for this address record."},"accountId":{"type":["string","null"],"description":"ID of the account related to this address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this address."},"dataEntityId":{"type":["string","null"],"description":"ID of the data entity this address belongs to (always `\"AD\"`)."},"createdBy":{"type":["string","null"],"description":"ID of the user who created the address record."},"createdIn":{"type":["string","null"],"description":"Timestamp of when the address record was created."},"updatedBy":{"type":["string","null"],"description":"ID of the user who last updated the address record."},"updatedIn":{"type":["string","null"],"description":"Timestamp of the last update to the address record."},"lastInteractionBy":{"type":["string","null"],"description":"ID of the user who had the last interaction with the record."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of the last interaction with the record."},"followers":{"type":["array","null"],"description":"List of users following this address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this address.","items":{"type":"string","description":"Tag value."}},"auto_filter":{"type":["string","null"],"description":"Optional field used for automatic filtering or categorization."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves information of a specific address by its unique identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **List Applications** | + | Master Data | Application | **View logs** | + | Master Data | Form | **List Forms** | + | Master Data | Comment | **List Comments** | + | Master Data | Customized Search | **List Custom Search** | + | Master Data | Generic resources | **Read-only form access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to retrieve. | + | `_fields` | query | (Required) Specifies that all fields of the document should be included in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "addressLabel": "PRINCIPAL", + "addressType": "commercial", + "city": "Raleigh", + "complement": "", + "country": "USA", + "countryfake": null, + "geoCoordinate": "", + "neighborhood": "", + "number": "11", + "postalCode": "48226", + "receiverName": "Backpack-Klub-LLC", + "reference": null, + "state": "NC", + "street": "Toringon Street", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "id": "4286e252-050b-11f0-b37f-d6617047d485", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "qastore", + "dataEntityId": "AD", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdIn": "2025-03-19T21:44:01.4199691Z", + "updatedBy": null, + "updatedIn": null, + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionIn": "2025-03-19T21:44:01.4199691Z", + "followers": [], + "tags": [], + "auto_filter": null + } + ``` diff --git a/BrunoCollections/VTEX - Document Contracts API/Addresses/Update address by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Addresses/Update address by ID.yml new file mode 100644 index 0000000000..62f138b1c6 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Addresses/Update address by ID.yml @@ -0,0 +1,84 @@ +info: + name: Update address by ID + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + body: + type: json + data: |- + { + "addressLabel": "PRINCIPAL", + "postalCode": "48226", + "street": "Toringon Street", + "number": "11", + "neighborhood": "", + "complement": "", + "city": "Raleigh", + "state": "NC", + "country": "USA", + "receiverName": "Backpack-Klub-LLC", + "geoCoordinate": "", + "addressType": "commercial", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to update an existing address document in the `AD` data entity. + + > ⚠️ When updating addresses you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Edit Applications** | + | Master Data | Form | **Edit Forms** | + | Master Data | Generic resources | **Access to insert and edit but not to delete** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Document Contracts API/Addresses/folder.yml b/BrunoCollections/VTEX - Document Contracts API/Addresses/folder.yml new file mode 100644 index 0000000000..c716657be8 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Addresses/folder.yml @@ -0,0 +1,8 @@ +info: + name: Addresses + type: folder + seq: 2 + +docs: + content: APIs for managing addresses associated with contracts (AD data entity). + type: text/markdown diff --git a/BrunoCollections/VTEX - Document Contracts API/Contracts/Create contract.yml b/BrunoCollections/VTEX - Document Contracts API/Contracts/Create contract.yml new file mode 100644 index 0000000000..b04b1b8d56 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Contracts/Create contract.yml @@ -0,0 +1,143 @@ +info: + name: Create contract + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/CL/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "email": "business-klub-spc@email.com", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "documentType": "CNPJ", + "isCorporate": true, + "corporateDocument": "00000000000000", + "homePhone": "1122223333", + "cellPhone": "1122223333", + "corporateName": "Business Klub SPC", + "tradeName": "Business Klub", + "stateRegistration": "", + "isFreeStateRegistration": true, + "priceTables": "CL-4000060,CL3000007", + "restrictions": { + "vtex.catalog": { + "collectionIds": [] + }, + "vtex.checkout": { + "creditCards": [ + "da89bc50-994e-4e39-9974-4a9d081cc3f4", + "65ec3ec6-c504-4431-b17a-ea3800fb03d2" + ] + }, + "vtex.payments": { + "paymentSystemIds": [ + 1, + 2, + 3, + 4, + 5, + 7, + 8, + 9, + 14, + 21, + 29, + 31, + 33, + 34, + 35, + 36, + 37, + 48, + 789 + ] + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/CL/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/CL/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/CL/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/CL/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a created contract.","properties":{"Id":{"type":"string","description":"The ID of the created contract document."},"Href":{"type":"string","description":"URL of the created document."},"DocumentId":{"type":"string","description":"The document ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint enables you to create a new contract, also referred to as the `CL` data entity. + + > ⚠️ When creating contracts you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Create Applications** | + | Master Data | Application | **View logs** | + | Master Data | Form | **List Forms** | + | Master Data | Form | **Create Forms** | + | Master Data | Generic resources | **Full access to forms** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "CL-2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "Href": "http://qastore.myvtex.com/api/dataentities/CL/documents/2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "DocumentId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1" + } + ``` diff --git a/BrunoCollections/VTEX - Document Contracts API/Contracts/Delete contract by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Contracts/Delete contract by ID.yml new file mode 100644 index 0000000000..ca84eba52c --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Contracts/Delete contract by ID.yml @@ -0,0 +1,70 @@ +info: + name: Delete contract by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + disabled: true + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/CL/documents/:contractId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to delete a specific contract from the data entity `CL`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Remove Applications** | + | Master Data | Comment | **Remove Comment** | + | Master Data | Form | **Remove Form** | + | Master Data | Generic resources | **Full access to forms** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to be deleted. | + | `_fields` | query | Specifies that all fields of the document should be included in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Document Contracts API/Contracts/Get contract by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Contracts/Get contract by ID.yml new file mode 100644 index 0000000000..47a73af9ea --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Contracts/Get contract by ID.yml @@ -0,0 +1,148 @@ +info: + name: Get contract by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _fields + value: _all + type: query + disabled: true + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/CL/documents/:contractId - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for a contract document.","properties":{"cluster":{"type":["string","null"],"description":"Internal or optional analytics or tags fields."},"priceTables":{"type":["string","null"],"description":"Comma-separated list of assigned price table codes."},"isCorporate":{"type":["boolean","null"],"description":"Whether it's a legal entity."},"tradeName":{"type":["string","null"],"description":"The trade name of the contact."},"homePhone":{"type":["string","null"],"description":"Contact phone number."},"phone":{"type":["string","null"],"description":"Contact phone number."},"businessPhone":{"type":["string","null"],"description":"Contact business phone number."},"email":{"type":["string","null"],"description":"The email of the contact."},"firstName":{"type":["string","null"],"description":"The first name of the contact."},"lastName":{"type":["string","null"],"description":"The last name of the contact."},"document":{"type":["string","null"],"description":"The document number of the contact."},"documentType":{"type":["string","null"],"description":"The type of document (e.g., \"EIN\", \"State Business Registration Number\")."},"corporateName":{"type":["string","null"],"description":"Company's registered corporate name."},"stateRegistration":{"type":["string","null"],"description":"State-level registration number."},"isNewsletterOptIn":{"type":["boolean","null"],"description":"Indicates newsletter opt-in status."},"createdIn":{"type":["string","null"],"description":"Timestamp of document creation."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of last update."},"id":{"type":["string","null"],"description":"Unique contract ID."},"dataEntityId":{"type":["string","null"],"description":"Fixed entity ID (always \"CL\")."},"accountId":{"type":["string","null"],"description":"ID of the account related to this address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this address."},"followers":{"type":["array","null"],"description":"List of users following this address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this address.","items":{"type":"string","description":"Tag value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves information related to a given contract, by its unique identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **List Applications** | + | Master Data | Application | **View logs** | + | Master Data | Form | **List Forms** | + | Master Data | Comment | **List Comments** | + | Master Data | Customized Search | **List Custom Search** | + | Master Data | Generic resources | **Read-only form access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to retrieve. | + | `_fields` | query | Specifies that all fields of the document should be included in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "cluster": null, + "priceTables": "CL-4000060,CL3000007,NCC,NCNC", + "isCorporate": null, + "tradeName": null, + "rclastcart": null, + "rclastcartvalue": null, + "rclastsession": null, + "rclastsessiondate": null, + "homePhone": "1122223333", + "phone": null, + "brandPurchasedTag": null, + "brandVisitedTag": null, + "categoryPurchasedTag": null, + "categoryVisitedTag": null, + "departmentVisitedTag": null, + "productPurchasedTag": null, + "productVisitedTag": null, + "stateRegistration": "", + "email": "business-klub-spc@email.com", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "isNewsletterOptIn": false, + "localeDefault": null, + "attach": null, + "approved": null, + "birthDate": null, + "businessPhone": "1122223333", + "carttag": null, + "checkouttag": null, + "corporateDocument": null, + "corporateName": "Business Klub SPC", + "documentType": "CNPJ", + "gender": null, + "visitedProductWithStockOutSkusTag": null, + "customerClass": null, + "profilePicture": null, + "birthDateMonth": null, + "id": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "qastore", + "dataEntityId": "CL", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdIn": "2025-03-19T21:43:29.7132146Z", + "updatedBy": null, + "updatedIn": null, + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionIn": "2025-03-19T21:43:29.7132146Z", + "followers": [], + "tags": [], + "auto_filter": null + } + ``` diff --git a/BrunoCollections/VTEX - Document Contracts API/Contracts/Update contract by ID.yml b/BrunoCollections/VTEX - Document Contracts API/Contracts/Update contract by ID.yml new file mode 100644 index 0000000000..36ef8fd249 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Contracts/Update contract by ID.yml @@ -0,0 +1,85 @@ +info: + name: Update contract by ID + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/CL/documents/:contractId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: contractId + value: 2da4e9ab-050b-11f0-b37f-f4b136dbcce1 + type: path + body: + type: json + data: |- + { + "email": "business-klub-spc@email.com", + "firstName": "Business Klub", + "lastName": "SPC", + "document": "00000000000000", + "documentType": "CNPJ", + "businessDocument": "00000000000000", + "homePhone": "1122223333", + "cellPhone": "1122223333", + "corporateName": "Business Klub SPC", + "tradeName": "Business Klub", + "isCorporate": true, + "stateRegistration": "", + "isFreeStateRegistration": true, + "priceTables": "CL-4000060,CL3000007" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/CL/documents/:contractId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/CL/documents/:contractId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to update an existing contract by its unique identifier. + + > ⚠️ When updating contracts you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Master Data | Application | **Edit Applications** | + | Master Data | Form | **Edit Forms** | + | Master Data | Generic resources | **Access to insert and edit but not to delete** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `contractId` | path | (Required) ID of the contract to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Document Contracts API/Contracts/folder.yml b/BrunoCollections/VTEX - Document Contracts API/Contracts/folder.yml new file mode 100644 index 0000000000..01ca88e966 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/Contracts/folder.yml @@ -0,0 +1,8 @@ +info: + name: Contracts + type: folder + seq: 1 + +docs: + content: APIs for managing B2B contracts (CL data entity). + type: text/markdown diff --git a/BrunoCollections/VTEX - Document Contracts API/environments/VTEX.yml b/BrunoCollections/VTEX - Document Contracts API/environments/VTEX.yml new file mode 100644 index 0000000000..33ba62ea0a --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://{{accountName}}.myvtex.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Document Contracts API/opencollection.yml b/BrunoCollections/VTEX - Document Contracts API/opencollection.yml new file mode 100644 index 0000000000..9527765b27 --- /dev/null +++ b/BrunoCollections/VTEX - Document Contracts API/opencollection.yml @@ -0,0 +1,48 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Document Contracts API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Document Contracts API enables you to create and manage contracts (B2B clients) for your store. This API is intended for store management purposes and provides endpoints for creating, retrieving, updating, and deleting contracts, as well as managing associated addresses. + + Contracts in this context refer to B2B clients of your store. The API includes auxiliary endpoints to support contract configuration, particularly for managing the restrictions object that defines commercial and operational limits for each contract. + + ### Restrictions + + In the context of this API, **restrictions** define the specific commercial and operational limits that a merchant configures for a contract. These restrictions determine how the customer can interact with the store across key systems such as catalog access, data management, checkout options, and payment methods. + + While the values configured in the `restrictions` object are not directly passed to the systems, they are used to generate the valid inputs that are. This ensures that the customer's shopping and purchasing experience aligns with their contract terms and business agreements. + + ## Index + + ### Contracts + + - `POST` [Create contract](https://developers.vtex.com/docs/api-reference/document-contracts-api#post-/api/dataentities/cl/documents) + - `GET` [Get contract by ID](https://developers.vtex.com/docs/api-reference/document-contracts-api#get-/api/dataentities/cl/documents/-contractid-) + - `PATCH` [Update contract](https://developers.vtex.com/docs/api-reference/document-contracts-api#patch-/api/dataentities/cl/documents/-contractid-) + - `DELETE` [Delete contract](https://developers.vtex.com/docs/api-reference/document-contracts-api#delete-/api/dataentities/cl/documents/-contractid-) + + ### Addresses + + - `POST` [Create address](https://developers.vtex.com/docs/api-reference/document-contracts-api#post-/api/dataentities/ad/documents) + - `GET` [Get address by ID](https://developers.vtex.com/docs/api-reference/document-contracts-api#get-/api/dataentities/ad/documents/-addressid-) + - `PATCH` [Update address](https://developers.vtex.com/docs/api-reference/document-contracts-api#patch-/api/dataentities/ad/documents/-addressid-) + - `DELETE` [Delete address](https://developers.vtex.com/docs/api-reference/document-contracts-api#delete-/api/dataentities/ad/documents/-addressid-) + + > ⚠️ When creating or updating contracts and addresses, you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Calculate promotions.yml b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Calculate promotions.yml new file mode 100644 index 0000000000..2481ac5478 --- /dev/null +++ b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Calculate promotions.yml @@ -0,0 +1,199 @@ +info: + name: Calculate promotions + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/calculatePromotion" + headers: + - name: Content-Type + value: application/json; charset=utf-8 + body: + type: json + data: |- + { + "correlationId": "7f3e2b10-2c5a-4a9e-bf6a-9b9d0c2f1a23", + "customFields": { + "myAppId": { + "giftMessage": "Happy birthday" + } + }, + "origin": "Marketplace", + "shopperProfileId": "da1220f6-88ce-46a2-b466-7f311c5a1bf0", + "salesChannelId": "3", + "couponCodes": [ + "coupon-code-1", + "coupon-code-2" + ], + "utms": null, + "items": [ + { + "id": "792", + "sellerId": "1", + "quantity": 3, + "price": 2, + "catalogInfo": { + "brandId": "23", + "categoryId": "43", + "productId": "55", + "collectionIds": [ + "98", + "11" + ], + "ean": "7891234567890", + "refId": "SKU-ABC-001" + }, + "paymentInfo": [ + { + "id": "34", + "value": 6 + } + ], + "nativePromotionLayer": { + "priceBeforeLayer": 2.5, + "priceAfterLayer": 2, + "appliedPromotions": [ + { + "id": "native-promo-1", + "discount": 0.5, + "type": "Nominal" + } + ] + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/calculatePromotion - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/calculatePromotion - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/calculatePromotion - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/calculatePromotion - Schema is valid", function () { + const schema = {"type":"object","required":["items"],"description":"Response body for the calculate promotions endpoint.","properties":{"items":{"type":"array","description":"List of items with their calculated promotion results.","items":{"type":"object","required":["id","quantity","originalPrice"],"description":"Item in the calculate promotions response.","properties":{"id":{"type":"string","description":"SKU identifier of the item in the shopping cart."},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item in the shopping cart."},"promotions":{"type":["array","null"],"description":"Promotions applied by the external provider to this item. **This is the only field VTEX uses to compute the external discount**: the applied value is `discount` multiplied by this item's `quantity`, and only for promotions whose `id` is also listed in `allPromotions`. Omitting this array — even when `externalPromotionLayer` is populated — means no external discount is applied to the line. When both are present they must describe the same promotions; a mismatch is logged as a warning.","items":{"type":"object","required":["id","discount","type"],"description":"Promotion applied to an item.","properties":{"id":{"type":"string","description":"Identifier of the applied promotion."},"discount":{"type":"number","format":"double","description":"Discount value applied by this promotion."},"type":{"type":"string","enum":["Nominal"],"description":"Type of discount applied. Currently, only `Nominal` is supported."}}}},"originalPrice":{"type":"number","format":"double","description":"Original per-unit price of this line before external deals. In hybrid mode, typically the per-unit price after native promotions (the pre-external price the provider augments). Informational only: VTEX does not derive the discount from this field."},"discountedPrice":{"type":["number","null"],"format":"double","description":"Per-unit price of the item after external promotions are applied. Informational only: VTEX does not derive the discount from this field, it uses `promotions[].discount`."},"externalPromotionLayer":{"type":["object","null"],"description":"Hybrid: how the partner (external) promotion layer changed this line. Informational only — it is used for tracing and reconciliation and never produces a discount by itself; always send the corresponding `promotions` entries. When set, `priceBeforeLayer` SHOULD match `originalPrice` and `priceAfterLayer` SHOULD match `discountedPrice`; VTEX compares them with a tolerance of 0.01 and only logs a warning on divergence, without rejecting the response. Added in protocol v1.1.","required":["priceBeforeLayer","priceAfterLayer"],"properties":{"priceBeforeLayer":{"type":"number","format":"double","description":"Per-unit price before the partner layer (post-native in hybrid)."},"priceAfterLayer":{"type":"number","format":"double","description":"Per-unit price after the partner layer."},"appliedPromotions":{"type":["array","null"],"description":"Partner deals applied in this layer only.","items":{"type":"object","required":["id","discount","type"],"properties":{"id":{"type":"string","description":"Identifier of the applied promotion."},"discount":{"type":"number","format":"double","description":"Per-unit discount applied by this promotion."},"type":{"type":"string","enum":["Nominal"],"description":"Type of discount applied. Currently, only `Nominal` is supported."}}}}}}}}},"allPromotions":{"type":["array","null"],"description":"Catalog of all promotions considered for this shopping cart, including those that were not applied. **Conditionally required**: whenever any `items[].promotions` entry is present, this array must be present and non-empty, otherwise VTEX rejects the whole response. It is also the catalog VTEX iterates to build discounts, so a promotion referenced in `items[].promotions` but missing here produces no discount. Every entry must carry a non-empty `id`.","items":{"type":"object","required":["id","name","description"],"description":"Summary of a promotion.","properties":{"id":{"type":"string","description":"Identifier of the promotion."},"name":{"type":"string","description":"Name of the promotion."},"description":{"type":"string","description":"Description of the promotion."},"couponCode":{"type":["string","null"],"description":"Coupon code that triggers this promotion. Returns `null` if no coupon code triggered the promotion."},"qualificationProgress":{"type":["object","null"],"description":"For **not-yet-unlocked** promotions, structured qualification data VTEX maps to native teasers (\"almost there\" messaging). All properties are optional; omit the object (or send `{}`) when there is no structured progress. Added in protocol v1.1; not present in v1.0.","properties":{"remainingCartWideAmount":{"type":["number","null"],"format":"double","description":"Monetary amount still needed across the whole cart to meet a cart-wide spend threshold (the remaining gap, not the full threshold)."},"orderSubtotalMustExceed":{"type":["number","null"],"format":"double","description":"Cart items-subtotal floor the rule requires (the target threshold)."},"remainingItemQuantity":{"type":["object","null"],"description":"Item/SKU quantity qualification context: optional aggregate and per-SKU rows.","properties":{"totalUnitsRemaining":{"type":["integer","null"],"format":"int32","description":"Aggregate extra units still needed across the qualifying SKU set. Must be a whole number: a fractional value fails deserialization and discards the whole response."},"perSku":{"type":["array","null"],"description":"Per-SKU contribution toward the quantity conditions.","items":{"type":"object","required":["skuId"],"properties":{"skuId":{"type":"string","description":"Cart/catalog line id, aligned with items[].id in the same request."},"unitsInCart":{"type":["integer","null"],"format":"int32","description":"Units of this SKU currently in the cart toward this promotion. Must be a whole number."},"unitsRequiredForPromotion":{"type":["integer","null"],"format":"int32","description":"Units of this SKU required by the rule. Must be a whole number: a fractional value fails deserialization and discards the whole response."},"unitsRemaining":{"type":["integer","null"],"format":"int32","description":"Units of this SKU still needed to satisfy its part of the condition. Must be a whole number: a fractional value fails deserialization and discards the whole response."}}}}}},"minimumRuleQuantity":{"type":["integer","null"],"format":"int32","description":"Minimum qualifying units the rule requires (e.g. buy-N / combo thresholds)."},"contextTotalForQualifyingItems":{"type":["object","null"],"description":"Subtotal value range and item scope for total-value rules.","properties":{"minValue":{"type":["number","null"],"format":"double","description":"Minimum subtotal in cart currency."},"maxValue":{"type":["number","null"],"format":"double","description":"Maximum subtotal bound."},"itemScope":{"type":["string","null"],"enum":["AllItems","IncludeMatchedItems","ExcludeMatchedItems",null],"description":"Which line items' value participates in the subtotal check. Omit the property or send `null` when the rule does not define a scope."}}},"itemUnitPriceBounds":{"type":["object","null"],"description":"Per-unit price band on a line.","properties":{"minPrice":{"type":["number","null"],"format":"double","description":"Minimum per-unit item price for qualification."},"maxPrice":{"type":["number","null"],"format":"double","description":"Maximum per-unit item price for qualification."}}},"skuIdGroups":{"type":["object","null"],"description":"SKUs in scope of the rule. Use `allOf` for a single set; `group1`/`group2` for mix-and-match.","properties":{"allOf":{"type":["array","null"],"items":{"type":"string"},"description":"All listed SKUs participate in a single set."},"group1":{"type":["array","null"],"items":{"type":"string"},"description":"First SKU group in a two-group rule."},"group2":{"type":["array","null"],"items":{"type":"string"},"description":"Second SKU group in a two-group rule."}}},"productCollectionIds":{"type":["array","null"],"items":{"type":"string"},"description":"Collection / cluster ids in scope."},"brandIds":{"type":["array","null"],"items":{"type":"string"},"description":"Brand ids in scope."},"categoryIds":{"type":["array","null"],"items":{"type":"string"},"description":"Category ids in scope."},"zipCodeRangeSegments":{"type":["array","null"],"description":"Delivery CEP/zip gating ranges.","items":{"type":"object","properties":{"from":{"type":"string","description":"Range start, digits only (no mask)."},"to":{"type":"string","description":"Range end, digits only (no mask)."},"inclusivity":{"type":"string","enum":["inclusive","exclusive"],"description":"Whether the shopper's zip is included (`inclusive`) or excluded (`exclusive`)."}}}},"paymentMethodIds":{"type":["array","null"],"items":{"type":"string"},"description":"Payment method ids the shopper must use."},"cardIssuerIds":{"type":["array","null"],"items":{"type":"string"},"description":"Allowed card issuers."},"cardBinPrefixRestrictions":{"type":["array","null"],"items":{"type":"string"},"description":"Card BIN prefix patterns the card number must satisfy."},"minInstallmentCount":{"type":["integer","null"],"format":"int32","description":"Minimum installments required."},"maxInstallmentCount":{"type":["integer","null"],"format":"int32","description":"Maximum installments allowed."},"teaserStyleHints":{"type":["array","null"],"items":{"type":"string","enum":["UpPrice","Profiler","Catalog","ConditionalPrice"]},"description":"UI grouping hints for the teaser message."}}}}}},"nativePromotionRemovals":{"type":["array","null"],"description":"Optional, hybrid-only. Native VTEX promotions the provider asks VTEX to remove from the merged cart result. Absent or empty is a strict no-op (same as the append-only merge). Reference each promotion by the id exposed in `items[].nativePromotionLayer.appliedPromotions[].id`. Only native promotions exposed via `nativePromotionLayer` (price and gift) are removable; unknown, non-applied, or non-removable ids (shipping, tax, reward) and malformed entries are silently ignored and never fail the calculation. Added in protocol v1.1.","items":{"type":"object","required":["promotionId"],"description":"Request to remove an applied native VTEX promotion from the merged result.","properties":{"promotionId":{"type":"string","description":"Native promotion identifier to remove, matching `items[].nativePromotionLayer.appliedPromotions[].id` from the request. Ids that are not applied or not removable are silently ignored."},"scope":{"type":"string","enum":["cartWide","perLine"],"description":"Removal scope. `cartWide` and `perLine` are the canonical values and the only ones providers should send; VTEX additionally tolerates other casings at runtime, but they are not part of this contract and will fail schema validation. Use `cartWide` to remove the promotion from all lines, or `perLine` to remove it only from the cited `lineItemIds`. When omitted, defaults to `cartWide`. For the same `promotionId`, a `cartWide` entry absorbs any `perLine` entries; repeated `perLine` entries union their `lineItemIds`. Unrecognized values are discarded without failing the response."},"lineItemIds":{"type":["array","null"],"description":"Cart item ids (`items[].id`) to strip when `scope` is `perLine`. Required and non-empty for `perLine`; ignored for `cartWide`. Cited lines the promotion did not touch are silently ignored.","items":{"type":"string","description":"Cart item identifier to strip, aligned with `items[].id` in the same calculate promotions call."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Calculates the promotions and discounts applicable to a given shopping cart. VTEX calls this endpoint during the cart calculation process, sending the shopping cart data including items, coupon codes, UTM parameters, and sales channel information. The external promotions provider must return the calculated discounts for each item, along with a summary of all promotions considered. + + This endpoint supports **hybrid** orchestration (protocol v1.1). When an account combines native VTEX promotions with an external provider, VTEX sends the cart **after** native evaluation: see `items[].price` (post-native per-unit price) and the optional per-line `items[].nativePromotionLayer`. The provider may also return `allPromotions[].qualificationProgress` describing promotions the shopper has **not yet unlocked**. + + In hybrid mode, the provider can optionally return `nativePromotionRemovals` to ask VTEX to drop specific applied native promotions (by the ids exposed in `items[].nativePromotionLayer.appliedPromotions[].id`) from the merged result — either cart-wide or for selected lines — instead of only stacking discounts on top of them. Absent or empty `nativePromotionRemovals` is a no-op. + + ## How VTEX derives the discount + + This is the single most important rule of the response contract: + + - The money VTEX applies comes **only** from `items[].promotions[].discount`, multiplied by `items[].quantity`. + - A promotion produces a discount **only** if its `id` is also listed in `allPromotions`. VTEX builds the result by iterating `allPromotions` and matching each entry against `items[].promotions`. + - `originalPrice`, `discountedPrice` and `externalPromotionLayer` are **informational**. They are used for tracing and diagnostics and never produce a discount on their own. Returning `externalPromotionLayer` without the matching `items[].promotions` entries results in **no discount being applied at all**. + + ## Response requirements + + VTEX validates the body before merging it and discards the **entire** response when it is malformed. Specifically: + + - `items` must be present and must not contain `null` entries. + - If any `items[].promotions` is present and non-empty, then `allPromotions` must also be present and non-empty. Item-level promotions without a catalog are rejected. + - Every `allPromotions[].id` and every `items[].promotions[].id` must be a non-empty string. + - Every `items[].id` must match an item id sent in the request. + - Quantity fields under `qualificationProgress` must be whole numbers. A fractional value fails deserialization and discards the response. + + An applied promotion id that is not listed in `allPromotions` is tolerated and does not fail the response, but no discount is produced for it. + + ## Authentication + + VTEX authenticates with an API key sent in a header whose name is configured per account and defaults to `Authorization`, optionally with a prefix such as `Bearer `. VTEX does not send HTTP Basic credentials, and it does not send an `Accept` header. The provider should reject unauthenticated requests with `401 Unauthorized`. + + ## Timeout + + The call times out after 5000 ms by default (configurable per account) and is **not** retried. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. VTEX always sends `application/json; charset=utf-8`. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "id": "792", + "quantity": 3, + "promotions": [ + { + "id": "promo-1", + "discount": 0.25, + "type": "Nominal" + } + ], + "originalPrice": 2, + "discountedPrice": 1.75, + "externalPromotionLayer": { + "priceBeforeLayer": 2, + "priceAfterLayer": 1.75, + "appliedPromotions": [ + { + "id": "promo-1", + "discount": 0.25, + "type": "Nominal" + } + ] + } + } + ], + "allPromotions": [ + { + "id": "promo-1", + "name": "25 cents off on cokes", + "description": "Buy at least 3 cokes and get 25 cents off on each", + "couponCode": "25offCoke" + }, + { + "id": "promo-2", + "name": "Free shipping over $50", + "description": "Spend $50 or more to unlock free shipping", + "couponCode": null, + "qualificationProgress": { + "remainingCartWideAmount": 44, + "orderSubtotalMustExceed": 50, + "teaserStyleHints": [ + "UpPrice" + ] + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Notify promotion usage.yml b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Notify promotion usage.yml new file mode 100644 index 0000000000..187370bbd2 --- /dev/null +++ b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/Notify promotion usage.yml @@ -0,0 +1,63 @@ +info: + name: Notify promotion usage + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/notifyUsage" + headers: + - name: Content-Type + value: application/json; charset=utf-8 + body: + type: json + data: |- + { + "correlationId": "7f3e2b10-2c5a-4a9e-bf6a-9b9d0c2f1a23", + "orderId": "099823581-1", + "type": "NewOrder", + "promotionUsages": [ + { + "promotionId": "promo-1", + "discount": 0.75, + "couponCode": "coupon-code-1" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/notifyUsage - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Receives a notification when an order is created or cancelled, informing the external promotions provider which promotions and coupons were applied to the order. This allows the provider to track promotion usage, enforce usage limits, and maintain accurate promotion state. + + The optional `correlationId` references the `calculatePromotion` evaluation that led to the order, when VTEX can supply it, for end-to-end tracing. Added in protocol v1.1. + + In hybrid mode this notification carries **only the external provider's own promotions**. Native VTEX promotions applied to the same order are filtered out before sending, so `promotionUsages` never contains native ids. When no external promotion applied to the order, VTEX skips the call entirely. + + ## Idempotency + + The call times out after 5000 ms by default and is retried up to 3 times by default, with exponential backoff. The provider may therefore receive the same notification more than once and must process it idempotently, keyed by `orderId` and `type`. VTEX treats any 2xx as success and does not act on the response body. + + ## Authentication + + VTEX authenticates with an API key sent in a header whose name is configured per account and defaults to `Authorization`, optionally with a prefix such as `Bearer `. VTEX does not send HTTP Basic credentials, and it does not send an `Accept` header. The provider should reject unauthenticated requests with `401 Unauthorized`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. VTEX always sends `application/json; charset=utf-8`. | diff --git a/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/folder.yml b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/folder.yml new file mode 100644 index 0000000000..8660cb9a49 --- /dev/null +++ b/BrunoCollections/VTEX - External Promotions Protocol API/External promotions/folder.yml @@ -0,0 +1,4 @@ +info: + name: External promotions + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - External Promotions Protocol API/environments/VTEX.yml b/BrunoCollections/VTEX - External Promotions Protocol API/environments/VTEX.yml new file mode 100644 index 0000000000..5ede517815 --- /dev/null +++ b/BrunoCollections/VTEX - External Promotions Protocol API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: providerApiEndpoint + value: provider.example.com + - name: baseUrl + value: https://{{providerApiEndpoint}} + - name: apiKeyHeaderName + value: Authorization + - name: apiKey + value: "" diff --git a/BrunoCollections/VTEX - External Promotions Protocol API/opencollection.yml b/BrunoCollections/VTEX - External Promotions Protocol API/opencollection.yml new file mode 100644 index 0000000000..94097ceeb0 --- /dev/null +++ b/BrunoCollections/VTEX - External Promotions Protocol API/opencollection.yml @@ -0,0 +1,76 @@ +opencollection: 1.0.0 + +info: + name: VTEX - External Promotions Protocol API + +request: + auth: + type: apikey + key: "{{apiKeyHeaderName}}" + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The External Promotions Protocol API is a set of definitions that allows merchants to integrate their own external promotions engine with the VTEX platform. This is a protocol, which means the merchant must implement the endpoints described in this documentation as a web API (REST) on their own infrastructure. + + ⚠️ In this release the protocol targets accounts using Headless Checkout. Store Framework checkout is out of scope and may adopt the same APIs later. + + VTEX will call these endpoints during the shopping cart calculation and order lifecycle to: + + - Calculate promotions and discounts for a given shopping cart. + - Notify the external promotions provider when an order is created or cancelled, reporting which promotions and coupons were applied. + + ## Promotion sources + + Accounts configure promotions with one of these sources: + + - **Native** — VTEX promotions only (no external provider). + - **Hybrid** — native VTEX promotions run first, then VTEX calls the external provider with the post-native cart so both engines can apply. + + There is no external-only source. When an account integrates an external promotions provider, it always uses the **hybrid** orchestration model. + + >⚠️ This feature is in a closed beta testing phase. If you are interested in participating, open a ticket with the [VTEX Support](https://help.vtex.com/en/support) team. + + ## Authentication + + VTEX authenticates to the provider with an API key sent in an HTTP request header. The header name is configured per account and defaults to `Authorization`; an optional prefix (for example `Bearer `) can be prepended to the key value. Because both the header name and the prefix are configurable, agree on them with VTEX during onboarding. + + VTEX does not send HTTP Basic credentials. The provider should reject unauthenticated requests with `401 Unauthorized`. + + In this collection, set the `apiKey` variable to your key and, if your account uses a header other than `Authorization`, adjust the `apiKeyHeaderName` variable. + + ## Request headers + + VTEX sends `Content-Type: application/json; charset=utf-8` on every call. VTEX does **not** send an `Accept` header, so the provider must not require one. + + ## Timeouts, retries and error handling + + | Endpoint | Timeout | Retries | + | --- | --- | --- | + | `calculatePromotion` | 5000 ms by default, configurable per account. | None. The call is issued once. | + | `notifyUsage` | 5000 ms by default, configurable per account. | Up to 3 by default, with exponential backoff. | + + Because `notifyUsage` is retried, the provider may receive the same notification more than once and must process it idempotently, keyed by `orderId` and `type`. + + When a `calculatePromotion` call fails — timeout, non-2xx status, or a body VTEX cannot validate — the account's error treatment setting decides the outcome: `nativeOnly` keeps the native result and silently drops the external one, `acceptPartial` merges the fragments that validated, and `raiseError` surfaces an error to the caller. Providers should fail fast within the timeout rather than returning a partially built body. + + ## Index + + ### External promotions + + - `POST` [Calculate promotions](https://developers.vtex.com/docs/api-reference/external-promotions-protocol-api#post-/calculatePromotion): calculates the promotions and discounts for a given shopping cart. + - `POST` [Notify promotion usage](https://developers.vtex.com/docs/api-reference/external-promotions-protocol-api#post-/notifyUsage): receives a notification when an order is created or cancelled, informing which promotions and coupons were applied. + + ## Common parameters + + | Parameter name | Description | Type | + | --- | --- | --- | + | `{{providerApiEndpoint}}` | External promotions provider endpoint URL. | Server variable. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Provider/Create or update a gift card provider by ID.yml b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Create or update a gift card provider by ID.yml new file mode 100644 index 0000000000..c4565ae8bc --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Create or update a gift card provider by ID.yml @@ -0,0 +1,107 @@ +info: + name: Create or update a gift card provider by ID + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: customProvider + type: path + body: + type: json + data: |- + { + "serviceUrl": "https://api.vtex.com.br/example", + "oauthProvider": "vtex", + "preAuthEnabled": true, + "cancelEnabled": true, + "appKey": "key", + "appToken": "token", + "id": "customProvider" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/giftcardproviders/:giftCardProviderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/giftcardproviders/:giftCardProviderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/giftcardproviders/:giftCardProviderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/giftcardproviders/:giftCardProviderId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card provider identification."},"serviceUrl":{"type":"string","description":"URL from the provider."},"oauthProvider":{"type":"string","description":"Provider's authentication."},"preAuthEnabled":{"type":"boolean","description":"Related to the pre-authorization that can happen on the transaction generated through the provider."},"cancelEnabled":{"type":"boolean","description":"Indicates whether it is possible to cancel the transaction, generated through the provider."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","items":{"type":"object","description":"Provider route information.","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Create or update a gift card provider from a store. + + > ⚠️ The `appkey` and `apptoken` fields are not mandatory for the native VTEX gift card, only for [external gift card providers](https://developers.vtex.com/updates/release-notes/2024-05-27-changes-in-authentication-requirements-for-external-gift-card-providers). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "customProvider", + "serviceUrl": "https://api.vtex.com.br/basedevmkp", + "oauthProvider": "vtex", + "preAuthEnabled": true, + "cancelEnabled": true, + "_self": { + "href": "cosmetics2/giftcardproviders/customprovider" + } + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Provider/Delete a gift card provider by ID.yml b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Delete a gift card provider by ID.yml new file mode 100644 index 0000000000..a86175cc27 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Delete a gift card provider by ID.yml @@ -0,0 +1,56 @@ +info: + name: Delete a gift card provider by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/giftcardproviders/:giftCardProviderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Delete a gift card provider from a store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Provider/Get a gift card provider by ID.yml b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Get a gift card provider by ID.yml new file mode 100644 index 0000000000..79f37fda38 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Provider/Get a gift card provider by ID.yml @@ -0,0 +1,94 @@ +info: + name: Get a gift card provider by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card provider identification."},"serviceUrl":{"type":"string","description":"URL from the provider."},"oauthProvider":{"type":"string","description":"Provider's authentication."},"caption":{"type":"string","description":"Description about the provider."},"preAuthEnabled":{"type":"boolean","description":"Related to the pre-authorization that can happen on the transaction generated through the provider."},"cancelEnabled":{"type":"boolean","description":"Indicates whether it is possible to cancel the transaction, generated through the provider."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","items":{"type":"object","description":"Provider route information.","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a gift card provider from a store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "GiftCardExample", + "serviceUrl": "https://api.vtex.com.br/basedevmkp", + "oauthProvider": "vtex", + "caption": "My Updated Gift Card Provider", + "preAuthEnabled": true, + "cancelEnabled": true, + "_self": { + "href": "cosmet/giftcardproviders/GiftCardExample" + } + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Provider/List all gift card providers.yml b/BrunoCollections/VTEX - GiftCard Hub API/Provider/List all gift card providers.yml new file mode 100644 index 0000000000..9a9e49f15f --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Provider/List all gift card providers.yml @@ -0,0 +1,105 @@ +info: + name: List all gift card providers + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: REST-Range + value: resources=0-49 + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Gift card providers information.","properties":{"id":{"type":"string","description":"Gift card provider identification."},"serviceUrl":{"type":"string","description":"URL from the provider."},"oauthProvider":{"type":"string","description":"Provider's authentication."},"preAuthEnabled":{"type":"boolean","description":"Related to the pre-authorization that can happen on the transaction generated through the provider."},"cancelEnabled":{"type":"boolean","description":"Indicates whether it is possible to cancel the transaction, generated through the provider."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a collection of gift card providers from a store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | Pagination control. This query variable must follow the format `_resources={from}-{to}_`. | + + ## Example response (`200`) + + ```json + [ + { + "id": "GiftCardExample", + "serviceUrl": "https://api.vtex.com.br/basedevmkp", + "oauthProvider": "vtex", + "preAuthEnabled": true, + "cancelEnabled": true, + "_self": { + "href": "cosmet/giftcardproviders/GiftCardExample" + } + }, + { + "id": "GiftCardExample2", + "serviceUrl": "https://giftcard--cosmetics2.myvtex.com/my-provider", + "oauthProvider": "vtex", + "caption": "My Updated Gift Card Provider", + "preAuthEnabled": true, + "cancelEnabled": true, + "_self": { + "href": "cosmet/giftcardproviders/GiftCardExample2" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Provider/folder.yml b/BrunoCollections/VTEX - GiftCard Hub API/Provider/folder.yml new file mode 100644 index 0000000000..55d948b418 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Provider/folder.yml @@ -0,0 +1,4 @@ +info: + name: Provider + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Cancel a gift card transaction.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Cancel a gift card transaction.yml new file mode 100644 index 0000000000..d4dd11a8fb --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Cancel a gift card transaction.yml @@ -0,0 +1,103 @@ +info: + name: Cancel a gift card transaction + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: "6" + type: path + - name: tId + value: b47690 + type: path + body: + type: json + data: |- + { + "value": 4.1, + "requestId": "12093812masoidj120398" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Schema is valid", function () { + const schema = {"required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a cancellation transaction to a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "7582d93baccc44e9867b0b861696fc0a", + "value": 4.1, + "date": "2019-03-19T14:35:16.7157238Z" + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card at a gift card provider.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card at a gift card provider.yml new file mode 100644 index 0000000000..4a2c734703 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card at a gift card provider.yml @@ -0,0 +1,109 @@ +info: + name: Create a gift card at a gift card provider + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + body: + type: json + data: |- + { + "relationName": "loyalty-program", + "emissionDate": "2020-09-01T13:15:30Z", + "expiringDate": "2020-09-10T13:15:30Z", + "caption": "Loyalty Program", + "restrictedToOwner": false, + "multipleRedemptions": false, + "multipleCredits": false, + "profileId": "92de2449-0e02-4ca9-a4aa-a09cc9d8f7ff", + "currencyCode": "USD" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"emissionDate":{"type":"string","description":"Gift card emission date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"caption":{"type":"string","description":"Field to be filled in if a loyalty program must be created for the gift card."},"provider":{"type":"string","description":"Provider name."},"discount":{"type":"boolean","description":"Deprecated field."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."},"transaction":{"type":"object","description":"Transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The number described in the URL refers to the gift card identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a gift card in a gift card provider. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "38", + "emissionDate": "2023-06-27T17:02:19.17", + "expiringDate": "2023-09-27T17:02:19.17", + "caption": "Loyalty Program", + "provider": "GiftCardExample", + "discount": false, + "currencyCode": "USD", + "transactions": { + "href": "cosmetics2/giftcardproviders/GiftCardExample/giftcards/38/transactions" + } + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card transaction.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card transaction.yml new file mode 100644 index 0000000000..af91e634f7 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Create a gift card transaction.yml @@ -0,0 +1,169 @@ +info: + name: Create a gift card transaction + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: "6" + type: path + body: + type: json + data: |- + { + "operation": "Debit", + "value": 3, + "description": "GiftCardHub", + "redemptionToken": "b2dac6f2-f365-48cd-82a9-0b376a55557a", + "redemptionCode": "***********ASDQ", + "requestId": "B56CBE231DEE4E1A859183C1030CE926", + "orderInfo": { + "orderId": "v5006128str", + "sequence": 5006128, + "cart": { + "items": [ + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + }, + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + } + ], + "grandTotal": 0, + "discounts": -7.5, + "shipping": 7.27, + "taxes": 0, + "itemsTotal": 14.99 + }, + "clientProfile": { + "email": "michael.scott96@mail.com", + "firstName": "Michael", + "lastName": "Scott", + "document": "02906792063", + "phone": "+551111111111", + "birthDate": "0001-01-01T00:00:00", + "isCorporate": false + }, + "shipping": { + "receiverName": "Michael Scott", + "postalCode": "22250040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "111", + "neighborhood": "Botafogo", + "complement": "House", + "reference": "Subway" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"type":"object","properties":{"cardId":{"type":"string","description":"Gift card identification."},"id":{"type":"string","description":"Transaction identification."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction (credit or debit) to a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "cardId": "24", + "id": "68347b311ce5407c90fa5316975d047a", + "_self": { + "href": "gatewayqa/giftcards/24/transactions/68347b311ce5407c90fa5316975d047a" + } + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider by ID.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider by ID.yml new file mode 100644 index 0000000000..7ed6109cc2 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider by ID.yml @@ -0,0 +1,100 @@ +info: + name: Get a gift card from a gift card provider by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: "5" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionToken":{"type":"string","description":"Gift card redemption token."},"redemptionCode":{"type":"string","description":"Gift card identification code used at checkout. Minimum of 6 characters."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be 0.0."},"emissionDate":{"type":"string","description":"Gift card emission date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."},"discount":{"type":"boolean","description":"Deprecated field."},"transactions":{"type":"object","description":"Transactions information.","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a specific gift card from a gift card provider. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5", + "redemptionToken": "32ScL57220Vapb8pc50HJ3mWH1cl1L8x", + "redemptionCode": "***********ASDQ", + "balance": 870, + "emissionDate": "2014-04-24T20:22:58.163", + "expiringDate": "2016-01-01T00:00:00", + "currencyCode": "USD", + "discount": false, + "transactions": { + "href": "cards/954/transactions" + } + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider.yml new file mode 100644 index 0000000000..7c5286df85 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card from a gift card provider.yml @@ -0,0 +1,134 @@ +info: + name: Get a gift card from a gift card provider + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: REST-Range + value: resources=0-49 + disabled: true + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + body: + type: json + data: |- + { + "client": { + "id": "3b1abc17-988e-4a14-8b7f-31fc6a5b955c", + "email": "email@domain.com", + "document": "42151783120" + }, + "cart": { + "grandTotal": 0, + "relationName": "loyalty-program", + "redemptionCode": "***********ASDQ", + "discounts": 20, + "shipping": 2, + "taxes": 0, + "items": [ + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + }, + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + } + ], + "itemsTotal": 200 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/_search - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Gift card information.","properties":{"id":{"type":"string","description":"Gift card identification."},"provider":{"type":"string","description":"Gift card provider name."},"balance":{"type":"number","description":"Gift card current balance."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all gift cards from a gift card provider according to the filters. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | Pagination control. This query variable must follow the format `_resources={from}-{to}_`. | + + ## Example response (`200`) + + ```json + [ + { + "id": "262498", + "provider": "GiftCardExample", + "balance": 45.5, + "_self": { + "href": "cosmet/giftcardproviders/GiftCardExample/giftcards/262498" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction authorization.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction authorization.yml new file mode 100644 index 0000000000..bbeab3407f --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction authorization.yml @@ -0,0 +1,96 @@ +info: + name: Get a gift card transaction authorization + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/authorization" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: 7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70 + type: path + - name: tId + value: jac68316306453f4b8tr3fdb892dfba1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/authorization - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/authorization - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/authorization - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/authorization - Schema is valid", function () { + const schema = {"required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information about a gift card transaction authorization. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "faa6831230634c4b8fb897e02ba9c5a1", + "value": 140, + "date": "2023-06-02T18:24:49.252855Z" + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction by ID.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction by ID.yml new file mode 100644 index 0000000000..f3274e8472 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Get a gift card transaction by ID.yml @@ -0,0 +1,107 @@ +info: + name: Get a gift card transaction by ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: 7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70 + type: path + - name: transactionId + value: jac68316306453f4b8tr3fdb892dfba1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:transactionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"value":{"type":"number","description":"Transaction value."},"description":{"type":"string","description":"Transaction description."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."},"requestId":{"type":"string","description":"VTEX request identifier."},"settlement":{"type":"object","description":"Settlement transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"cancellation":{"type":"object","description":"Cancellation transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"authorization":{"type":"object","description":"Authorization transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"operation":{"type":"string","description":"Operation information (`Credit` or `Debit`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a specific transaction from a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": 140, + "description": "GiftCardHub", + "date": "2023-06-02T18:24:49.252855Z", + "requestId": "3", + "settlement": { + "href": "cosmetics2/giftcardproviders/GiftCardExample3/giftcards/7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70/transactions/jac68316306453f4b8tr3fdb892dfba1/settlements" + }, + "cancellation": { + "href": "cosmetics2/giftcardproviders/GiftCardExample3/giftcards/7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70/transactions/jac68316306453f4b8tr3fdb892dfba1/cancellations" + }, + "authorization": { + "href": "cosmetics2/giftcardproviders/GiftCardExample3/giftcards/7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70/transactions/jac68316306453f4b8tr3fdb892dfba1/authorization" + }, + "operation": "Credit" + } + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions cancellations.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions cancellations.yml new file mode 100644 index 0000000000..f7db071dfd --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions cancellations.yml @@ -0,0 +1,103 @@ +info: + name: List all gift card transactions cancellations + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: 7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70 + type: path + - name: tId + value: jac68316306453f4b8tr3fdb892dfba1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/cancellations - Schema is valid", function () { + const schema = {"required":["oid","value","date"],"type":"array","items":{"type":"object","description":"Transaction information.","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions cancelled for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "1248f9b9d4564792b64013bba27151f2", + "value": 30, + "date": "2023-06-02T18:24:49.252855Z" + }, + { + "oid": "8cb71c9e893A67E1b94d9b2ba15d102F", + "value": 5, + "date": "2023-06-08T11:30:00.252855Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions settlements.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions settlements.yml new file mode 100644 index 0000000000..888982679e --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions settlements.yml @@ -0,0 +1,103 @@ +info: + name: List all gift card transactions settlements + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: 7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70 + type: path + - name: tId + value: jac68316306453f4b8tr3fdb892dfba1 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Schema is valid", function () { + const schema = {"required":["oid","value","date"],"type":"array","items":{"type":"object","description":"Transaction information.","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions settlements for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "faa6831230634c4b8fb897e02ba9c5a1", + "value": 15, + "date": "2023-06-02T18:24:49.252855Z" + }, + { + "oid": "hbar6832580652c4b8fb653f15ba9c5a7", + "value": 40, + "date": "2023-06-04T15:00:35.252855Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions.yml new file mode 100644 index 0000000000..d27cb793ea --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/List all gift card transactions.yml @@ -0,0 +1,103 @@ +info: + name: List all gift card transactions + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: 7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Transaction information.","properties":{"cardId":{"type":"string","description":"Gift card identification."},"id":{"type":"string","description":"Transaction identification."},"_self":{"type":"object","description":"Object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the IDs of all transactions performed on a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **View Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "cardId": "7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70", + "id": "jac68316306453f4b8tr3fdb892dfba1", + "_self": { + "href": "cosmetics2/giftcardproviders/GiftCardExample3/giftcards/7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70/transactions/jac68316306453f4b8tr3fdb892dfba1" + } + }, + { + "cardId": "7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70", + "id": "g4a348e1d1f146ba25e19bb016cc6f18", + "_self": { + "href": "cosmetics2/giftcardproviders/GiftCardExample3/giftcards/7d1dfc17-989e-4t21-8b7f-5103c6a5b925c_70/transactions/g4a348e1d1f146ba25e19bb016cc6f18" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Settle a gift card transaction.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Settle a gift card transaction.yml new file mode 100644 index 0000000000..19e4717f23 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/Settle a gift card transaction.yml @@ -0,0 +1,105 @@ +info: + name: Settle a gift card transaction + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardProviderId + value: GiftCardExample + type: path + - name: giftCardId + value: "6" + type: path + - name: tId + value: b47690 + type: path + body: + type: json + data: |- + { + "value": 1.8, + "requestId": "12093812masoidj120398" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/giftcardproviders/:giftCardProviderId/giftcards/:giftCardId/transactions/:tId/settlements - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["oid","value","date"],"type":"object","description":"Transaction information.","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date information."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction settlement for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Edit Gift Card providers** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardProviderId` | path | (Required) Gift card provider identification. | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "e122ebd4501a4b3b93640b7444ac425d", + "value": 1.8, + "date": "2019-03-18T14:42:32.1291783Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - GiftCard Hub API/Transaction/folder.yml b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/folder.yml new file mode 100644 index 0000000000..8b60228eb1 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/Transaction/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transaction + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - GiftCard Hub API/environments/VTEX.yml b/BrunoCollections/VTEX - GiftCard Hub API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - GiftCard Hub API/opencollection.yml b/BrunoCollections/VTEX - GiftCard Hub API/opencollection.yml new file mode 100644 index 0000000000..b0172464b1 --- /dev/null +++ b/BrunoCollections/VTEX - GiftCard Hub API/opencollection.yml @@ -0,0 +1,58 @@ +opencollection: 1.0.0 + +info: + name: VTEX - GiftCard Hub API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ Check the new [Payments onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey. + + The Gift Card Hub API allows interactions with all Gift card providers registered to a store from a single point. + + Gift card providers are systems capable of providing cards to be used in the buying process. + + The following is the sequence diagram that represents calls in the purchase closing process. + ![](https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/gift-card-integration-guide-provider-protocol-0.png) + + **Checkout + Gateway**: Systems responsible for the sale and for processing orders and payments. + + **Gift Card Hub**: System responsible for managing multiple registered Gift card providers for a store. + + **Gift Card Provider**: System responsible for providing the Gift cards available to the user not closing a purchase. This system can be implemented by third parties. + + ## Gift card Hub API Index + + ### Provider + + - `PUT` [Create or update a gift card provider by ID](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#put-/api/giftcardproviders/-giftCardProviderId-) + - `GET` [Get a gift card provider by ID](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-) + - `GET` [List all gift card providers](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders) + - `DELETE` [Delete a gift card provider by ID](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#delete-/api/giftcardproviders/-giftCardProviderId-) + + ### Transaction + + - `POST` [Create a gift card at a gift card provider](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#post-/api/giftcardproviders/-giftCardProviderId-/giftcards) + - `POST` [Get a gift card from a gift card provider](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#post-/api/giftcardproviders/-giftCardProviderId-/giftcards/_search) + - `GET` [Get a gift card from a gift card provider by ID](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-) + - `POST` [Create a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#post-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction by ID](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-transactionId-) + - `GET` [List all gift card transactions](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction authorization](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-tId-/authorization) + - `POST` [Cancel a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#post-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-tId-/cancellations) + - `GET` [List all gift card transactions cancellations](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-tId-/cancellations) + - `POST` [Settle a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#post-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-tId-/settlements) + - `GET` [List all gift card transactions settlements](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#get-/api/giftcardproviders/-giftCardProviderId-/giftcards/-giftCardId-/transactions/-tId-/settlements) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Giftcard API/Gift Card/Create a gift card.yml b/BrunoCollections/VTEX - Giftcard API/Gift Card/Create a gift card.yml new file mode 100644 index 0000000000..7d8098f314 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Gift Card/Create a gift card.yml @@ -0,0 +1,116 @@ +info: + name: Create a gift card + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/giftcards" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "relationName": "loyalty-program", + "expiringDate": "2020-09-01T13:15:30Z", + "caption": "rewards program", + "profileId": "92de2449-0e02-4ca9-a4aa-a09cc9d8f7ff", + "currencyCode": "USD", + "restrictedToOwner": false, + "multipleCredits": false, + "multipleRedemptions": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards - Schema is valid", function () { + const schema = {"type":"object","description":"Gift card information.","required":["id","redemptionToken","redemptionCode","balance","relationName","emissionDate","expiringDate","caption","transactions"],"properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionToken":{"type":"string","description":"Gift card redemption token."},"redemptionCode":{"type":"string","description":"Gift card identification code used at checkout. Minimum of 6 characters."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be 0.0."},"relationName":{"type":"string","description":"Field to be filled in when it is not necessary to use a loyalty program for the gift card. Note that a new `relationNamevalue` is required for each new gift card to be created."},"emissionDate":{"type":"string","description":"Gift card creation date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"caption":{"type":"string","description":"Field to be filled in if a loyalty program must be created for the Gift Card."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."},"transactions":{"type":"object","description":"Transactions information.","required":["href"],"properties":{"href":{"type":"string","description":"Gift card resource URL. The number described in the URL refers to the gift card identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a gift card for a specific user. + + >⚠️ The `redemptionCode` field is auto-generated during gift card creation and cannot be set to an arbitrary value. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "954", + "redemptionToken": "32ScL57220Vapb8pc50HJ3mWH1cl1L8x", + "redemptionCode": "***********ASDQ", + "balance": 0, + "relationName": "cardName", + "emissionDate": "2014-04-24T20:22:58.163", + "expiringDate": "2016-01-01T00:00:00", + "caption": "Programa Vtex Fidelidade", + "currencyCode": "USD", + "transactions": { + "href": "cards/954/transactions" + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Gift Card/Get a gift card by ID.yml b/BrunoCollections/VTEX - Giftcard API/Gift Card/Get a gift card by ID.yml new file mode 100644 index 0000000000..046febf20f --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Gift Card/Get a gift card by ID.yml @@ -0,0 +1,103 @@ +info: + name: Get a gift card by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "2" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId - Schema is valid", function () { + const schema = {"required":["id","redemptionToken","redemptionCode","balance","emissionDate","expiringDate","transactions"],"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionToken":{"type":"string","description":"Gift card redemption token."},"redemptionCode":{"type":"string","description":"Gift card identification code used at checkout. Minimum of 6 characters."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be 0.0."},"emissionDate":{"type":"string","description":"Gift card creation date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."},"transactions":{"type":"object","description":"Transactions information.","required":["href"],"properties":{"href":{"type":"string","description":"Gift card resource URL. The number described in the URL refers to the gift card identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "954", + "redemptionToken": "32ScL57220Vapb8pc50HJ3mWH1cl1L8x", + "redemptionCode": "***********ASDQ", + "balance": 0, + "emissionDate": "2014-04-24T20:22:58.163", + "expiringDate": "2016-01-01T00:00:00", + "currencyCode": "USD", + "transactions": { + "href": "cards/954/transactions" + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Gift Card/List all gift cards.yml b/BrunoCollections/VTEX - Giftcard API/Gift Card/List all gift cards.yml new file mode 100644 index 0000000000..d07ae6b831 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Gift Card/List all gift cards.yml @@ -0,0 +1,162 @@ +info: + name: List all gift cards + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/giftcards/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: REST-Range + value: resources=0-49 + disabled: true + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "cart": { + "grandTotal": 182, + "relationName": null, + "redemptionCode": "BAHD-ASDB-ADQW-ASDQ", + "discounts": 20, + "shipping": 2, + "taxes": 0, + "items": [ + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + }, + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + } + ], + "itemsTotal": 200 + }, + "client": { + "id": "3b1abc17", + "email": "email@domain.com", + "document": "234235" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/_search - Schema is valid", function () { + const schema = {"type":"object","description":"Items information.","required":["items","paging"],"properties":{"items":{"type":"array","items":{"type":"object","description":"Item information.","required":["id","_self"],"properties":{"id":{"type":"string","description":"Item identification."},"_self":{"type":"object","description":"Object that carries an auto reference of the transaction (on its API).","required":["href"],"properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}}}},"description":"Items information."},"paging":{"type":"object","description":"Paging information.","required":["page","perPage","total","pages"],"properties":{"page":{"type":"integer","description":"Page number of the gift card list."},"perPage":{"type":"integer","description":"Quantity of gift cards per page."},"total":{"type":"integer","description":"Total of gift cards in the store."},"pages":{"type":"integer","description":"Total number of pages."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of all gift cards available for a specific customer's cart. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | Pagination control. This query variable must follow the format _resources={from}-{to}_. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "id": "589", + "_self": { + "href": "cards/589" + } + }, + { + "id": "590", + "_self": { + "href": "cards/590" + } + }, + { + "id": "591", + "_self": { + "href": "cards/591" + } + }, + { + "id": "592", + "_self": { + "href": "cards/592" + } + } + ], + "paging": { + "page": 0, + "perPage": 10, + "total": 4, + "pages": 1 + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Gift Card/folder.yml b/BrunoCollections/VTEX - Giftcard API/Gift Card/folder.yml new file mode 100644 index 0000000000..c5b259ac88 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Gift Card/folder.yml @@ -0,0 +1,4 @@ +info: + name: Gift Card + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/Cancel a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/Cancel a gift card transaction.yml new file mode 100644 index 0000000000..b1d28c39e8 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/Cancel a gift card transaction.yml @@ -0,0 +1,111 @@ +info: + name: Cancel a gift card transaction + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b476900c + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "value": 17.4, + "requestId": "6360f98eb0cf6fd5afa77e39bba8c20fe5807d8c" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Schema is valid", function () { + const schema = {"type":"object","description":"Transaction information.","required":["oid","value","date"],"properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request can be used to: + + 1. Cancel a transaction for a specific gift card. + + 2. Cancel an item's reservation or create a refund. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "239d35b430fc75379db966c1d3670c6f", + "value": 17.4, + "date": "2016-04-06T00:00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/Create a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/Create a gift card transaction.yml new file mode 100644 index 0000000000..5595a540a0 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/Create a gift card transaction.yml @@ -0,0 +1,184 @@ +info: + name: Create a gift card transaction + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "7" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "operation": "Debit", + "value": 3, + "description": "GiftCardHub", + "redemptionToken": "b2dac6f2-f365-48cd-82a9-0b376a55557a", + "redemptionCode": "***********ASDQ", + "requestId": "B56CBE231DEE4E1A859183C1030CE926", + "orderInfo": { + "orderId": "v5006128str", + "sequence": 5006128, + "cart": { + "items": [ + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": [ + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + }, + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + ] + }, + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": [ + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + }, + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + ] + } + ], + "grandTotal": 0, + "discounts": -7.5, + "shipping": 7.27, + "taxes": 0, + "itemsTotal": 14.99 + }, + "clientProfile": { + "email": "michael.scott96@mail.com", + "firstName": "Michael", + "lastName": "Scott", + "document": "02906792063", + "phone": "+551111111111", + "birthDate": "0001-01-01T00:00:00", + "isCorporate": false + }, + "shipping": { + "receiverName": "Michael Scott", + "postalCode": "22250040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "111", + "neighborhood": "Botafogo", + "complement": "House", + "reference": "Subway" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"type":"object","description":"Transaction information.","required":["id","_self"],"properties":{"id":{"type":"string","description":"Transaction identification."},"_self":{"type":"object","description":"Object that carries an auto reference of the transaction (on its API).","required":["href"],"properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction (credit or debit) to a gift card and authorize the item reservation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2541", + "_self": { + "href": "providers/VtexGiftCardProvider/cards/890/transactions/2451" + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction authorization.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction authorization.yml new file mode 100644 index 0000000000..ef29cf421c --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction authorization.yml @@ -0,0 +1,100 @@ +info: + name: Get a gift card transaction authorization + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/authorization" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Schema is valid", function () { + const schema = {"type":"object","description":"Transaction information.","required":["oid","value","date"],"properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information about a gift card transaction authorization. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "7cf8d7970e1c81d05620e46cceb6819f", + "value": 123.4, + "date": "2016-01-01T00:00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction by ID.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction by ID.yml new file mode 100644 index 0000000000..445388b6f1 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/Get a gift card transaction by ID.yml @@ -0,0 +1,111 @@ +info: + name: Get a gift card transaction by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Schema is valid", function () { + const schema = {"type":"object","description":"Transaction information.","properties":{"value":{"type":"number","description":"Transaction value."},"description":{"type":"string","description":"Transaction description."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."},"requestId":{"type":"string","description":"VTEX request identifier."},"settlement":{"type":"object","description":"Settlement transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"cancellation":{"type":"object","description":"Cancellation transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"authorization":{"type":"object","description":"Authorization transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"operation":{"type":"string","description":"Operation information (`credit` or `debit`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a specific transaction for a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": 140, + "description": "GiftCardHub", + "date": "2023-06-02T18:24:49.252855Z", + "requestId": "3", + "settlement": { + "href": "/cosmetics2/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_70/transactions/faa6831230634c4b8fb897e02ba9c5a1/settlements" + }, + "cancellation": { + "href": "/cosmetics2/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_70/transactions/faa6831230634c4b8fb897e02ba9c5a1/cancellations" + }, + "authorization": { + "href": "/cosmetics2/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_70/transactions/faa6831230634c4b8fb897e02ba9c5a1/authorization" + }, + "operation": "Credit" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions cancellations.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions cancellations.yml new file mode 100644 index 0000000000..69f36bad0b --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions cancellations.yml @@ -0,0 +1,107 @@ +info: + name: List all gift card transactions cancellations + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Transaction information.","required":["oid","value","date"],"properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions cancelled for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "239d35b430fc75379db966c1d3670c6f", + "value": 13.4, + "date": "2016-04-06T00:00:00" + }, + { + "oid": "49f0bad299687c62334182178bfd75d8", + "value": 10.4, + "date": "2016-05-06T00:00:00" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions settlements.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions settlements.yml new file mode 100644 index 0000000000..2200784165 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions settlements.yml @@ -0,0 +1,107 @@ +info: + name: List all gift card transactions settlements + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "7" + type: path + - name: transactionId + value: b47690 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Transaction information.","required":["oid","value","date"],"properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions settlements for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "b8e0c606b2fe543e5b0e639575cd9723", + "value": 17.4, + "date": "2016-04-06T00:00:00" + }, + { + "oid": "6cb6cd63c16e219b1eee61f2", + "value": 10.4, + "date": "2016-05-06T00:00:00" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions.yml new file mode 100644 index 0000000000..ba89087dcd --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/List all gift card transactions.yml @@ -0,0 +1,111 @@ +info: + name: List all gift card transactions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "2" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Transaction information.","required":["id","_self"],"properties":{"id":{"type":"string","description":"Transaction identification."},"_self":{"type":"object","description":"Object that carries an auto reference of the transaction (on its API).","required":["href"],"properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the IDs of all transactions performed on a gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "268", + "_self": { + "href": "cards/890/transactions/268" + } + }, + { + "id": "269", + "_self": { + "href": "cards/890/transactions/269" + } + }, + { + "id": "270", + "_self": { + "href": "cards/890/transactions/270" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/Settle a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/Settle a gift card transaction.yml new file mode 100644 index 0000000000..f82b53cde8 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/Settle a gift card transaction.yml @@ -0,0 +1,107 @@ +info: + name: Settle a gift card transaction + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "value": 17.4, + "requestId": "6360f98eb0cf6fd5afa77e39bba8c20fe5807d8c" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/settlements - Schema is valid", function () { + const schema = {"type":"object","description":"Transaction information.","required":["oid","value","date"],"properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction settlement for a specific gift card. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | GiftCard | GiftCard | **Gift card full access** | + + There 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 authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "b8e0c606b2fe543e5b0e639575cd9723", + "value": 17.4, + "date": "2016-04-06T00:00:00" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard API/Transactions/folder.yml b/BrunoCollections/VTEX - Giftcard API/Transactions/folder.yml new file mode 100644 index 0000000000..c6b7a452de --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/Transactions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transactions + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Giftcard API/environments/VTEX.yml b/BrunoCollections/VTEX - Giftcard API/environments/VTEX.yml new file mode 100644 index 0000000000..decfdf1670 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Giftcard API/opencollection.yml b/BrunoCollections/VTEX - Giftcard API/opencollection.yml new file mode 100644 index 0000000000..77246056ca --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard API/opencollection.yml @@ -0,0 +1,75 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Giftcard API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey. + + The gift card is a payment method configured as a cash value associated with a client. It is used to grant a discount on the value of the order at the store. A gift card works as a **payment method**, **not a promotion**. + + In VTEX's native gift card system, you can choose to create a new gift card either through [Admin VTEX](https://help.vtex.com/en/tutorial/gift-card--tutorials_995) or [API](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards). However, there are specific conditions to be observed when generating gift cards by one of these two methods. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationsAdmin VTEXGiftCard API
Initial valueYou can create gift cards value with any value.All gift cards are generated with no value (balance = 0). After its creation, you need to use Admin VTEX or the Create a gift card transaction to add any balance amount.
Ownership restrictionYou can create gift cards with or without a user assigned to them.All gift cards must be created with a profileId associated to them.
User data identificationCustomer ID (data that identifies a specific client, such as CPF/CNPJ in Brazil).profileId (data that identifies a specific client)
Additional SettingsYou can use checkboxes to select whether a gift card will be: Restricted (only a specific customer ID can use this gift card), Reloadable (balance can be changed while it is still active), or Reusable (available for making new purchases with this gift card until its value is completely used up).You can use the following fields to configure the same conditions applied in Admin: restrictedToOwner, multipleCredits, and multipleRedemptions.
+ + >⚠️ All Giftcard API endpoints are limited to 500 concurrent requests and 5000 requests per minute. + + ## Giftcard API Index + + ### Gift Card + + - `POST` [Create a gift card](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards) + - `GET` [Get a gift card by ID](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-) + - `POST` [List all gift cards](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards/_search) + + ### Transaction + + - `POST` [Create a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction by ID](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-/transactions/-transactionId-) + - `GET` [List all gift card transactions](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction authorization](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-/transactions/-transactionId-/authorization) + - `POST` [Cancel a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards/-giftCardId-/transactions/-transactionId-/cancellations) + - `GET` [List all gift card transactions cancellations](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-/transactions/-transactionId-/cancellations) + - `POST` [Settle a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards/-giftCardId-/transactions/-transactionId-/settlements) + - `GET` [List all gift card transactions settlements](https://developers.vtex.com/docs/api-reference/giftcard-api#get-/giftcards/-giftCardId-/transactions/-transactionId-/settlements) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Create a gift card.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Create a gift card.yml new file mode 100644 index 0000000000..f4265fd556 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Create a gift card.yml @@ -0,0 +1,98 @@ +info: + name: Create a gift card + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/giftcards" + headers: + - name: Content-Type + value: application/vnd.vtex.giftcards.v1+json + - name: Accept + value: application/vnd.vtex.giftcards.v1+json + body: + type: json + data: |- + { + "relationName": "loyalty-program", + "caption": "Loyalty program", + "profileId": "92de2249-0e02-4ca9-a4aa-a09cc9d8f7ff", + "emissionDate": "2020-08-01T13:15:30Z", + "expiringDate": "2020-09-01T13:15:30Z", + "restrictedToOwner": true, + "multipleRedemptions": true, + "multipleCredits": true, + "currencyCode": "USD" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"relationName":{"type":"string","description":"Field to be filled in when it is not necessary to use a loyalty program for the gift card. Note that a new `relationNamevalue` is required for each new gift card to be created."},"emissionDate":{"type":"string","description":"Gift card creation date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"caption":{"type":"string","description":"Field to be filled in if a loyalty program must be created for the Gift Card."},"restrictedToOwner":{"type":"boolean","description":"The gift card can only be used for a specified client's ID."},"multipleRedemptions":{"type":"boolean","description":"The gift card can be used to make new purchases until its value is completely used."},"multipleCredits":{"type":"boolean","description":"The gift card balance can be changed."},"profileId":{"type":"string","description":"Client ID. You can use the customer's registered email or the `userId` parameter which can be found in the [Master Data](https://help.vtex.com/en/tutorial/master-data--4otjBnR27u4WUIciQsmkAw)."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a gift card for a specific user in a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "38", + "relationName": "loyalty-program", + "emissionDate": "2011-02-04T17:02:19.17", + "expiringDate": "2020-02-04T17:02:19.17", + "caption": "Loyalty Program", + "restrictedToOwner": true, + "multipleRedemptions": true, + "multipleCredits": true, + "profileId": "92de2449-0e02-4ca9-a4aa-a09cc9d8f7ff", + "currencyCode": "USD" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Get a gift card by ID.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Get a gift card by ID.yml new file mode 100644 index 0000000000..0d2c6b64ce --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/Get a gift card by ID.yml @@ -0,0 +1,92 @@ +info: + name: Get a gift card by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId" + headers: + - name: Content-Type + value: application/vnd.vtex.giftcards.v1+json + - name: Accept + value: application/vnd.vtex.giftcards.v1+json + params: + - name: giftCardId + value: "5" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionToken":{"type":"string","description":"Gift card redemption token."},"redemptionCode":{"type":"string","description":"Gift card identification code used at checkout. Minimum of 6 characters."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be 0.0."},"emissionDate":{"type":"string","description":"Gift card creation date."},"expiringDate":{"type":"string","description":"Gift card expiration date."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217."},"discount":{"type":"boolean","description":"Discount information."},"transactions":{"type":"object","description":"Transactions information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The number described in the URL refers to the gift card identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information for a specific gift card from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + > ℹ️ This endpoint must respond to the flow triggered by the [Add payment data](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/attachments/paymentData) endpoint within 1.5 seconds. If the response time exceeds 1.5 seconds, the Checkout UI will show an error message stating that the gift card is invalid. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5", + "redemptionToken": "32ScL57220Vapb8pc50HJ3mWH1cl1L8x", + "redemptionCode": "***********ASDQ", + "balance": 870, + "emissionDate": "2014-04-24T20:22:58.163", + "expiringDate": "2016-01-01T00:00:00", + "currencyCode": "USD", + "discount": false, + "transactions": { + "href": "cards/954/transactions" + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/List all gift cards.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/List all gift cards.yml new file mode 100644 index 0000000000..9c2486be0e --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/List all gift cards.yml @@ -0,0 +1,131 @@ +info: + name: List all gift cards + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/giftcards/_search" + headers: + - name: Content-Type + value: application/vnd.vtex.giftcards.v1+json + - name: Accept + value: application/vnd.vtex.giftcards.v1+json + - name: REST-Range + value: resources=0-49 + disabled: true + body: + type: json + data: |- + { + "client": { + "id": "3b1abc17", + "email": "email@domain.com", + "document": "234235" + }, + "cart": { + "grandTotal": 182, + "relationName": null, + "redemptionCode": "BAHD-ASDB-ADQW-ASDQ", + "discounts": 20, + "shipping": 2, + "taxes": 0, + "items": [ + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + }, + { + "productId": "2000000", + "id": "2000002", + "refId": "MEV41", + "name": "Shoes", + "price": 200, + "quantity": 1 + } + ], + "itemsTotal": 200 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/_search - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"Response information.","required":["id","provider","balance","_self"],"type":"object","properties":{"id":{"type":"string","description":"Gift card identification."},"provider":{"type":"string","description":"Provider's name."},"balance":{"type":"number","description":"Gift card current balance."},"_self":{"required":["href"],"type":"object","description":"It is an object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of all gift cards available from a gift card provider for a specific customer's cart. + + For scenarios in which there is a gift card with no balance associated with the customer, the payment provider must choose one of the options below to display the information in the response body and implement it on the endpoint: + + + - Response body returns the complete gift card data mentioning the balance field equal to 0 (`"balance": 0`): In this option, whenever the customer has associated a gift card without a balance, they will need to log in to the store to access the balance information. + + - The response body only returns an empty array (`[]`): The customer does not need to log in to the store to access balance information when they have a gift card with no balance associated with it. + + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | Pagination control. This query variable must follow the format _resources={from}-{to}_. | + + ## Example response (`200`) + + ```json + [ + { + "id": "3ad63br54-988e-4a14-8b7f-31fc6a5b955c_24", + "provider": "ProviderName", + "balance": 5.9, + "_self": { + "href": "/gatewayqa/giftcards/3ad63br54-988e-4a14-8b7f-31fc6a5b955c_24" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/folder.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/folder.yml new file mode 100644 index 0000000000..5b44653606 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Gift Cards/folder.yml @@ -0,0 +1,4 @@ +info: + name: Gift Cards + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Cancel a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Cancel a gift card transaction.yml new file mode 100644 index 0000000000..7a805e873d --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Cancel a gift card transaction.yml @@ -0,0 +1,97 @@ +info: + name: Cancel a gift card transaction + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b476900c + type: path + body: + type: json + data: |- + { + "value": 4.1, + "requestId": "12093812masoidj120398" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Schema is valid", function () { + const schema = {"description":"Transaction response information.","required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date information."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request can be used to: + + 1. Cancel a transaction for a specific gift card in a gift card provider. + + 2. Cancel an item's reservation or create a refund. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "7582d93baccc44e9867b0b861696fc0a", + "value": 4.1, + "date": "2019-03-19T14:35:16.7157238Z" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Create a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Create a gift card transaction.yml new file mode 100644 index 0000000000..3b641436b1 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Create a gift card transaction.yml @@ -0,0 +1,171 @@ +info: + name: Create a gift card transaction + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "2" + type: path + body: + type: json + data: |- + { + "operation": "Debit", + "value": 3, + "description": "GiftCardHub", + "redemptionToken": "b2dac6f2-f365-48cd-82a9-0b376a55557a", + "redemptionCode": "***********ASDQ", + "requestId": "B56CBE231DEE4E1A859183C1030CE926", + "orderInfo": { + "orderId": "v500", + "sequence": 5006128, + "cart": { + "items": [ + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": [ + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + }, + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + ] + }, + { + "id": "2001023", + "productId": "2000492", + "refId": "35994", + "name": "Vaporizador Des. ColC4nia Branco", + "value": 14.99, + "price": 14.99, + "quantity": 1, + "shippingDiscount": 0, + "discount": -7.5, + "priceTags": [ + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + }, + { + "name": "discount@price-discount_store_183#4911bf6f-22a2-4af1-a365-cce895c3df2c", + "value": 0 + } + ] + } + ], + "grandTotal": 0, + "discounts": -7.5, + "shipping": 7.27, + "taxes": 0, + "itemsTotal": 14.99 + }, + "clientProfile": { + "email": "michael.scott96@mail.com", + "firstName": "Michael", + "lastName": "Scott", + "document": "02906792063", + "phone": "+551111111111", + "birthDate": "0001-01-01T00:00:00", + "isCorporate": false + }, + "shipping": { + "receiverName": "Michael Scott", + "postalCode": "22250040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "111", + "neighborhood": "Botafogo", + "complement": "House", + "reference": "Subway" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"description":"Gift card transaction response information.","required":["cardId","id","_self"],"type":"object","properties":{"cardId":{"type":"string","description":"Gift card identification."},"id":{"type":"string","description":"Transaction identification."},"_self":{"required":["href"],"type":"object","description":"It is an object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction (credit or debit) for a gift card in a gift card provider and authorizes the item reservation. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "cardId": "24", + "id": "68347b311ce5407c90fa5316975d047a", + "_self": { + "href": "gatewayqa/giftcards/24/transactions/68347b311ce5407c90fa5316975d047a" + } + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction authorization.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction authorization.yml new file mode 100644 index 0000000000..d39bad5dab --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction authorization.yml @@ -0,0 +1,86 @@ +info: + name: Get a gift card transaction authorization + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/authorization" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/authorization - Schema is valid", function () { + const schema = {"description":"Transaction response information.","required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date information."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information about a gift card transaction authorization from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "e122ebd4501a4b3b93640b7444ac425d", + "value": 5.92, + "date": "2019-03-18T14:42:32.1291783Z" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction by ID.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction by ID.yml new file mode 100644 index 0000000000..56f3b1512e --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Get a gift card transaction by ID.yml @@ -0,0 +1,96 @@ +info: + name: Get a gift card transaction by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId - Schema is valid", function () { + const schema = {"type":"object","properties":{"value":{"type":"number","description":"Transaction value."},"description":{"type":"string","description":"Transaction description."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."},"requestId":{"type":"string","description":"VTEX request identifier."},"settlement":{"type":"object","description":"Settlement transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"cancellation":{"type":"object","description":"Cancellation transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"authorization":{"type":"object","description":"Authorization transaction information.","properties":{"href":{"type":"string","description":"Gift card resource URL. The first number described in the URL refers to the gift card identification. The second number, refers to the transaction identification."}}},"operation":{"type":"string","description":"Operation information (`Credit` or `Debit`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a specific transaction for a gift card from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": 140, + "description": "GiftCardProvider1", + "date": "2023-06-02T18:24:49.252855Z", + "settlement": { + "href": "/gatewayqa/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24/transactions/e122ebd4501a4b3b93640b7444ac425d/settlements" + }, + "cancellation": { + "href": "/gatewayqa/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24/transactions/e122ebd4501a4b3b93640b7444ac425d/cancellations" + }, + "authorization": { + "href": "/gatewayqa/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24/transactions/e122ebd4501a4b3b93640b7444ac425d/authorization" + }, + "operation": "Debit" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions cancellations.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions cancellations.yml new file mode 100644 index 0000000000..db948d02c4 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions cancellations.yml @@ -0,0 +1,88 @@ +info: + name: List all gift card transactions cancellations + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:transactionId/cancellations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "6" + type: path + - name: transactionId + value: b47690 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:transactionId/cancellations - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"Transaction response information.","required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date information."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions cancelled for a specific gift card from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "7582d93baccc44e9867b0b861696fc0a", + "value": 4.1, + "date": "2019-03-19T14:35:16.7157238Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions settlements.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions settlements.yml new file mode 100644 index 0000000000..edb04bec81 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions settlements.yml @@ -0,0 +1,93 @@ +info: + name: List all gift card transactions settlements + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:tId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "7" + type: path + - name: tId + value: 3146f46162f042f483cd3979ba4e8317 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions/:tId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:tId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:tId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions/:tId/settlements - Schema is valid", function () { + const schema = {"required":["oid","value","date"],"type":"array","description":"Array containing gift card transactions settlements information.","items":{"type":"object","description":"Payment rules information.","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date of the transaction in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all transactions settlements for a specific gift card from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "oid": "faa6831230634c4b8fb897e02ba9c5a1", + "value": 15, + "date": "2023-06-02T18:24:49.252855Z" + }, + { + "oid": "hbar6832580652c4b8fb653f15ba9c5a7", + "value": 40, + "date": "2023-06-04T15:00:35.252855Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions.yml new file mode 100644 index 0000000000..d3c07ec5a4 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/List all gift card transactions.yml @@ -0,0 +1,93 @@ +info: + name: List all gift card transactions + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/giftcards/:giftCardId/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "2" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/giftcards/:giftCardId/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/giftcards/:giftCardId/transactions - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"Gift card transaction response information.","required":["cardId","id","_self"],"type":"object","properties":{"cardId":{"type":"string","description":"Gift card identification."},"id":{"type":"string","description":"Transaction identification."},"_self":{"required":["href"],"type":"object","description":"It is an object that carries an auto reference from the provider at the Hub (on its API).","properties":{"href":{"type":"string","description":"This is one of the fields inside the `_self`. It is exactly the route that identifies this provider on the Hub's API, but it is not the same thing as the `serviceURL`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the IDs of all transactions performed in a gift card provider for a specific gift card. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "cardId": "3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24", + "id": "68347b311ce5407c90fa5316975d047a", + "_self": { + "href": "gatewayqa/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24/transactions/68347b311ce5407c90fa5316975d047a" + } + }, + { + "cardId": "3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24", + "id": "e122ebd4501a4b3b93640b7444ac425d", + "_self": { + "href": "gatewayqa/giftcards/3b1abc17-988e-4a14-8b7f-31fc6a5b955c_24/transactions/e122ebd4501a4b3b93640b7444ac425d" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Settle a gift card transaction.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Settle a gift card transaction.yml new file mode 100644 index 0000000000..d790fa7a96 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/Settle a gift card transaction.yml @@ -0,0 +1,93 @@ +info: + name: Settle a gift card transaction + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/giftcards/:giftCardId/transactions/:tId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: giftCardId + value: "2" + type: path + - name: tId + value: 3146f46162f042f483cd3979ba4e8317 + type: path + body: + type: json + data: |- + { + "value": 1.8, + "requestId": "12093812masoidj120398" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/giftcards/:giftCardId/transactions/:tId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:tId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:tId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/giftcards/:giftCardId/transactions/:tId/settlements - Schema is valid", function () { + const schema = {"description":"Transaction response information.","required":["oid","value","date"],"type":"object","properties":{"oid":{"type":"string","description":"Operation identification."},"value":{"type":"number","description":"Value information."},"date":{"type":"string","description":"Date information."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a transaction settlement for a specific gift card from a gift card provider. + + > ℹ️ This request is made from VTEX to the gift card payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `giftCardId` | path | (Required) Gift card identification. | + | `tId` | path | (Required) Transaction ID generated by the provider. It is different from the `transactionId` generated by VTEX. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "oid": "e122ebd4501a4b3b93640b7444ac425d", + "value": 1.8, + "date": "2019-03-18T14:42:32.1291783Z" + } + ``` diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/folder.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/folder.yml new file mode 100644 index 0000000000..c6b7a452de --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/Transactions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transactions + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/environments/VTEX.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/environments/VTEX.yml new file mode 100644 index 0000000000..d18e7fee3b --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: providerApiEndpoint + value: "{providerApiEndpoint}" + - name: baseUrl + value: https://{{providerApiEndpoint}} + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Giftcard Provider Protocol/opencollection.yml b/BrunoCollections/VTEX - Giftcard Provider Protocol/opencollection.yml new file mode 100644 index 0000000000..2114a709e1 --- /dev/null +++ b/BrunoCollections/VTEX - Giftcard Provider Protocol/opencollection.yml @@ -0,0 +1,47 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Giftcard Provider Protocol + +request: + auth: + type: apikey + key: X-PROVIDER-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ Onboarding guide + > + > Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey. + + The **Gift Card Provider Protocol** is a set of definitions to help you integrate your Gift Card API into VTEX platform. + + To achieve this, you need to implement a web API (REST) following the specifications from this documentation and configure your provider in your store using [Gift Card Hub API](https://developers.vtex.com/docs/api-reference/giftcard-hub-api#overview). + + ## Giftcard Provider Protocol API Index + + ### Gift Cards + + - `POST` [Create a gift card](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#post-/giftcards) + - `GET` [Get a gift card by ID](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-) + - `POST` [List all gift cards](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#post-/giftcards/_search) + + ### Transactions + + - `POST` [Create a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#post-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction by ID](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-/transactions/-transactionId-) + - `GET` [List all gift card transactions](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-/transactions) + - `GET` [Get a gift card transaction authorization](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-/transactions/-transactionId-/authorization) + - `POST` [Cancel a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#post-/giftcards/-giftCardId-/transactions/-transactionId-/cancellations) + - `GET` [List all gift card transactions cancellations](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-/transactions/-transactionId-/cancellations) + - `POST` [Settle a gift card transaction](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#post-/giftcards/-giftCardId-/transactions/-tId-/settlements) + - `GET` [List all gift card transactions settlements](https://developers.vtex.com/docs/api-reference/giftcard-provider-protocol#get-/giftcards/-giftCardId-/transactions/-tId-/settlements) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Headless CMS API/Pages/Get CMS page.yml b/BrunoCollections/VTEX - Headless CMS API/Pages/Get CMS page.yml new file mode 100644 index 0000000000..4912c0fdff --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/Pages/Get CMS page.yml @@ -0,0 +1,191 @@ +info: + name: Get CMS page + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/_v/cms/api/:projectId/:content-type/:document-id" + headers: + - name: Accept + value: application/json + params: + - name: versionId + value: e7263fc8-bc68-4052-9e25-dd5a2572d3bb + type: query + disabled: true + - name: releaseId + value: 6196c277c6dce15f9709a2a7 + type: query + disabled: true + - name: projectId + value: faststore + type: path + - name: content-type + value: plp + type: path + - name: document-id + value: 5af643b5-9a6d-48f2-9b34-919dd762c908 + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/_v/cms/api/:projectId/:content-type/:document-id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type/:document-id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type/:document-id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type/:document-id - Schema is valid", function () { + const schema = {"description":"Object containing the data related to a specific page.","type":"object","required":["id","name","type","status"],"properties":{"id":{"description":"Document ID.","type":"string"},"name":{"description":"Name of the page created in the CMS app.","type":"string"},"type":{"description":"Name of the content type defined in the FastStore project.","type":"string"},"status":{"description":"Current status of the page.","type":"string"},"versionId":{"description":"Version ID.","type":"string"},"versionStatus":{"description":"Version status.","type":"string"},"sections":{"description":"Sections that compose the page.","type":"array","items":{"description":"Object with data about a specific section.","type":"object","required":["id","name","data"],"properties":{"id":{"description":"Section ID.","type":"string"},"name":{"description":"Section name.","type":"string"},"data":{"description":"Content of the Section. Varies depending on the Section schema defined in the FastStore project.","type":"object"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets all data from a given page. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have 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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CMS | cms | **See CMS menu on the top-bar** | + | CMS | cms | **Settings** | + | CMS | GraphQL | **CMS GraphQL API** | + + There 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 the resources above to use this endpoint. + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `projectId` | path | (Required) Project ID specified in the settings of the CMS (alpha) app. | + | `content-type` | path | (Required) Content type ID defined in the FastStore project. | + | `document-id` | path | (Required) Document ID presented in the URL path of a CMS preview. | + | `versionId` | query | Version ID presented in the URL path of a CMS preview. | + | `releaseId` | query | Release ID presented in the URL path of a CMS preview. | + + ## Example response (`200`) + + ```json + { + "id": "ad2fd81d-a53c-4281-8d01-a4fc2f274db3", + "name": "Home", + "type": "home", + "status": "published", + "versionId": "e3867e2c-7082-4fe6-83ed-c473242b6970", + "versionStatus": "publishing", + "sections": [ + { + "id": "1651804180614", + "name": "Alert", + "data": { + "dismissible": true, + "icon": "Bell", + "text": "alert text", + "linkText": "alert link", + "actionLink": "link.url.com" + } + }, + { + "id": "1647286556072", + "name": "Hero", + "data": { + "imageSrc": "https://storeframework.vtexassets.com/assets/vtex.file-manager-graphql/images/299f7d32-bb6a-40fd-82a0-4af5573ba572___17239443c00c1e894cff10ca05018058.jpg", + "title": "New Products Available", + "subtitle": "At FastStore you can shop the best tech of 2022. Enjoy and get 10% off on your first purchase.", + "linkText": "See all", + "link": "/office", + "imageAlt": "hero image" + } + }, + { + "id": "1649293076336", + "name": "ProductShelf", + "data": { + "first": 5, + "after": "0", + "sort": "score_desc", + "selectedFacets": [ + { + "key": "productClusterIds", + "value": "140" + } + ], + "title": "Most Wanted!" + } + }, + { + "id": "1649293548351", + "name": "ProductTiles", + "data": { + "first": 3, + "after": "0", + "sort": "score_desc", + "selectedFacets": [ + { + "key": "productClusterIds", + "value": "141" + } + ], + "title": "Just Arrived" + } + }, + { + "id": "1647286735093", + "name": "BannerText", + "data": { + "title": "Receive our news and promotions in advance.", + "caption": "Enjoy and get 10% off on your first purchase!!", + "actionPath": "/office", + "actionLabel": "See all" + } + }, + { + "id": "1649293131632", + "name": "ProductShelf", + "data": { + "first": 5, + "after": "0", + "sort": "score_desc", + "selectedFacets": [ + { + "key": "productClusterIds", + "value": "142" + } + ], + "title": "Deals & Promotions" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Headless CMS API/Pages/Get all CMS pages by content type.yml b/BrunoCollections/VTEX - Headless CMS API/Pages/Get all CMS pages by content type.yml new file mode 100644 index 0000000000..092a4dcd87 --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/Pages/Get all CMS pages by content type.yml @@ -0,0 +1,178 @@ +info: + name: Get all CMS pages by content type + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/_v/cms/api/:projectId/:content-type" + headers: + - name: Accept + value: application/json + params: + - name: page + value: "15" + type: query + disabled: true + - name: versionId + value: e7263fc8-bc68-4052-9e25-dd5a2572d3bb + type: query + disabled: true + - name: releaseId + value: 6196c277c6dce15f9709a2a7 + type: query + disabled: true + - name: filters[{field}] + value: published + type: query + disabled: true + - name: projectId + value: faststore + type: path + - name: content-type + value: plp + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/_v/cms/api/:projectId/:content-type - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/_v/cms/api/:projectId/:content-type - Schema is valid", function () { + const schema = {"type":"object","properties":{"hasNextPage":{"description":"Indicates if there are more items to fetch.","type":"boolean"},"totalItems":{"description":"Total number of results.","type":"integer"},"data":{"description":"Array with data from all pages of the given content type.","type":"array","items":{"description":"Object with data from a specific page.","type":"object","properties":{"id":{"description":"Document ID presented in the URL path of a CMS preview.","type":"string"},"name":{"description":"Name of the page created via the CMS interface.","type":"string"},"type":{"description":"Name of the content type defined in the FastStore project.","type":"string"},"status":{"description":"Current status of the page.","type":"string"},"versionId":{"description":"Version ID.","type":"string"},"versionStatus":{"description":"Version status.","type":"string"},"sections":{"description":"Sections that compose the page.","type":"array","items":{"description":"Object with data about a specific section.","type":"object","properties":{"id":{"description":"Section ID.","type":"string"},"name":{"description":"Section name.","type":"string"},"data":{"description":"Custom field values of the Section. Varies depending on the Section schema defined in the FastStore project.","type":"object"}}}},"parameters":{"description":"Object with the configuration values of a `configurationSchemaSets` tab. Varies depending on the content type schema defined in the FastStore project.","type":"object"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets data from all pages of a given content type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have 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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CMS | cms | **See CMS menu on the top-bar** | + | CMS | cms | **Settings** | + | CMS | GraphQL | **CMS GraphQL API** | + + There 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 the resources above to use this endpoint. + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `projectId` | path | (Required) Project ID specified in the settings of the CMS (alpha) app. | + | `content-type` | path | (Required) Content type identifier defined in the FastStore project. | + | `page` | query | The page number to retrieve in a paginated list of results. If not specified, the default return is 10 items per page. | + | `versionId` | query | Version ID presented in the URL path of a CMS preview. | + | `releaseId` | query | Release ID presented in the URL path of a CMS preview. | + | `filters[{field}]` | query | Filter results by a property of the page (e.g., `filters[status]`) or by a nested custom field of the `parameters` object (e.g., `filters[parameters.collection.sort]`). *Replace {field} with the desired property.* | + + ## Example response (`200`) + + ```json + { + "hasNextPage": false, + "totalItems": 2, + "data": [ + { + "id": "d05d3db8-62b2-4f0b-9b70-d6d25ff29b6e", + "name": "Electronics", + "type": "plp", + "status": "published", + "versionId": "ed51d1cd-e020-4f16-b48b-ca83e720472d", + "versionStatus": "published", + "sections": [ + { + "id": "1632244409269", + "name": "RichText", + "data": { + "content": "{\"blocks\":[{\"key\":\"dtg7g\",\"text\":\"-\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}" + } + }, + { + "id": "1632244445091", + "name": "RichText", + "data": { + "content": "{\"blocks\":[{\"key\":\"2qtft\",\"text\":\",\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}" + } + } + ], + "parameters": { + "collection": { + "sort": "\"\"", + "brandId": "123" + } + } + }, + { + "id": "4ab6388d-79e6-492f-adda-3e251b85eeb6", + "name": "Beauty", + "type": "plp", + "status": "published", + "versionId": "95f940d4-584e-4b3d-9872-8c713ba42583", + "versionStatus": "published", + "sections": [ + { + "id": "1643319987751", + "name": "SearchBanner", + "data": { + "desktop": { + "srcSet": "https://storecomponents.vtexassets.com/assets/vtex.file-manager-graphql/images/dda7c17e-5182-4439-b5af-94f651e2d835___1ef09be73ec9e80c719da13432666441.jpeg" + }, + "mobile": { + "srcSet": "https://storecomponents.vtexassets.com/assets/vtex.file-manager-graphql/images/ed8ef334-c1e5-4269-8728-34dbffeda424___1ef09be73ec9e80c719da13432666441.jpeg" + }, + "title": "beauty", + "description": "beauty products", + "alt": "beauty" + } + } + ], + "parameters": { + "collection": { + "sort": "\"\"", + "seo": { + "title": "Page title", + "slug": "/beauty", + "description": "beauty products" + }, + "clusterId": "1182" + } + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Headless CMS API/Pages/Get all content types.yml b/BrunoCollections/VTEX - Headless CMS API/Pages/Get all content types.yml new file mode 100644 index 0000000000..70701c8957 --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/Pages/Get all content types.yml @@ -0,0 +1,81 @@ +info: + name: Get all content types + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/_v/cms/api/:projectId" + headers: + - name: Accept + value: application/json + params: + - name: projectId + value: faststore + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/_v/cms/api/:projectId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/_v/cms/api/:projectId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/_v/cms/api/:projectId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/_v/cms/api/:projectId - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"contentTypes":{"description":"Array with data of each content type.","type":"array","items":{"description":"Object with data of a specific content type.","type":"object","properties":{"id":{"description":"Content type identifier specified in the FastStore project.","type":"string"},"name":{"description":"Content type name specified in the FastStore project.","type":"string"},"configurationSchemaSets":{"description":"Array with data of the `configurationSchemaSets` tabs specified in the FastStore project.","type":"array","items":{"description":"Object with data about a specific content type tab.","type":"object","properties":{"name":{"description":"Name of the content type tab.","type":"string"},"configurations":{"description":"Custom configurations of the content type tab, which may vary based on the content type schema defined in the FastStore project.","type":"array","items":{"type":"object","description":"Object with custom configurations of the content type tab.","properties":{"name":{"description":"Section of a form.","type":"string"},"schema":{"type":"object","description":"Customizable [JSON schema](https://json-schema.org/learn/getting-started-step-by-step).","required":["title","description"],"properties":{"title":{"type":"string","description":"Section title."},"description":{"type":"string","description":"Section description."},"widget":{"type":"object","description":"[Widget](https://v1.faststore.dev/tutorials/cms-storecomponents/3#using-widgets) to be used in the UI. Should be filled with [`uiSchema`](https://react-jsonschema-form.readthedocs.io/en/docs/api-reference/uiSchema/) along with [`widgets`](https://react-jsonschema-form.readthedocs.io/en/docs/usage/widgets/) to specify which UI widget should be used to render a given field of your schema. The format should be `\"{uiSchema}\": \"{widgetName}\"`.","additionalProperties":true}},"additionalProperties":true}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves data from all Content Types. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have 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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CMS | cms | **See CMS menu on the top-bar** | + | CMS | cms | **Settings** | + | CMS | GraphQL | **CMS GraphQL API** | + + There 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 the resources above to use this endpoint. + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `projectId` | path | (Required) Project ID specified in the settings of the CMS (alpha) app. | + + ## Example response (`200`) + + _Omitted here: 8 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Headless CMS API/Pages/folder.yml b/BrunoCollections/VTEX - Headless CMS API/Pages/folder.yml new file mode 100644 index 0000000000..80916a926e --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/Pages/folder.yml @@ -0,0 +1,4 @@ +info: + name: Pages + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Headless CMS API/environments/VTEX.yml b/BrunoCollections/VTEX - Headless CMS API/environments/VTEX.yml new file mode 100644 index 0000000000..c924617af4 --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: accountName + value: storeframework + - name: baseUrl + value: https://{{accountName}}.myvtex.com diff --git a/BrunoCollections/VTEX - Headless CMS API/opencollection.yml b/BrunoCollections/VTEX - Headless CMS API/opencollection.yml new file mode 100644 index 0000000000..cf002c9c89 --- /dev/null +++ b/BrunoCollections/VTEX - Headless CMS API/opencollection.yml @@ -0,0 +1,24 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Headless CMS API + +docs: + content: |- + The [VTEX Headless CMS](https://www.faststore.dev/docs/headless-cms-overview) is a solution for storefront content management. + You can use the Headless CMS API to fetch data about your project's pages and content types, including `status`, `id`, and `type`. + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | --------------- | ----------------- | ----------------- | + | {{accountName}} | Name of the VTEX account. Used as part of the URL. | Server variable. | + | {{workspace}} | Name of the VTEX workspace. | Server variable. | + | {{projectId}} | Project ID specified in the settings of the CMS (alpha) app. | Path variable. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml new file mode 100644 index 0000000000..06d2b517ad --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml @@ -0,0 +1,108 @@ +info: + name: Get list of suggested terms and attributes similar to the search term + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/autocomplete-suggestions" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/autocomplete-suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/autocomplete-suggestions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/autocomplete-suggestions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/autocomplete-suggestions - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of suggested facets and terms.","items":{"type":"object","description":"Suggested facet or term.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."},"attributes":{"type":["array","null"],"description":"List of facets in which the term can be searched.","items":{"type":"object","description":"Facet information.","properties":{"key":{"type":"string","description":"Facet key."},"value":{"type":"string","description":"Facet value."},"labelKey":{"type":"string","description":"Human-readable format of the facet key."},"labelValue":{"type":"string","description":"Human-readable format of the facet value."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the suggested terms and attributes similar to the search term. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/docs/tutorials/autocomplete) guide. + + >ℹ️ **Segment context:** Intelligent Search API (Legacy) previously read `locale` from `segment.cultureInfo` in the VTEX segment cookie. In v1, pass it directly as a query parameter. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + If `query` is missing or empty, the response is `{ "searches": [] }`. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "tv", + "count": 28861, + "attributes": [ + { + "key": "department", + "value": "tvs-and-video", + "labelKey": "Department", + "labelValue": "TVs and Video" + } + ] + }, + { + "term": "smarth tv", + "count": 2308 + }, + { + "term": "rack tv", + "count": 589 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms similar to the search term.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms similar to the search term.yml new file mode 100644 index 0000000000..794e4a2995 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of suggested terms similar to the search term.yml @@ -0,0 +1,100 @@ +info: + name: Get list of suggested terms similar to the search term + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/search-suggestions" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/search-suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/search-suggestions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/search-suggestions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/search-suggestions - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of suggested terms.","items":{"type":"object","description":"Suggested term.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists suggested terms similar to the search term. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/docs/tutorials/autocomplete) guide. + + >ℹ️ **Segment context:** Intelligent Search API (Legacy) previously read `locale` from `segment.cultureInfo` in the VTEX segment cookie. In v1, pass it directly as a query parameter. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + If `query` is missing, empty, or whitespace-only, the response is `{ "searches": [] }`. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "mountain bike", + "count": 66 + }, + { + "term": "bike helmet", + "count": 121 + }, + { + "term": "electric bike", + "count": 78 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of the 10 most searched terms.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of the 10 most searched terms.yml new file mode 100644 index 0000000000..cea4389d82 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/Get list of the 10 most searched terms.yml @@ -0,0 +1,121 @@ +info: + name: Get list of the 10 most searched terms + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/top-searches" + headers: + - name: Accept + value: application/json + params: + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/top-searches - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/top-searches - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/top-searches - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/top-searches - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of the most searched terms in the past 14 days.","items":{"type":"object","description":"Term information.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the 10 most searched terms in the past 14 days. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/docs/tutorials/autocomplete) guide. + + >ℹ️ **Segment context:** Intelligent Search API (Legacy) previously read `locale` from `segment.cultureInfo` in the VTEX segment cookie. In v1, pass it directly as a query parameter. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "home", + "count": 14 + }, + { + "term": "shirt", + "count": 10 + }, + { + "term": "top", + "count": 9 + }, + { + "term": "tops", + "count": 6 + }, + { + "term": "camera", + "count": 5 + }, + { + "term": "kit", + "count": 5 + }, + { + "term": "work shirt", + "count": 2 + }, + { + "term": "shirts", + "count": 2 + }, + { + "term": "clothing", + "count": 2 + }, + { + "term": "classic shoes", + "count": 1 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/folder.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/folder.yml new file mode 100644 index 0000000000..de3ede36ef --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Autocomplete/folder.yml @@ -0,0 +1,4 @@ +info: + name: Autocomplete + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/Get pickup point availability for Delivery Promise.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/Get pickup point availability for Delivery Promise.yml new file mode 100644 index 0000000000..9249cd426f --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/Get pickup point availability for Delivery Promise.yml @@ -0,0 +1,216 @@ +info: + name: Get pickup point availability for Delivery Promise + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/pickup-point-availability/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: deliveryZonesHash + value: 4bab2513d897914b0b33f25c8c74f571 + type: query + disabled: true + - name: pickupPointsHash + value: d41d8cd98f00b204e9800998ecf8427e + type: query + disabled: true + - name: country + value: USA + type: query + disabled: true + - name: zip-code + value: "10001" + type: query + disabled: true + - name: coordinates + value: -43.19532775878906,-22.955032348632812 + type: query + disabled: true + - name: pickupPoint + value: Ut exerci + type: query + disabled: true + - name: facets + value: category-1/clothing + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pickup-point-availability/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pickup-point-availability/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/pickup-point-availability/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pickup-point-availability/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Pickup points availability response.","properties":{"pickupPointDistances":{"type":"array","description":"List of available pickup points sorted by distance ascending.","items":{"type":"object","description":"Pickup point information.","properties":{"pickupId":{"type":"string","description":"Unique identifier for the pickup point."},"pickupName":{"type":"string","description":"Name of the pickup point."},"distance":{"type":"number","description":"Distance from the provided coordinates to the pickup point, in kilometers."},"isActive":{"type":"boolean","description":"Indicates whether the pickup point is currently active (`true`) or not (`false`)."},"address":{"type":"object","description":"Address details of the pickup point.","properties":{"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State or province."},"postalCode":{"type":"string","description":"Postal code."}}},"businessHours":{"type":"array","description":"Operating hours for each day of the week.","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week (0 = Sunday, 1 = Monday, ..., 6 = Saturday).","enum":[0,1,2,3,4,5,6]},"openingTime":{"type":"string","description":"Opening time in 24-hour format (HH:MM:SS)."},"closingTime":{"type":"string","description":"Closing time in 24-hour format (HH:MM:SS)."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of available pickup points with their IDs, distances, addresses, and business hours. This endpoint returns pickup points sorted by distance from the provided coordinates. + + >ℹ️ This endpoint is designed for use in [Delivery Promise for headless stores](https://developers.vtex.com/docs/guides/delivery-promise-for-headless-stores) implementations. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Private sales-channel responses are not cached. Always read the `Cache-Control` response header at runtime to determine cacheability. + + You can call this endpoint in two ways: + + - **With country and ZIP code:** Provide `country` and `zip-code` to retrieve pickup points based on location. + - **With delivery zones and pickup hashes:** Provide pre-computed `deliveryZonesHash` and `pickupPointsHash` for faster lookup. + + >ℹ️ **Segment context:** Several parameters on this endpoint replace values previously read from the VTEX segment cookie. See [Migrating from segment](#migrating-from-segment) below. + + ## Migrating from segment + + Intelligent Search API (Legacy) reads the following values from the VTEX segment cookie. In v1, pass each one directly as a query parameter: + + | v1 parameter | Segment source | + |:---|:---| + | `locale` | `segment.cultureInfo` | + | `sc` | `segment.channel` | + | `country` | `segment.countryCode` or `country` key in `segment.facets` | + | `zip-code` | `zip-code` key in `segment.facets` | + | `coordinates` | `coordinates` key in `segment.facets` | + | `pickupPoint` | `pickupPoint` key in `segment.facets` | + | `deliveryZonesHash` | `deliveryZonesHash` key in `segment.facets` | + | `pickupPointsHash` | `pickupPointsHash` key in `segment.facets` | + +
+ TypeScript reference implementation + + The following TypeScript snippet shows the full translation: + + ```typescript + type Segment = { + channel?: string | number + countryCode?: string + cultureInfo?: string + // Semicolon-separated "key=value" string, e.g. "zip-code=22250-040;country=BRA" + facets?: string + } + + const SHIPPING_KEYS = new Set([ + 'zip-code', 'coordinates', 'country', 'pickupPoint', + 'deliveryZonesHash', 'pickupPointsHash', + ]) + + function segmentToPickupPointAvailabilityV1(segment: Segment): string { + const shipping: Record = {} + + for (const pair of (segment.facets ?? '').split(';')) { + const eq = pair.indexOf('=') + if (eq < 0) continue + const key = pair.slice(0, eq) + const value = pair.slice(eq + 1) + if (!key || !value) continue + if (SHIPPING_KEYS.has(key)) shipping[key] = value + } + + const params: Record = {} + const set = (name: string, value?: string | number) => { + if (value !== undefined && value !== null && value !== '') { + params[name] = String(value) + } + } + + set('sc', segment.channel) + set('locale', segment.cultureInfo) + set('country', segment.countryCode ?? shipping.country) + set('zip-code', shipping['zip-code']) + set('coordinates', shipping.coordinates) + set('pickupPoint', shipping.pickupPoint) + set('deliveryZonesHash', shipping.deliveryZonesHash) + set('pickupPointsHash', shipping.pickupPointsHash) + + const search = new URLSearchParams(params).toString() + + return `https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/pickup-point-availability?${search}` + } + ``` + +
+ + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red`. ## Filter combinations - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only products that satisfy all conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. ## Available filters \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` *(optional)* \| Sales channel filter. Supported for backward compatibility; prefer the `sc` query parameter instead. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter by category level (1 = department, 2 = category, 3 = subcategory, etc.). \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by catalog specification. \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `price/100:500` \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + | `deliveryZonesHash` | query | Pre-computed hash for delivery zones. Required when using the hashes approach (alternative to country and ZIP code). | + | `pickupPointsHash` | query | Pre-computed hash for pickup points. Required when using the hashes approach (alternative to country and ZIP code). | + | `country` | query | Three-letter country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. Required when using the country and ZIP code approach. | + | `zip-code` | query | ZIP code or postal code. Required when using the country and ZIP code approach. | + | `coordinates` | query | Geographic coordinates in the format `longitude,latitude`. Used to sort results by proximity. Optional: the server derives coordinates from `zip-code` and `country` when not provided. | + | `pickupPoint` | query | Pickup point ID to filter results to a specific pickup point. | + + ## Example response (`200`) + + ```json + { + "pickupPointDistances": [ + { + "pickupId": "fulfillmentqa_vtexsp", + "distance": 4.99, + "pickupName": "VTEX SP", + "isActive": true, + "address": { + "city": "New York", + "neighborhood": "Manhattan", + "number": "350", + "postalCode": "10001", + "street": "5th Avenue", + "state": "NY" + }, + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/folder.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/folder.yml new file mode 100644 index 0000000000..7594a00813 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Delivery Promise/folder.yml @@ -0,0 +1,4 @@ +info: + name: Delivery Promise + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/Get product.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/Get product.yml new file mode 100644 index 0000000000..178b982d94 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/Get product.yml @@ -0,0 +1,325 @@ +info: + name: Get product + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/products?sc=1&value=123456" + headers: + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + - name: value + value: "123456" + type: query + - name: field + value: id + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: simulationBehavior + value: default + type: query + disabled: true + - name: hideUnavailableItems + value: "false" + type: query + disabled: true + - name: productClusterId + value: Ut exerci + type: query + disabled: true + - name: productOriginVtex + value: "false" + type: query + disabled: true + - name: show-invisible-items + value: "true" + type: query + disabled: true + - name: regionId + value: Ut exerci + type: query + disabled: true + - name: country + value: USA + type: query + disabled: true + - name: zip-code + value: "10001" + type: query + disabled: true + - name: coordinates + value: -43.19532775878906,-22.955032348632812 + type: query + disabled: true + - name: pickupPoint + value: Ut exerci + type: query + disabled: true + - name: deliveryZonesHash + value: 4bab2513d897914b0b33f25c8c74f571 + type: query + disabled: true + - name: pickupPointsHash + value: d41d8cd98f00b204e9800998ecf8427e + type: query + disabled: true + - name: utmSource + value: Ut exerci + type: query + disabled: true + - name: utmCampaign + value: Ut exerci + type: query + disabled: true + - name: utmiCampaign + value: Ut exerci + type: query + disabled: true + - name: campaigns + value: Ut exerci + type: query + disabled: true + - name: priceTables + value: Ut exerci + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/products - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/products - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/products - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/products - Schema is valid", function () { + const schema = {"type":"object","description":"Product information.","properties":{"cacheId":{"description":"Cache ID.","type":"string"},"productId":{"description":"Product unique identifier.","type":"string"},"description":{"description":"Product description.","type":"string"},"productName":{"description":"Product name.","type":"string"},"productReference":{"description":"Product reference code.","type":"string"},"linkText":{"description":"Product slug (link text).","type":"string"},"brand":{"description":"Brand name.","type":"string"},"brandId":{"description":"Brand unique identifier.","type":"number"},"link":{"description":"Product URL path in the store.","type":"string"},"categories":{"description":"Category paths.","type":"array","items":{"description":"Category path.","type":"string"}},"categoryId":{"description":"Category unique identifier.","type":"string"},"categoriesIds":{"description":"List of category IDs in the corresponding category path.","type":"array","items":{"description":"Category ID.","type":"string"}},"priceRange":{"description":"Price range information.","type":"object","properties":{"sellingPrice":{"description":"Selling price range.","type":"object","properties":{"highPrice":{"description":"Highest selling price.","type":"number"},"lowPrice":{"description":"Lowest selling price.","type":"number"}}},"listPrice":{"description":"List price range.","type":"object","properties":{"highPrice":{"description":"Highest list price.","type":"number"},"lowPrice":{"description":"Lowest list price.","type":"number"}}}}},"specificationGroups":{"description":"Specification groups information.","type":"array","items":{"type":"object","description":"Specification group information.","properties":{"originalName":{"description":"Specification group original name.","type":"string"},"name":{"description":"Specification group name.","type":"string"},"specifications":{"description":"List of specifications.","type":"array","items":{"type":"object","description":"Specification information.","properties":{"originalName":{"description":"Specification original name.","type":"string"},"name":{"description":"Specification name.","type":"string"},"values":{"description":"Specification values.","type":"array","items":{"type":"string"}}}}}}}},"skuSpecifications":{"description":"SKU specifications.","type":"array","items":{"type":"object","description":"SKU specification information.","properties":{"field":{"type":"object","description":"SKU specification field.","properties":{"name":{"type":"string","description":"SKU specification field name."},"originalName":{"type":"string","description":"SKU specification field original name."}}},"values":{"type":"array","description":"SKU specification field values.","items":{"type":"object","properties":{"name":{"type":"string","description":"SKU specification value name."},"originalName":{"type":"string","description":"SKU specification value original name."}}}}}}},"productClusters":{"description":"Product clusters (collections) the product belongs to.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Cluster unique identifier."},"name":{"type":"string","description":"Cluster name."}}}},"clusterHighlights":{"description":"Cluster highlights information.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Cluster unique identifier."},"name":{"type":"string","description":"Cluster name."}}}},"properties":{"description":"Product properties.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Property name."},"originalName":{"type":"string","description":"Property original name."},"values":{"type":"array","items":{"type":"string","description":"Property value."}}}}},"items":{"description":"Information about the related SKUs.","type":"array","items":{"type":"object","description":"SKU information.","additionalProperties":true,"properties":{"sellers":{"description":"List of sellers.","type":"array","items":{"type":"object","description":"Seller information.","properties":{"sellerId":{"description":"Seller unique identifier.","type":"string"},"sellerName":{"description":"Seller name.","type":"string"},"addToCartLink":{"description":"Add to cart link.","type":"string"},"sellerDefault":{"description":"Whether this is the default seller.","type":"boolean"},"commertialOffer":{"description":"Commercial offer information.","type":"object","properties":{"DeliverySlaSamplesPerRegion":{"description":"Delivery SLA samples per region.","type":"object","additionalProperties":true},"DeliverySlaSamples":{"description":"Delivery SLA samples.","type":"array","items":{"type":"object","additionalProperties":true}},"AvailableQuantity":{"description":"Indicates availability. `10000` means available; `0` means unavailable.","type":"number"},"discountHighlights":{"description":"Discount highlights.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Discount highlight name."}}}},"Installments":{"description":"Installments information.","type":"array","items":{"type":"object","properties":{"PaymentSystemName":{"type":"string","description":"Payment system name."},"Value":{"type":"number","description":"Installment value."},"InterestRate":{"type":"number","description":"Interest rate."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate."},"NumberOfInstallments":{"type":"number","description":"Number of installments."},"Name":{"type":"string","description":"Payment condition name."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group."}}}},"Price":{"description":"Price of the item.","type":"number"},"ListPrice":{"description":"List price of the item.","type":"number"},"spotPrice":{"description":"Special promotional price available under specific conditions, such as a discount for a specific payment method. May differ from `Price`.","type":"number"},"taxPercentage":{"description":"Tax percentage.","type":"number"},"PriceWithoutDiscount":{"description":"Price without discount.","type":"number"},"Tax":{"description":"Tax value.","type":"number"},"GiftSkuIds":{"description":"List of gift SKU IDs.","type":"array","items":{"type":"string"}},"BuyTogether":{"description":"IDs of items that can be bought together with this item.","type":"array","items":{"type":"string"}},"RewardValue":{"description":"Credit the customer receives when finalizing an order that includes this SKU.","type":"number"},"PriceValidUntil":{"description":"Date until the price is valid, in ISO 8601 format.","type":"string"},"GetInfoErrorMessage":{"description":"Get info error message.","type":["string","null"]},"CacheVersionUsedToCallCheckout":{"description":"Cache version used to call Checkout.","type":"string"},"teasers":{"description":"Promotion teasers.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Promotion name."},"conditions":{"type":"object","description":"Conditions for the promotion to be valid.","properties":{"minimumQuantity":{"type":"number","description":"Minimum quantity of the item."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}}}}},"effects":{"type":"object","description":"Promotion effects.","properties":{"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}}}}}}}}}}}}},"images":{"description":"SKU images.","type":"array","items":{"type":"object","properties":{"imageId":{"type":"string","description":"Image unique identifier."},"cacheId":{"type":"string","description":"Cache ID."},"imageTag":{"type":"string","description":"HTML tag for the selected image."},"imageLabel":{"type":"string","description":"Image label."},"imageText":{"type":"string","description":"Image text (alt text)."},"imageUrl":{"type":"string","description":"Image URL."}}}},"itemId":{"description":"SKU unique identifier.","type":"string"},"name":{"description":"SKU name.","type":"string"},"nameComplete":{"description":"Combination of the product name and the SKU name.","type":"string"},"complementName":{"description":"Complement name.","type":"string"},"referenceId":{"description":"SKU alternate IDs.","type":"array","items":{"type":"object","properties":{"Key":{"type":"string","description":"Alternate ID key."},"Value":{"type":"string","description":"Alternate ID value."}}}},"measurementUnit":{"description":"Measurement unit.","type":"string"},"unitMultiplier":{"description":"Unit multiplier. If the multiplier is 5.0000, the product can be added in multiples of 5.","type":"number"},"variations":{"description":"Variations.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Variation name."},"values":{"type":"array","items":{"type":"string"}}}}},"ean":{"description":"EAN value.","type":"string"},"modalType":{"description":"Links an unusual type of SKU to a carrier specialized in delivering it (e.g. `\"Refrigerated products\"`). See [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125).","type":"string"},"videos":{"description":"SKU videos.","type":"array","items":{"type":"string","description":"Video URL."}},"attachments":{"description":"Attachments related to the SKU.","type":"array","items":{"type":"object","description":"Attachment information.","properties":{"id":{"type":"number","description":"Attachment unique identifier."},"name":{"type":"string","description":"Attachment name."},"schema":{"type":"object","description":"Free-form JSON schema describing the attachment.","additionalProperties":true},"fields":{"type":"array","description":"Attachment fields.","items":{"type":"object","properties":{"field_name":{"type":"string","description":"Field name."},"max_characters":{"type":"string","description":"Maximum number of characters allowed for the field."},"domain_values":{"type":"string","description":"Allowed values for the field."}}}},"isActive":{"type":"boolean","description":"Whether the attachment is active."},"isRequired":{"type":"boolean","description":"Whether the attachment is required."}}}},"isKit":{"description":"Defines whether the SKU is a kit (`true`) or not (`false`).","type":"boolean"},"kitItems":{"description":"SKUs that compose the kit. Returned when `isKit` is `true`.","type":["array","null"],"items":{"type":"object","properties":{"itemId":{"type":"string","description":"Component SKU ID."},"amount":{"type":"number","description":"Quantity of the component SKU per kit."}}}},"estimatedDateArrival":{"description":"Estimated arrival date for the SKU, when configured.","type":["string","null"]}}}},"releaseDate":{"description":"Release date.","type":"number"},"origin":{"description":"Origin of the product in the trade policy.","type":"string"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a single product by a known identifier. Use this endpoint for product detail pages (PDP) when you have a specific product ID, slug, EAN, SKU ID, or reference. + + >⚠️ Use this endpoint when you need data for one specific product whose identifier is already known (for example, rendering a PDP from a URL slug). Don't use it to fetch multiple products or to run a search query. Use `GET` [Search products](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/product-search/-facets-) for those cases. Misusing this endpoint for listings or search bypasses Intelligent Search ranking and impairs the shopper experience. + + When called with `field=id` (the default), the product is looked up directly, **skipping the search pipeline**, resulting in lower latency and higher cache-hit likelihood than product search. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Private sales-channel responses are not cached. Always read the `Cache-Control` response header at runtime to determine cacheability. + + >ℹ️ **Segment context:** Several parameters on this endpoint replace values previously read from the VTEX segment cookie. See [Migrating from segment](#migrating-from-segment) below. + + ## Migrating from segment + + Intelligent Search API (Legacy) reads the following values from the VTEX segment cookie. In v1, pass each one directly as a query parameter: + + | v1 parameter | Segment source | + |:---|:---| + | `locale` | `segment.cultureInfo` | + | `sc` | `segment.channel` | + | `regionId` | `segment.regionId` | + | `country` | `segment.countryCode` or `country` key in `segment.facets` | + | `zip-code` | `zip-code` key in `segment.facets` | + | `coordinates` | `coordinates` key in `segment.facets` | + | `pickupPoint` | `pickupPoint` key in `segment.facets` | + | `deliveryZonesHash` | `deliveryZonesHash` key in `segment.facets` | + | `pickupPointsHash` | `pickupPointsHash` key in `segment.facets` | + | `utmSource` | `segment.utm_source` | + | `utmCampaign` | `segment.utm_campaign` | + | `utmiCampaign` | `segment.utmi_campaign` | + | `campaigns` | `segment.campaigns` | + | `priceTables` | `segment.priceTables` | + +
+ TypeScript reference implementation + + The following TypeScript snippet shows the full translation: + + ```typescript + type Segment = { + channel?: string | number + regionId?: string + countryCode?: string + cultureInfo?: string + // Semicolon-separated "key=value" string, e.g. "zip-code=22250-040;country=BRA" + facets?: string + utm_source?: string + utm_campaign?: string + utmi_campaign?: string + campaigns?: string + priceTables?: string + } + + const SHIPPING_KEYS = new Set([ + 'zip-code', 'coordinates', 'country', 'pickupPoint', + 'deliveryZonesHash', 'pickupPointsHash', + ]) + + function segmentToProductsV1(segment: Segment, identifier: string): string { + const shipping: Record = {} + + for (const pair of (segment.facets ?? '').split(';')) { + const eq = pair.indexOf('=') + if (eq < 0) continue + const key = pair.slice(0, eq) + const value = pair.slice(eq + 1) + if (!key || !value) continue + if (SHIPPING_KEYS.has(key)) shipping[key] = value + } + + const params: Record = {} + const set = (name: string, value?: string | number) => { + if (value !== undefined && value !== null && value !== '') { + params[name] = String(value) + } + } + + set('sc', segment.channel) + set('locale', segment.cultureInfo) + set('regionId', segment.regionId) + set('country', segment.countryCode ?? shipping.country) + set('zip-code', shipping['zip-code']) + set('coordinates', shipping.coordinates) + set('pickupPoint', shipping.pickupPoint) + set('deliveryZonesHash', shipping.deliveryZonesHash) + set('pickupPointsHash', shipping.pickupPointsHash) + set('utmSource', segment.utm_source) + set('utmCampaign', segment.utm_campaign) + set('utmiCampaign', segment.utmi_campaign) + set('campaigns', segment.campaigns) + set('priceTables', segment.priceTables) + + params.identifier = identifier + + const search = new URLSearchParams(params).toString() + + return `https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/products?${search}` + } + ``` + +
+ + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources) for public sales channels. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sc` | query | (Required) Sales channel (trade policy) ID. Required for this endpoint to resolve pricing and availability. Intelligent Search API (Legacy) previously read this from `segment.channel`. In v1, pass the value directly as a query parameter. | + | `value` | query | (Required) The identifier value to look up, interpreted according to the `field` parameter. | + | `field` | query | Which identifier type `value` represents. - `id` (default): product ID. Fastest: skips the search pipeline entirely. - `slug`: product slug (link text). - `ean`: SKU EAN. - `sku`: SKU ID. - `reference`: SKU reference ID (not the product reference). | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + | `simulationBehavior` | query | Defines the pricing and availability simulation behavior. - `default`: Calls the simulation for every single seller. - `skip`: Never calls the simulation. Use for the fastest response when live pricing is not required. - `only1P`: Only calls the simulation for first-party sellers. - `only3P`: Only calls the simulation for third-party sellers. - `regionalize1p`: Calls regionalized simulation for first-party sellers only. | + | `hideUnavailableItems` | query | Defines whether the result should hide unavailable items (`true`) or not (`false`). When set to `true`, only products with stock are returned. | + | `productClusterId` | query | Restrict to a cluster. Returns `404` if the product is not in this cluster. | + | `productOriginVtex` | query | When `true`, returns the product in Catalog (portal) format instead of Intelligent Search format. | + | `show-invisible-items` | query | When `true`, skips the catalog visibility (`isVisible`) check. Useful for preview and admin flows. | + | `regionId` | query | Region ID for regionalized results. Intelligent Search API (Legacy) previously read this from `segment.regionId`. In v1, pass the value directly as a query parameter. | + | `country` | query | Three-letter country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. Intelligent Search API (Legacy) previously read this from `segment.countryCode` or the `country` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `zip-code` | query | ZIP or postal code. Intelligent Search API (Legacy) previously read this from the `zip-code` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `coordinates` | query | Geographic coordinates in the format `longitude,latitude`. Intelligent Search API (Legacy) previously read this from the `coordinates` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPoint` | query | Pickup point ID for pickup-in-point delivery context. Intelligent Search API (Legacy) previously read this from the `pickupPoint` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `deliveryZonesHash` | query | Pre-computed delivery zones hash for faster regionalization lookup. Obtain this value from the `POST` [Search delivery zones](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/delivery-zones/_search/v2) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `deliveryZonesHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPointsHash` | query | Pre-computed pickup points hash for faster regionalization lookup. Obtain this value from the `POST` [Search pickup points](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/pickuppoints/_search) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `pickupPointsHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `utmSource` | query | UTM source value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utm_source`. In v1, pass the value directly as a query parameter. | + | `utmCampaign` | query | UTM campaign value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utm_campaign`. In v1, pass the value directly as a query parameter. | + | `utmiCampaign` | query | UTMi campaign value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utmi_campaign`. In v1, pass the value directly as a query parameter. | + | `campaigns` | query | Campaign identifier, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.campaigns`. In v1, pass the value directly as a query parameter. | + | `priceTables` | query | Price table(s) to apply during simulation. Intelligent Search API (Legacy) previously read this from `segment.priceTables`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "productId": "123456", + "productName": "Smartphone XYZ", + "brand": "TechBrand", + "brandId": 9001, + "linkText": "smartphone-xyz", + "link": "/smartphone-xyz/p", + "categories": [ + "/Electronics/" + ], + "categoryId": "10", + "categoriesIds": [ + "/10/" + ], + "priceRange": { + "sellingPrice": { + "highPrice": 999.99, + "lowPrice": 999.99 + }, + "listPrice": { + "highPrice": 1299.99, + "lowPrice": 1299.99 + } + }, + "specificationGroups": [], + "skuSpecifications": [], + "productClusters": [], + "clusterHighlights": [], + "properties": [], + "items": [ + { + "sellers": [ + { + "sellerId": "1", + "sellerDefault": true, + "commertialOffer": { + "Price": 999.99, + "ListPrice": 1299.99, + "AvailableQuantity": 50 + } + } + ], + "images": [], + "itemId": "789", + "name": "Smartphone XYZ - 128GB - Black", + "nameComplete": "Smartphone XYZ - 128GB - Black", + "measurementUnit": "un", + "unitMultiplier": 1, + "variations": [], + "ean": "7891234567890", + "modalType": "", + "videos": [], + "attachments": [], + "isKit": false + } + ], + "origin": "intelligent-search" + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/folder.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/folder.yml new file mode 100644 index 0000000000..19bb7267c9 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product details page (PDP)/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product details page (PDP) + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get attempt of correction of a misspelled term.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get attempt of correction of a misspelled term.yml new file mode 100644 index 0000000000..d7894abfce --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get attempt of correction of a misspelled term.yml @@ -0,0 +1,90 @@ +info: + name: Get attempt of correction of a misspelled term + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/correction-search" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/correction-search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/correction-search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/correction-search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/correction-search - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"correction":{"type":"object","description":"Object that indicates if the term was misspelled and suggests a possible correction.","properties":{"misspelled":{"type":"boolean","description":"Defines whether the term was misspelled (`true`) or not (`false`)."},"correction":{"type":"boolean","description":"Defines whether the API was able to suggest a correction (`true`) or not (`false`)."},"text":{"type":"string","description":"The corrected term. Empty string when there is no correction."},"highlighted":{"type":"string","description":"The corrected term with the corrected word highlighted using `` tags. Empty string when there is no correction."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Tries to correct a misspelled term from the search. + + >ℹ️ **Segment context:** Intelligent Search API (Legacy) previously read `locale` from `segment.cultureInfo` in the VTEX segment cookie. In v1, pass it directly as a query parameter. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + If `query` is missing, empty, or whitespace-only, the response is `{"correction": {"correction": false, "misspelled": false, "text": "", "highlighted": ""}}`. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "correction": { + "correction": true, + "misspelled": true, + "text": "mountain bike", + "highlighted": "mountain bike" + } + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get list of banners registered for query.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get list of banners registered for query.yml new file mode 100644 index 0000000000..7fae8ed45e --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Get list of banners registered for query.yml @@ -0,0 +1,94 @@ +info: + name: Get list of banners registered for query + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/banners/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: facets + value: category-1/clothing + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/banners/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/banners/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/banners/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/banners/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"banners":{"type":"array","description":"List of banners.","items":{"type":"object","description":"Banner information.","properties":{"id":{"type":"string","description":"Banner ID."},"name":{"type":"string","description":"Banner name."},"area":{"type":"string","description":"Banner area, which can be a number between 1 and 4, to be used in the store's [Banner](https://developers.vtex.com/docs/guides/vtex-search-banner) block."},"html":{"type":"string","description":"Banner HTML, which can be an image or text."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the banners registered for a given query. Check the [configuring banners documentation](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4ViKEivLJtJsvpaW0aqIQ5) for a full explanation of the banner feature. + + >ℹ️ **Segment context:** Intelligent Search API (Legacy) previously read `locale` from `segment.cultureInfo` in the VTEX segment cookie. In v1, pass it directly as a query parameter. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red`. ## Filter combinations - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only products that satisfy all conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. ## Available filters \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` *(optional)* \| Sales channel filter. Supported for backward compatibility; prefer the `sc` query parameter instead. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter by category level (1 = department, 2 = category, 3 = subcategory, etc.). \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by catalog specification. \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `price/100:500` \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "banners": [ + { + "id": "summersale", + "name": "Summer Sale", + "area": "1", + "html": "

This is a test

" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/List filters for a search.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/List filters for a search.yml new file mode 100644 index 0000000000..0e6146e0cd --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/List filters for a search.yml @@ -0,0 +1,276 @@ +info: + name: List filters for a search + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/facets/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: hideUnavailableItems + value: "false" + type: query + disabled: true + - name: removeHiddenFacets + value: "false" + type: query + disabled: true + - name: sc + value: "1" + type: query + disabled: true + - name: regionId + value: Ut exerci + type: query + disabled: true + - name: country + value: USA + type: query + disabled: true + - name: zip-code + value: "10001" + type: query + disabled: true + - name: coordinates + value: -43.19532775878906,-22.955032348632812 + type: query + disabled: true + - name: pickupPoint + value: Ut exerci + type: query + disabled: true + - name: deliveryZonesHash + value: 4bab2513d897914b0b33f25c8c74f571 + type: query + disabled: true + - name: pickupPointsHash + value: d41d8cd98f00b204e9800998ecf8427e + type: query + disabled: true + - name: facets + value: category-1/clothing + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/facets/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/facets/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/facets/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/facets/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"facets":{"type":"array","description":"List of facets.","items":{"type":"object","description":"Facet information.","properties":{"values":{"type":"array","description":"Possible values.","items":{"type":"object","properties":{"id":{"type":"string","description":"Value ID."},"quantity":{"type":"number","description":"Number of resulting products."},"name":{"type":"string","description":"Human-readable format of the facet value."},"key":{"type":"string","description":"Facet key."},"value":{"type":"string","description":"Facet value."},"selected":{"type":"boolean","description":"Defines whether the value is selected (`true`) or not (`false`)."},"href":{"type":"string","description":"Query URL."}}}},"type":{"type":"string","description":"Facet type, which can be:\r\n\r\n- `TEXT`: The value is a simple text.\r\n- `PRICERANGE`: The value contains the property `range` representing the minimum and the maximum price for the query.\r\n- `DELIVERY`: The value represents a delivery option. Only appears in searches using [Delivery Promise](https://help.vtex.com/docs/tutorials/delivery-promise-beta).","enum":["TEXT","PRICERANGE","DELIVERY"]},"name":{"type":"string","description":"Human-readable format of the facet key."},"hidden":{"type":"boolean","description":"Defines whether the client-side should hide the facet (`true`) or not (`false`)."},"key":{"type":"string","description":"Facet key."},"quantity":{"type":"number","description":"Number of possible values."}}}},"sampling":{"type":"boolean","description":"Indicates whether there was sampling in the aggregation of facets. In search results with many products, only the first 30000 are aggregated to avoid performance issues."},"breadcrumb":{"type":"array","description":"Generated breadcrumb for the given query.","items":{"type":"object","properties":{"name":{"type":"string","description":"Breadcrumb label."},"href":{"type":"string","description":"Breadcrumb link."}}}},"queryArgs":{"type":"object","description":"Term and facets used in the query.","properties":{"query":{"type":"string","description":"Search term used in the query."},"selectedFacets":{"type":"array","description":"Facets used in the query.","items":{"type":"object","properties":{"key":{"type":"string","description":"Facet key."},"value":{"type":"string","description":"Facet value."}}}}}},"translated":{"type":"boolean","description":"Defines whether the facets were translated by Intelligent Search (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the possible facets for a given query. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. + + >ℹ️ **Segment context:** Several parameters on this endpoint replace values previously read from the VTEX segment cookie. See [Migrating from segment](#migrating-from-segment) below. + + ## Migrating from segment + + Intelligent Search API (Legacy) reads the following values from the VTEX segment cookie. In v1, pass each one directly as a query parameter: + + | v1 parameter | Segment source | + |:---|:---| + | `locale` | `segment.cultureInfo` | + | `sc` | `segment.channel` | + | `regionId` | `segment.regionId` | + | `country` | `segment.countryCode` or `country` key in `segment.facets` | + | `zip-code` | `zip-code` key in `segment.facets` | + | `coordinates` | `coordinates` key in `segment.facets` | + | `pickupPoint` | `pickupPoint` key in `segment.facets` | + | `deliveryZonesHash` | `deliveryZonesHash` key in `segment.facets` | + | `pickupPointsHash` | `pickupPointsHash` key in `segment.facets` | + + All other keys in `segment.facets` must be appended to the URL path as `key/value` pairs. + +
+ TypeScript reference implementation + + The following TypeScript snippet shows the full translation: + + ```typescript + type Segment = { + channel?: string | number + regionId?: string + countryCode?: string + cultureInfo?: string + // Semicolon-separated "key=value" string, e.g. "zip-code=22250-040;country=BRA;brand=acme" + facets?: string + } + + const SHIPPING_KEYS = new Set([ + 'zip-code', 'coordinates', 'country', 'pickupPoint', + 'deliveryZonesHash', 'pickupPointsHash', + ]) + + function segmentToFacetsV1(segment: Segment, query?: string): string { + const shipping: Record = {} + const pathFacets: Array<{ key: string; value: string }> = [] + + for (const pair of (segment.facets ?? '').split(';')) { + const eq = pair.indexOf('=') + if (eq < 0) continue + const key = pair.slice(0, eq) + const value = pair.slice(eq + 1) + if (!key || !value) continue + + if (SHIPPING_KEYS.has(key)) { + shipping[key] = value + } else { + pathFacets.push({ key, value }) + } + } + + const params: Record = {} + const set = (name: string, value?: string | number) => { + if (value !== undefined && value !== null && value !== '') { + params[name] = String(value) + } + } + + set('sc', segment.channel) + set('locale', segment.cultureInfo) + set('regionId', segment.regionId) + set('country', segment.countryCode ?? shipping.country) + set('zip-code', shipping['zip-code']) + set('coordinates', shipping.coordinates) + set('pickupPoint', shipping.pickupPoint) + set('deliveryZonesHash', shipping.deliveryZonesHash) + set('pickupPointsHash', shipping.pickupPointsHash) + + if (query) params.query = query + + const facetPath = pathFacets.map(f => `${f.key}/${f.value}`).join('/') + const search = new URLSearchParams(params).toString() + + return `https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/facets${facetPath ? `/${facetPath}` : ''}?${search}` + } + ``` + +
+ + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red`. ## Filter combinations - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only products that satisfy all conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. ## Available filters \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` *(optional)* \| Sales channel filter. Supported for backward compatibility; prefer the `sc` query parameter instead. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter by category level (1 = department, 2 = category, 3 = subcategory, etc.). \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by catalog specification. \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `price/100:500` \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + | `hideUnavailableItems` | query | Defines whether the result should hide unavailable items (`true`) or not (`false`). When set to `true`, only products with stock are returned. | + | `removeHiddenFacets` | query | When `true`, hidden facets are omitted from the response. | + | `sc` | query | Sales channel (trade policy) ID. Alternative to including `trade-policy/{id}` in the facets path. Intelligent Search API (Legacy) previously read this from `segment.channel`. In v1, pass the value directly as a query parameter. | + | `regionId` | query | Region ID for regionalized results. Intelligent Search API (Legacy) previously read this from `segment.regionId`. In v1, pass the value directly as a query parameter. | + | `country` | query | Three-letter country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. Intelligent Search API (Legacy) previously read this from `segment.countryCode` or the `country` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `zip-code` | query | ZIP or postal code. Intelligent Search API (Legacy) previously read this from the `zip-code` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `coordinates` | query | Geographic coordinates in the format `longitude,latitude`. Intelligent Search API (Legacy) previously read this from the `coordinates` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPoint` | query | Pickup point ID for pickup-in-point delivery context. Intelligent Search API (Legacy) previously read this from the `pickupPoint` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `deliveryZonesHash` | query | Pre-computed delivery zones hash for faster regionalization lookup. Obtain this value from the `POST` [Search delivery zones](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/delivery-zones/_search/v2) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `deliveryZonesHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPointsHash` | query | Pre-computed pickup points hash for faster regionalization lookup. Obtain this value from the `POST` [Search pickup points](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/pickuppoints/_search) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `pickupPointsHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + + ## Example response (`200`) + + ```json + { + "facets": [ + { + "values": [ + { + "id": "47", + "quantity": 1, + "name": "Clothing", + "key": "category-2", + "value": "clothing", + "selected": false, + "href": "shirt/blue/clothing?map=ft,color,category" + } + ], + "type": "TEXT", + "name": "Category", + "hidden": false, + "key": "category-2", + "quantity": 1 + }, + { + "values": [ + { + "quantity": 1, + "name": "", + "key": "price", + "selected": false, + "range": { + "from": 45, + "to": 50 + } + } + ], + "type": "PRICERANGE", + "name": "Price", + "hidden": false, + "key": "price", + "quantity": 1 + } + ], + "sampling": false, + "breadcrumb": [ + { + "name": "shirt", + "href": "/shirt?map=ft" + } + ], + "queryArgs": { + "query": "shirt", + "selectedFacets": [ + { + "key": "ft", + "value": "shirt" + } + ] + }, + "translated": false + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Search products.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Search products.yml new file mode 100644 index 0000000000..5b9f11ecf0 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/Search products.yml @@ -0,0 +1,408 @@ +info: + name: Search products + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/product-search/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: count + value: "24" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: sort + value: "" + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: hideUnavailableItems + value: "false" + type: query + disabled: true + - name: simulationBehavior + value: default + type: query + disabled: true + - name: sc + value: "1" + type: query + disabled: true + - name: regionId + value: Ut exerci + type: query + disabled: true + - name: country + value: USA + type: query + disabled: true + - name: zip-code + value: "10001" + type: query + disabled: true + - name: coordinates + value: -43.19532775878906,-22.955032348632812 + type: query + disabled: true + - name: pickupPoint + value: Ut exerci + type: query + disabled: true + - name: deliveryZonesHash + value: 4bab2513d897914b0b33f25c8c74f571 + type: query + disabled: true + - name: pickupPointsHash + value: d41d8cd98f00b204e9800998ecf8427e + type: query + disabled: true + - name: dpPreview + value: "true" + type: query + disabled: true + - name: utmSource + value: Ut exerci + type: query + disabled: true + - name: utmCampaign + value: Ut exerci + type: query + disabled: true + - name: utmiCampaign + value: Ut exerci + type: query + disabled: true + - name: campaigns + value: Ut exerci + type: query + disabled: true + - name: priceTables + value: Ut exerci + type: query + disabled: true + - name: showSponsored + value: "false" + type: query + disabled: true + - name: sponsoredCount + value: "5" + type: query + disabled: true + - name: advertisementPlacement + value: top_search + type: query + disabled: true + - name: repeatSponsoredProducts + value: "true" + type: query + disabled: true + - name: facets + value: category-1/clothing + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/product-search/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/product-search/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/product-search/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/product-search/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"products":{"type":"array","description":"List of active products. Includes any sponsored products when requested.","items":{"type":"object","description":"Product information.","properties":{"cacheId":{"description":"Cache ID.","type":"string"},"productId":{"description":"Product unique identifier.","type":"string"},"description":{"description":"Product description.","type":"string"},"productName":{"description":"Product name.","type":"string"},"productReference":{"description":"Product reference code.","type":"string"},"linkText":{"description":"Product slug (link text).","type":"string"},"brand":{"description":"Brand name.","type":"string"},"brandId":{"description":"Brand unique identifier.","type":"number"},"link":{"description":"Product URL path in the store.","type":"string"},"categories":{"description":"Category paths.","type":"array","items":{"description":"Category path.","type":"string"}},"categoryId":{"description":"Category unique identifier.","type":"string"},"categoriesIds":{"description":"List of category IDs in the corresponding category path.","type":"array","items":{"description":"Category ID.","type":"string"}},"priceRange":{"description":"Price range information.","type":"object","properties":{"sellingPrice":{"description":"Selling price range.","type":"object","properties":{"highPrice":{"description":"Highest selling price.","type":"number"},"lowPrice":{"description":"Lowest selling price.","type":"number"}}},"listPrice":{"description":"List price range.","type":"object","properties":{"highPrice":{"description":"Highest list price.","type":"number"},"lowPrice":{"description":"Lowest list price.","type":"number"}}}}},"specificationGroups":{"description":"Specification groups information.","type":"array","items":{"type":"object","description":"Specification group information.","properties":{"originalName":{"description":"Specification group original name.","type":"string"},"name":{"description":"Specification group name.","type":"string"},"specifications":{"description":"List of specifications.","type":"array","items":{"type":"object","description":"Specification information.","properties":{"originalName":{"description":"Specification original name.","type":"string"},"name":{"description":"Specification name.","type":"string"},"values":{"description":"Specification values.","type":"array","items":{"type":"string"}}}}}}}},"skuSpecifications":{"description":"SKU specifications.","type":"array","items":{"type":"object","description":"SKU specification information.","properties":{"field":{"type":"object","description":"SKU specification field.","properties":{"name":{"type":"string","description":"SKU specification field name."},"originalName":{"type":"string","description":"SKU specification field original name."}}},"values":{"type":"array","description":"SKU specification field values.","items":{"type":"object","properties":{"name":{"type":"string","description":"SKU specification value name."},"originalName":{"type":"string","description":"SKU specification value original name."}}}}}}},"productClusters":{"description":"Product clusters (collections) the product belongs to.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Cluster unique identifier."},"name":{"type":"string","description":"Cluster name."}}}},"clusterHighlights":{"description":"Cluster highlights information.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Cluster unique identifier."},"name":{"type":"string","description":"Cluster name."}}}},"properties":{"description":"Product properties.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Property name."},"originalName":{"type":"string","description":"Property original name."},"values":{"type":"array","items":{"type":"string","description":"Property value."}}}}},"items":{"description":"Information about the related SKUs.","type":"array","items":{"type":"object","description":"SKU information.","additionalProperties":true,"properties":{"sellers":{"description":"List of sellers.","type":"array","items":{"type":"object","description":"Seller information.","properties":{"sellerId":{"description":"Seller unique identifier.","type":"string"},"sellerName":{"description":"Seller name.","type":"string"},"addToCartLink":{"description":"Add to cart link.","type":"string"},"sellerDefault":{"description":"Whether this is the default seller.","type":"boolean"},"commertialOffer":{"description":"Commercial offer information.","type":"object","properties":{"DeliverySlaSamplesPerRegion":{"description":"Delivery SLA samples per region.","type":"object","additionalProperties":true},"DeliverySlaSamples":{"description":"Delivery SLA samples.","type":"array","items":{"type":"object","additionalProperties":true}},"AvailableQuantity":{"description":"Indicates availability. `10000` means available; `0` means unavailable.","type":"number"},"discountHighlights":{"description":"Discount highlights.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Discount highlight name."}}}},"Installments":{"description":"Installments information.","type":"array","items":{"type":"object","properties":{"PaymentSystemName":{"type":"string","description":"Payment system name."},"Value":{"type":"number","description":"Installment value."},"InterestRate":{"type":"number","description":"Interest rate."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate."},"NumberOfInstallments":{"type":"number","description":"Number of installments."},"Name":{"type":"string","description":"Payment condition name."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group."}}}},"Price":{"description":"Price of the item.","type":"number"},"ListPrice":{"description":"List price of the item.","type":"number"},"spotPrice":{"description":"Special promotional price available under specific conditions, such as a discount for a specific payment method. May differ from `Price`.","type":"number"},"taxPercentage":{"description":"Tax percentage.","type":"number"},"PriceWithoutDiscount":{"description":"Price without discount.","type":"number"},"Tax":{"description":"Tax value.","type":"number"},"GiftSkuIds":{"description":"List of gift SKU IDs.","type":"array","items":{"type":"string"}},"BuyTogether":{"description":"IDs of items that can be bought together with this item.","type":"array","items":{"type":"string"}},"RewardValue":{"description":"Credit the customer receives when finalizing an order that includes this SKU.","type":"number"},"PriceValidUntil":{"description":"Date until the price is valid, in ISO 8601 format.","type":"string"},"GetInfoErrorMessage":{"description":"Get info error message.","type":["string","null"]},"CacheVersionUsedToCallCheckout":{"description":"Cache version used to call Checkout.","type":"string"},"teasers":{"description":"Promotion teasers.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Promotion name."},"conditions":{"type":"object","description":"Conditions for the promotion to be valid.","properties":{"minimumQuantity":{"type":"number","description":"Minimum quantity of the item."},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}}}}},"effects":{"type":"object","description":"Promotion effects.","properties":{"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}}}}}}}}}}}}},"images":{"description":"SKU images.","type":"array","items":{"type":"object","properties":{"imageId":{"type":"string","description":"Image unique identifier."},"cacheId":{"type":"string","description":"Cache ID."},"imageTag":{"type":"string","description":"HTML tag for the selected image."},"imageLabel":{"type":"string","description":"Image label."},"imageText":{"type":"string","description":"Image text (alt text)."},"imageUrl":{"type":"string","description":"Image URL."}}}},"itemId":{"description":"SKU unique identifier.","type":"string"},"name":{"description":"SKU name.","type":"string"},"nameComplete":{"description":"Combination of the product name and the SKU name.","type":"string"},"complementName":{"description":"Complement name.","type":"string"},"referenceId":{"description":"SKU alternate IDs.","type":"array","items":{"type":"object","properties":{"Key":{"type":"string","description":"Alternate ID key."},"Value":{"type":"string","description":"Alternate ID value."}}}},"measurementUnit":{"description":"Measurement unit.","type":"string"},"unitMultiplier":{"description":"Unit multiplier. If the multiplier is 5.0000, the product can be added in multiples of 5.","type":"number"},"variations":{"description":"Variations.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Variation name."},"values":{"type":"array","items":{"type":"string"}}}}},"ean":{"description":"EAN value.","type":"string"},"modalType":{"description":"Links an unusual type of SKU to a carrier specialized in delivering it (e.g. `\"Refrigerated products\"`). See [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125).","type":"string"},"videos":{"description":"SKU videos.","type":"array","items":{"type":"string","description":"Video URL."}},"attachments":{"description":"Attachments related to the SKU.","type":"array","items":{"type":"object","description":"Attachment information.","properties":{"id":{"type":"number","description":"Attachment unique identifier."},"name":{"type":"string","description":"Attachment name."},"schema":{"type":"object","description":"Free-form JSON schema describing the attachment.","additionalProperties":true},"fields":{"type":"array","description":"Attachment fields.","items":{"type":"object","properties":{"field_name":{"type":"string","description":"Field name."},"max_characters":{"type":"string","description":"Maximum number of characters allowed for the field."},"domain_values":{"type":"string","description":"Allowed values for the field."}}}},"isActive":{"type":"boolean","description":"Whether the attachment is active."},"isRequired":{"type":"boolean","description":"Whether the attachment is required."}}}},"isKit":{"description":"Defines whether the SKU is a kit (`true`) or not (`false`).","type":"boolean"},"kitItems":{"description":"SKUs that compose the kit. Returned when `isKit` is `true`.","type":["array","null"],"items":{"type":"object","properties":{"itemId":{"type":"string","description":"Component SKU ID."},"amount":{"type":"number","description":"Quantity of the component SKU per kit."}}}},"estimatedDateArrival":{"description":"Estimated arrival date for the SKU, when configured.","type":["string","null"]}}}},"releaseDate":{"description":"Release date.","type":"number"},"origin":{"description":"Origin of the product in the trade policy.","type":"string"}}}},"recordsFiltered":{"type":"number","description":"Total number of matching products."},"correction":{"type":"object","description":"Present when a spelling correction applies.","properties":{"misspelled":{"type":"boolean","description":"Defines whether the search term is misspelled (`true`) or not (`false`)."}}},"fuzzy":{"type":"string","description":"Indicates how the search engine corrected the misspelled word by using fuzzy logic."},"operator":{"type":"string","enum":["and","or"],"description":"Indicates how the search engine dealt with the full-text query when there is more than one word."},"redirect":{"type":["string","null"],"description":"Redirect URL when the query maps to a configured redirect rule. Present only when a redirect applies."},"translated":{"type":"boolean","description":"Defines whether the list of products was translated by Intelligent Search (`true`) or not (`false`)."},"pagination":{"type":"object","description":"Pagination information.","properties":{"count":{"description":"Page count.","type":"number"},"current":{"description":"Information about the current page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"before":{"description":"Information about the previous pages.","type":"array","items":{"type":"object","properties":{"index":{"description":"Page index.","type":"number"}}}},"after":{"description":"Information about the following pages.","type":"array","items":{"type":"object","properties":{"index":{"description":"Page index.","type":"number"}}}},"perPage":{"description":"Amount of results per page.","type":"number"},"next":{"description":"Information about the next page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"previous":{"description":"Information about the previous page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"first":{"description":"Information about the first page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"last":{"description":"Information about the last page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}}}},"options":{"type":"object","description":"Search options available for the query.","properties":{"sorts":{"type":"array","description":"Available sort options.","items":{"type":"object","additionalProperties":true}},"counts":{"type":"array","description":"Available product count options.","items":{"type":"object","additionalProperties":true}},"deliveryPromisesEnabled":{"type":"boolean","description":"Whether Delivery Promise features are enabled for this query."}}},"searchId":{"type":"string","description":"Unique identifier for the search session. Use this value when sending search analytics events."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the active products for a given query. + + >⚠️ **Fetching a single known product?** Use `GET` [Get product](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/products) instead. It skips the search pipeline (lower latency) and caches better. + + >ℹ️ **Caching:** Responses are cached for public sales channels. Always read the `Cache-Control` response header at runtime to determine cacheability. Responses containing sponsored products are not cached. + + >ℹ️ **Segment context:** Several parameters on this endpoint replace values previously read from the VTEX segment cookie. See [Migrating from segment](#migrating-from-segment) below. + + ## Migrating from segment + + Intelligent Search API (Legacy) reads the following values from the VTEX segment cookie. In v1, pass each one directly as a query parameter: + + | v1 parameter | Segment source | + |:---|:---| + | `locale` | `segment.cultureInfo` | + | `sc` | `segment.channel` | + | `regionId` | `segment.regionId` | + | `country` | `segment.countryCode` or `country` key in `segment.facets` | + | `zip-code` | `zip-code` key in `segment.facets` | + | `coordinates` | `coordinates` key in `segment.facets` | + | `pickupPoint` | `pickupPoint` key in `segment.facets` | + | `deliveryZonesHash` | `deliveryZonesHash` key in `segment.facets` | + | `pickupPointsHash` | `pickupPointsHash` key in `segment.facets` | + | `utmSource` | `segment.utm_source` | + | `utmCampaign` | `segment.utm_campaign` | + | `utmiCampaign` | `segment.utmi_campaign` | + | `campaigns` | `segment.campaigns` | + | `priceTables` | `segment.priceTables` | + + All other keys in `segment.facets` must be appended to the URL path as `key/value` pairs. + +
+ TypeScript reference implementation + + The following TypeScript snippet shows the full translation: + + ```typescript + type Segment = { + channel?: string | number + regionId?: string + countryCode?: string + cultureInfo?: string + // Semicolon-separated "key=value" string, e.g. "zip-code=22250-040;country=BRA" + facets?: string + utm_source?: string + utm_campaign?: string + utmi_campaign?: string + campaigns?: string + priceTables?: string + } + + const SHIPPING_KEYS = new Set([ + 'zip-code', 'coordinates', 'country', 'pickupPoint', + 'deliveryZonesHash', 'pickupPointsHash', + ]) + + function segmentToProductSearchV1(segment: Segment, query?: string): string { + const shipping: Record = {} + const pathFacets: Array<{ key: string; value: string }> = [] + + for (const pair of (segment.facets ?? '').split(';')) { + const eq = pair.indexOf('=') + if (eq < 0) continue + const key = pair.slice(0, eq) + const value = pair.slice(eq + 1) + if (!key || !value) continue + + if (SHIPPING_KEYS.has(key)) { + shipping[key] = value + } else { + pathFacets.push({ key, value }) + } + } + + const params: Record = {} + const set = (name: string, value?: string | number) => { + if (value !== undefined && value !== null && value !== '') { + params[name] = String(value) + } + } + + set('sc', segment.channel) + set('locale', segment.cultureInfo) + set('regionId', segment.regionId) + set('country', segment.countryCode ?? shipping.country) + set('zip-code', shipping['zip-code']) + set('coordinates', shipping.coordinates) + set('pickupPoint', shipping.pickupPoint) + set('deliveryZonesHash', shipping.deliveryZonesHash) + set('pickupPointsHash', shipping.pickupPointsHash) + set('utmSource', segment.utm_source) + set('utmCampaign', segment.utm_campaign) + set('utmiCampaign', segment.utmi_campaign) + set('campaigns', segment.campaigns) + set('priceTables', segment.priceTables) + + if (query) params.query = query + + const facetPath = pathFacets.map(f => `${f.key}/${f.value}`).join('/') + const search = new URLSearchParams(params).toString() + + return `https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/product-search${facetPath ? `/${facetPath}` : ''}?${search}` + } + ``` + +
+ + ## Sponsored products (VTEX Ads) + + The query parameters **`showSponsored`**, **`sponsoredCount`**, **`advertisementPlacement`**, and **`repeatSponsoredProducts`** apply only to stores using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). Sponsored products are merged into the `products` array. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/docs/tutorials/license-manager-resources). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red`. ## Filter combinations - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only products that satisfy all conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. ## Available filters \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` *(optional)* \| Sales channel filter. Supported for backward compatibility; prefer the `sc` query parameter instead. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter by category level (1 = department, 2 = category, 3 = subcategory, etc.). \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by catalog specification. \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `price/100:500` \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters at the end of the store URL: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Supported ID types \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `count` | query | Number of products per page. | + | `page` | query | Current search page. | + | `sort` | query | Defines how results are sorted. Relevance is the **default** sorting type, applied when this parameter is omitted, null, or empty. Allowed values: - **Omitted, empty, or null** (default): Results are sorted by relevance. - `price:desc`: Results are sorted by price in descending order. - `price:asc`: Results are sorted by price in ascending order. - `orders:desc`: Results are sorted by the amount of orders in the past 90 days, in descending order. - `name:desc`: Results are sorted by name in descending alphabetical order. - `name:asc`: Results are sorted by name in ascending alphabetical order. - `release:desc`: Results are sorted by release date in descending order. - `discount:desc`: Results are sorted by discount percentage in descending order. | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. Intelligent Search API (Legacy) previously read this from `segment.cultureInfo`. In v1, pass the value directly as a query parameter. | + | `hideUnavailableItems` | query | Defines whether the result should hide unavailable items (`true`) or not (`false`). When set to `true`, only products with stock are returned. | + | `simulationBehavior` | query | Defines the pricing and availability simulation behavior. - `default`: Calls the simulation for every single seller. - `skip`: Never calls the simulation. Use for the fastest response when live pricing is not required. - `only1P`: Only calls the simulation for first-party sellers. - `only3P`: Only calls the simulation for third-party sellers. - `regionalize1p`: Calls regionalized simulation for first-party sellers only. | + | `sc` | query | Sales channel (trade policy) ID. Alternative to including `trade-policy/{id}` in the facets path. Intelligent Search API (Legacy) previously read this from `segment.channel`. In v1, pass the value directly as a query parameter. | + | `regionId` | query | Region ID for regionalized results. Intelligent Search API (Legacy) previously read this from `segment.regionId`. In v1, pass the value directly as a query parameter. | + | `country` | query | Three-letter country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. Intelligent Search API (Legacy) previously read this from `segment.countryCode` or the `country` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `zip-code` | query | ZIP or postal code. Intelligent Search API (Legacy) previously read this from the `zip-code` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `coordinates` | query | Geographic coordinates in the format `longitude,latitude`. Intelligent Search API (Legacy) previously read this from the `coordinates` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPoint` | query | Pickup point ID for pickup-in-point delivery context. Intelligent Search API (Legacy) previously read this from the `pickupPoint` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `deliveryZonesHash` | query | Pre-computed delivery zones hash for faster regionalization lookup. Obtain this value from the `POST` [Search delivery zones](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/delivery-zones/_search/v2) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `deliveryZonesHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `pickupPointsHash` | query | Pre-computed pickup points hash for faster regionalization lookup. Obtain this value from the `POST` [Search pickup points](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/pickuppoints/_search) endpoint of the Delivery Promise Suggestions API. Intelligent Search API (Legacy) previously read this from the `pickupPointsHash` key in `segment.facets`. In v1, pass the value directly as a query parameter. | + | `dpPreview` | query | Previews [Delivery Promise](https://developers.vtex.com/docs/guides/delivery-promise) behavior on accounts still in the `DpReady` activation state, without affecting production search requests. When set to `true`, the response returns `deliveryPromiseEnabled: false`. Once the account is promoted to `DpLive`, remove this parameter, since Delivery Promise is applied in production and the response returns `deliveryPromiseEnabled: true`. | + | `utmSource` | query | UTM source value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utm_source`. In v1, pass the value directly as a query parameter. | + | `utmCampaign` | query | UTM campaign value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utm_campaign`. In v1, pass the value directly as a query parameter. | + | `utmiCampaign` | query | UTMi campaign value, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.utmi_campaign`. In v1, pass the value directly as a query parameter. | + | `campaigns` | query | Campaign identifier, forwarded to the pricing and availability simulation. Intelligent Search API (Legacy) previously read this from `segment.campaigns`. In v1, pass the value directly as a query parameter. | + | `priceTables` | query | Price table(s) to apply during simulation. Intelligent Search API (Legacy) previously read this from `segment.priceTables`. In v1, pass the value directly as a query parameter. | + | `showSponsored` | query | Defines if sponsored products are listed (`true`) or not (`false`). Applicable to stores using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads) to offer ad space. | + | `sponsoredCount` | query | Amount of sponsored products to be returned. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + | `advertisementPlacement` | query | Advertisement placement. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + | `repeatSponsoredProducts` | query | When `true`, the same product can appear as both sponsored and organic. When `false`, sponsored products are removed from the organic list. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + + ## Example response (`200`) + + ```json + { + "products": [ + { + "cacheId": "sp-2000003", + "productId": "2000003", + "description": "Introducing our exquisite Top Wood Clock.", + "productName": "Top Wood Clock", + "productReference": "clock120", + "linkText": "wood-clock", + "brand": "Sony", + "brandId": 2000005, + "link": "/wood-clock/p", + "categories": [ + "/Home & Decor/" + ], + "categoryId": "40", + "categoriesIds": [ + "/40/" + ], + "priceRange": { + "sellingPrice": { + "highPrice": 197.99, + "lowPrice": 197.99 + }, + "listPrice": { + "highPrice": 197.99, + "lowPrice": 197.99 + } + }, + "specificationGroups": [], + "skuSpecifications": [], + "productClusters": [], + "clusterHighlights": [], + "properties": [], + "items": [ + { + "sellers": [ + { + "sellerId": "1", + "sellerName": "VTEX", + "addToCartLink": "", + "sellerDefault": true, + "commertialOffer": { + "AvailableQuantity": 10000, + "Price": 197.99, + "ListPrice": 197.99, + "spotPrice": 197.99, + "Tax": 0, + "PriceValidUntil": "2025-04-01T13:13:20Z" + } + } + ], + "images": [], + "itemId": "2000534", + "name": "1", + "nameComplete": "Top Wood Clock 1", + "measurementUnit": "un", + "unitMultiplier": 1, + "variations": [], + "ean": "16001", + "modalType": "", + "videos": [], + "attachments": [], + "isKit": false + } + ], + "origin": "intelligent-search" + } + ], + "recordsFiltered": 5, + "correction": { + "misspelled": false + }, + "fuzzy": "0", + "operator": "and", + "translated": false, + "pagination": { + "count": 1, + "current": { + "index": 1 + }, + "before": [], + "after": [], + "perPage": 24, + "next": { + "index": 2 + }, + "previous": { + "index": 0 + }, + "first": { + "index": 1 + }, + "last": { + "index": 1 + } + }, + "options": { + "sorts": [], + "counts": [], + "deliveryPromisesEnabled": false + }, + "searchId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/folder.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/folder.yml new file mode 100644 index 0000000000..42a377c851 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/Product list page/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product list page + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/environments/VTEX.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/environments/VTEX.yml new file mode 100644 index 0000000000..7b80620747 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api/intelligent-search/v1 diff --git a/BrunoCollections/VTEX - Intelligent Search API - v1/opencollection.yml b/BrunoCollections/VTEX - Intelligent Search API - v1/opencollection.yml new file mode 100644 index 0000000000..9bb0197a54 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API - v1/opencollection.yml @@ -0,0 +1,26 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Intelligent Search API - v1 + +docs: + content: |- + [VTEX Intelligent Search](https://help.vtex.com/docs/tracks/overview-intelligent-search) is search solution for digital commerce that delivers relevant product results, autocomplete suggestions, and personalized experiences based on the catalog from the user's first interaction with the store. This API enables headless implementations to integrate VTEX Intelligent Search capabilities into custom storefronts. + + This reference documents **Intelligent Search API v1**, which replaces the [Intelligent Search API (Legacy)](https://developers.vtex.com/docs/api-reference/intelligent-search-api) at `/api/io/_v/api/intelligent-search/*`. + + >ℹ️ If you are migrating from the legacy API, see [Migrating to Intelligent Search API v1](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Common Parameters + + | Parameter | Description | + | --- | --- | + | `{{accountName}}` | Name of your VTEX account. Used in the base URL. | + | `{{environment}}` | Environment to use. Typically `vtexcommercestable` for production. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml new file mode 100644 index 0000000000..eb06762e83 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms and attributes similar to the search term.yml @@ -0,0 +1,120 @@ +info: + name: Get list of suggested terms and attributes similar to the search term + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/autocomplete_suggestions" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/autocomplete_suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/autocomplete_suggestions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/autocomplete_suggestions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/autocomplete_suggestions - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of suggested facets and terms.","items":{"type":"object","description":"Suggested facet or term.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."},"attributes":{"type":["array","null"],"description":"List of facets in which the term can be searched.","items":{"type":"object","description":"Facet information.","properties":{"key":{"type":"string","description":"Facet key."},"value":{"type":"string","description":"Facet value."},"labelKey":{"type":"string","description":"Human-readable format of the facet key."},"labelValue":{"type":"string","description":"Human-readable format of the facet value."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the suggested terms and attributes similar to the search term. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4gXFsEWjF7QF7UtI2GAvhL) guide. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching, lower latency, and a simpler URL structure. The new endpoint is: `GET` [Get list of suggested terms and attributes similar to the search term](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/autocomplete-suggestions). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "tv", + "count": 28861, + "attributes": [ + { + "key": "departamento", + "value": "tvs-e-video", + "labelKey": "Departamento", + "labelValue": "TVs e Vídeo" + }, + { + "key": "categoria", + "value": "tvs", + "labelKey": "Categoria", + "labelValue": "TVs" + }, + { + "key": "subcategoria", + "value": "receptor-de-controle-de-acesso", + "labelKey": "Subcategoria", + "labelValue": "Receptor de Controle de Acesso" + } + ] + }, + { + "term": "smarth tv", + "count": 2308 + }, + { + "term": "painel para tv", + "count": 975 + }, + { + "term": "rack tv", + "count": 589 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms similar to the search term.yml b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms similar to the search term.yml new file mode 100644 index 0000000000..9766b90b95 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of suggested terms similar to the search term.yml @@ -0,0 +1,104 @@ +info: + name: Get list of suggested terms similar to the search term + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/search_suggestions" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/search_suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/search_suggestions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/search_suggestions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/search_suggestions - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of suggested terms.","items":{"type":"object","description":"Suggested term.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists suggested terms similar to the search term. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4gXFsEWjF7QF7UtI2GAvhL) guide. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching, lower latency, and a simpler URL structure. The new endpoint is: `GET` [Get list of suggested terms similar to the search term](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/search-suggestions). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "mountain bike", + "count": 66 + }, + { + "term": "bike helmet", + "count": 121 + }, + { + "term": "electric bike", + "count": 78 + }, + { + "term": "bike rack", + "count": 161 + }, + { + "term": "road bike", + "count": 28 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of the 10 most searched terms.yml b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of the 10 most searched terms.yml new file mode 100644 index 0000000000..629399d1f5 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/Get list of the 10 most searched terms.yml @@ -0,0 +1,119 @@ +info: + name: Get list of the 10 most searched terms + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/top_searches" + headers: + - name: Accept + value: application/json + params: + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/top_searches - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/top_searches - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/top_searches - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/top_searches - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"searches":{"type":"array","description":"List of the 10 most searched terms in the past 14 days.","minItems":10,"maxItems":10,"items":{"type":"object","description":"Term information.","properties":{"term":{"type":"string","description":"Search term."},"count":{"type":"number","description":"Number of times the term was searched."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the 10 most searched terms in the past 14 days. + + For more information, check the Intelligent Search [Autocomplete](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4gXFsEWjF7QF7UtI2GAvhL) guide. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching, lower latency, and a simpler URL structure. The new endpoint is: `GET` [Get list of the 10 most searched terms](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/top-searches). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + + ## Example response (`200`) + + ```json + { + "searches": [ + { + "term": "home", + "count": 14 + }, + { + "term": "shirt", + "count": 10 + }, + { + "term": "top", + "count": 9 + }, + { + "term": "tops", + "count": 6 + }, + { + "term": "camera", + "count": 5 + }, + { + "term": "kit", + "count": 5 + }, + { + "term": "work shirt", + "count": 2 + }, + { + "term": "shirts", + "count": 2 + }, + { + "term": "clothing", + "count": 2 + }, + { + "term": "classic shoes", + "count": 1 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/folder.yml b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/folder.yml new file mode 100644 index 0000000000..de3ede36ef --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Autocomplete/folder.yml @@ -0,0 +1,4 @@ +info: + name: Autocomplete + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/Get pickup point availability for Delivery Promise.yml b/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/Get pickup point availability for Delivery Promise.yml new file mode 100644 index 0000000000..ce724d654c --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/Get pickup point availability for Delivery Promise.yml @@ -0,0 +1,231 @@ +info: + name: Get pickup point availability for Delivery Promise + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/pickup-point-availability/:facets?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: pickupPoint + value: irure + type: query + disabled: true + - name: an + value: apiexamples + type: query + - name: coordinates + value: -74.0060,40.7128 + type: query + disabled: true + - name: zip-code + value: "10001" + type: query + disabled: true + - name: country + value: USA + type: query + disabled: true + - name: deliveryZonesHash + value: abc123def456 + type: query + disabled: true + - name: pickupPointsHash + value: xyz789ghi012 + type: query + disabled: true + - name: facets + value: category-1/clothing/category-2/shirt/category-3/man + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pickup-point-availability/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pickup-point-availability/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/pickup-point-availability/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pickup-point-availability/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Pickup points availability response.","properties":{"pickupPointDistances":{"type":"array","description":"List of available pickup points sorted by distance.","items":{"type":"object","description":"Pickup point information.","properties":{"pickupId":{"type":"string","description":"Unique identifier for the pickup point."},"pickupName":{"type":"string","description":"Name of the pickup point."},"distance":{"type":"number","description":"Distance from the provided coordinates to the pickup point, in kilometers."},"isActive":{"type":"boolean","description":"Indicates whether the pickup point is currently active (`true`) or not (`false`)."},"address":{"type":"object","description":"Address details of the pickup point.","properties":{"street":{"type":"string","description":"Street name of the pickup point address."},"number":{"type":"string","description":"Street number of the pickup point address."},"neighborhood":{"type":"string","description":"Neighborhood of the pickup point address."},"city":{"type":"string","description":"City of the pickup point address."},"state":{"type":"string","description":"State or province of the pickup point address."},"postalCode":{"type":"string","description":"Postal code or ZIP code of the pickup point address."}}},"businessHours":{"type":"array","description":"Operating hours for each day of the week.","items":{"type":"object","description":"Business hours for a specific day.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week represented as a number (0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday).","enum":[0,1,2,3,4,5,6]},"openingTime":{"type":"string","description":"Opening time in 24-hour format with seconds (HH:MM:SS)."},"closingTime":{"type":"string","description":"Closing time in 24-hour format with seconds (HH:MM:SS)."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of available pickup points with their IDs, distances, addresses, and business hours. This endpoint returns pickup points sorted by distance from the provided coordinates. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching and lower latency. The new endpoint is: `GET` [Get pickup point availability for Delivery Promise](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/pickup-point-availability/-facets-). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + >⚠️ **Required facet:** Only the `tradePolicy` (trade policy/sales channel) facet is required. All product filters, including `productClusterIds`, are optional and can be provided as query parameters to narrow down the results. When no product filters are provided, all available pickup points for the trade policy will be returned. + + >ℹ️ This endpoint is designed for use in [Delivery Promise for headless stores](https://developers.vtex.com/docs/guides/delivery-promise-for-headless-stores) implementations. It provides the complete list of pickup points required as a mandatory dependency for the [Delivery Promise feature](https://help.vtex.com/en/docs/tutorials/delivery-promise-beta). The system displays all available pickup points within the 50 km radius configured in Checkout when customers select pickup in the header or a specific pickup point. + + You can call this endpoint in two ways: + + - **With country and ZIP code:** Provide the country and ZIP code to retrieve pickup points based on location. + - **With delivery zones and pickup point hashes:** Alternatively, provide pre-computed hashes (`deliveryZonesHash` and `pickupPointsHash`) for faster lookup. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. >⚠️ **Required:** Only the `trade-policy` facet is mandatory. All other facets are optional filters. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red/color/yellow`. ## Filter combinations When shoppers apply filters, the API combines them according to the following rules: - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only the products that satisfy all selected facet conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. Use the same `not:` prefix with the facet keys and values configured in your catalog. This supports use cases such as including products in one collection but excluding another. The NOT operator excludes specific values. The OR and AND rules in **Filter combinations** still describe how multiple positive facet selections combine. ## Available filters The `facets` parameter allows the following filters: \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` **(required)** \| Filter by trade policy (sales channel) using `trade-policy/{tradePolicyId}`. Some integrations use the `salesChannel` query string for the same purpose when supported. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter the search by category, where n represents the category tree level (1 = department, 2 = category, 3 = subcategory, and so on). Declare the full path from the root level through every parent down to the level you need. For example, using only `category-2/shirts` without the `category-1/...` segment is incorrect. \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug or identifier. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by a catalog specification exposed as a search filter, using `{specificationName}/{specificationValue}` (for example `color/blue`). \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `trade-policy/1/color/blue/price/100:500` (with `?query=shirt` on the full URL when using a text query). \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + | `pickupPoint` | query | Pickup point ID to filter results to a specific pickup point. | + | `an` | query | (Required) Account name. The name of the VTEX account. | + | `coordinates` | query | Geographic coordinates in the format `longitude,latitude`. Used to calculate distance from pickup points and sort results by proximity. Required when using the country and ZIP code approach. | + | `zip-code` | query | ZIP code or postal code. Required when using the country and ZIP code approach. | + | `country` | query | Three-letter country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. Required when using the country and ZIP code approach. | + | `deliveryZonesHash` | query | Pre-computed hash for delivery zones. Used for faster lookup. Required when using the hashes approach (alternative to country and ZIP code). Obtain this value from the `POST` [Search delivery zones](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/delivery-zones/_search/v2) endpoint of the Delivery Promise Suggestions API. | + | `pickupPointsHash` | query | Pre-computed hash for pickup points. Used for faster lookup. Required when using the hashes approach (alternative to country and ZIP code). Obtain this value from the `POST` [Search pickup points](https://developers.vtex.com/docs/api-reference/delivery-promise-suggestions-api#post-/api/logistics-shipping/pickuppoints/_search) endpoint of the Delivery Promise Suggestions API. | + + ## Example response (`200`) + + ```json + { + "pickupPointDistances": [ + { + "pickupId": "pickup_store_001", + "distance": 5.5, + "pickupName": "Store North Shopping Center", + "isActive": true, + "address": { + "city": "City Name", + "neighborhood": "North District", + "number": "1000", + "postalCode": "12345-678", + "street": "Main Avenue", + "state": "ST" + }, + "businessHours": [ + { + "dayOfWeek": 0, + "openingTime": "10:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + }, + { + "dayOfWeek": 6, + "openingTime": "09:00:00", + "closingTime": "20:00:00" + } + ] + }, + { + "pickupId": "pickup_store_002", + "distance": 12.3, + "pickupName": "Store Downtown", + "isActive": true, + "address": { + "city": "City Name", + "neighborhood": "Downtown", + "number": "500", + "postalCode": "12345-000", + "street": "Central Street", + "state": "ST" + }, + "businessHours": [ + { + "dayOfWeek": 0, + "openingTime": "12:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 1, + "openingTime": "08:00:00", + "closingTime": "19:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "08:00:00", + "closingTime": "19:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "08:00:00", + "closingTime": "19:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "08:00:00", + "closingTime": "19:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "08:00:00", + "closingTime": "19:00:00" + }, + { + "dayOfWeek": 6, + "openingTime": "09:00:00", + "closingTime": "17:00:00" + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/folder.yml b/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/folder.yml new file mode 100644 index 0000000000..d0d4c02f30 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Delivery Promise/folder.yml @@ -0,0 +1,4 @@ +info: + name: Delivery Promise + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get attempt of correction of a misspelled term.yml b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get attempt of correction of a misspelled term.yml new file mode 100644 index 0000000000..fd60b8d098 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get attempt of correction of a misspelled term.yml @@ -0,0 +1,86 @@ +info: + name: Get attempt of correction of a misspelled term + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/correction_search" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/correction_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/correction_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/correction_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/correction_search - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"correction":{"type":"object","description":"Object that indicates if the term was misspelled and suggests a possible correction.","properties":{"misspelled":{"type":"boolean","description":"Defines whether the term was misspelled (`true`) or not (`false`)."},"correction":{"type":"boolean","description":"Defines whether the API was able to suggest a correction (`true`) or not (`false`)."},"text":{"type":"string","description":"The corrected term. If the API was not able to correct the term, it will show the original search term."},"highlighted":{"type":"string","description":"The same as `text`, but it highlights the corrected word. Useful when there is more than one word."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Tries to correct a misspelled term from the search. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching, lower latency, and a simpler URL structure. The new endpoint is: `GET` [Get attempt of correction of a misspelled term](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/correction-search). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + + ## Example response (`200`) + + ```json + { + "correction": { + "correction": true, + "misspelled": true, + "text": "mountain bike", + "highlighted": "mountain bike" + } + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of banners registered for query.yml b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of banners registered for query.yml new file mode 100644 index 0000000000..02e52fd592 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of banners registered for query.yml @@ -0,0 +1,92 @@ +info: + name: Get list of banners registered for query + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/banners/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: facets + value: category-1/clothing/category-2/shirt/category-3/man + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/banners/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/banners/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/banners/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/banners/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"banners":{"type":"array","description":"List of banners.","items":{"type":"object","description":"Banner information.","properties":{"id":{"type":"string","description":"Banner ID."},"name":{"type":"string","description":"Banner name."},"area":{"type":"string","description":"Banner area, which can be a number between 1 and 4, to be used in the store's [Banner](https://developers.vtex.com/docs/guides/vtex-search-banner) block."},"html":{"type":"string","description":"Banner HTML, which can be an image or text."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the banners registered for a given query. Check the [configuring banners documentation](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4ViKEivLJtJsvpaW0aqIQ5) for a full explanation of the banner feature. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching, lower latency, and a simpler URL structure. The new endpoint is: `GET` [Get list of banners registered for query](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/banners/-facets-). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. >⚠️ **Required:** Only the `trade-policy` facet is mandatory. All other facets are optional filters. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red/color/yellow`. ## Filter combinations When shoppers apply filters, the API combines them according to the following rules: - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only the products that satisfy all selected facet conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. Use the same `not:` prefix with the facet keys and values configured in your catalog. This supports use cases such as including products in one collection but excluding another. The NOT operator excludes specific values. The OR and AND rules in **Filter combinations** still describe how multiple positive facet selections combine. ## Available filters The `facets` parameter allows the following filters: \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` **(required)** \| Filter by trade policy (sales channel) using `trade-policy/{tradePolicyId}`. Some integrations use the `salesChannel` query string for the same purpose when supported. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter the search by category, where n represents the category tree level (1 = department, 2 = category, 3 = subcategory, and so on). Declare the full path from the root level through every parent down to the level you need. For example, using only `category-2/shirts` without the `category-1/...` segment is incorrect. \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug or identifier. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by a catalog specification exposed as a search filter, using `{specificationName}/{specificationValue}` (for example `color/blue`). \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `trade-policy/1/color/blue/price/100:500` (with `?query=shirt` on the full URL when using a text query). \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + + ## Example response (`200`) + + ```json + { + "banners": [ + { + "id": "summersale", + "name": "Summer Sale", + "area": "1", + "html": "

This is a test

" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of products for a query.yml b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of products for a query.yml new file mode 100644 index 0000000000..fc6b9be469 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of products for a query.yml @@ -0,0 +1,146 @@ +info: + name: Get list of products for a query + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/product_search/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: count + value: "24" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: sort + value: "" + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: hideUnavailableItems + value: "false" + type: query + disabled: true + - name: simulationBehavior + value: default + type: query + disabled: true + - name: showSponsored + value: "false" + type: query + disabled: true + - name: sponsoredCount + value: "5" + type: query + disabled: true + - name: advertisementPlacement + value: top_search + type: query + disabled: true + - name: repeatSponsoredProducts + value: "true" + type: query + disabled: true + - name: facets + value: category-1/clothing/category-2/shirt/category-3/man + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/product_search/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/product_search/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/product_search/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/product_search/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"products":{"type":"array","description":"List of active products.","items":{"type":"object","description":"Product information.","properties":{"cacheId":{"description":"Cache ID.","type":"string"},"productId":{"description":"Product unique identifier.","type":"string"},"description":{"description":"Product description.","type":"string"},"productName":{"description":"Product name.","type":"string"},"productReference":{"description":"Product reference code.","type":"string"},"linkText":{"description":"Product text link.","type":"string"},"brand":{"description":"Brand name.","type":"string"},"brandId":{"description":"Brand unique identifier.","type":"number"},"link":{"description":"Product slug in the store.","type":"string"},"categories":{"description":"Category path.","type":"array","items":{"description":"Category name.","type":"string"}},"categoryId":{"description":"Category unique identifier.","type":"string"},"categoriesIds":{"description":"List of category IDs in the corresponding category path.","type":"array","items":{"description":"Category ID.","type":"string"}},"priceRange":{"description":"Price range information.","type":"object","properties":{"sellingPrice":{"description":"Selling price.","type":"object","properties":{"highPrice":{"description":"Highest selling price.","type":"number"},"lowPrice":{"description":"Lowest selling price.","type":"number"}}},"listPrice":{"description":"List price information.","type":"object","properties":{"highPrice":{"description":"Highest list price.","type":"number"},"lowPrice":{"description":"Lowest list price.","type":"number"}}}}},"specificationGroups":{"description":"Specification groups information.","type":"array","items":{"description":"Specification group information.","type":"object","properties":{"originalName":{"description":"Speficiation group original name.","type":"string"},"name":{"description":"Specification group name.","type":"string"},"specifications":{"description":"List of specifications.","type":"array","items":{"description":"Specification information.","type":"object","properties":{"originalName":{"description":"Specification original name.","type":"string"},"name":{"description":"Specification name.","type":"string"},"values":{"description":"Specification values.","type":"array","items":{"description":"Specification value.","type":"string"}}}}}}}},"skuSpecifications":{"description":"SKU specifications.","type":"array","items":{"description":"SKU specification information.","type":"object","properties":{"field":{"description":"SKU specification field information.","type":"object","properties":{"name":{"description":"SKU specification field name.","type":"string"},"originalName":{"description":"SKU specification field original name.","type":"string"}}},"values":{"description":"SKU specification field values.","type":"array","items":{"description":"SKU specification value.","type":"object","properties":{"name":{"description":"SKU specification value name.","type":"string"},"originalName":{"description":"SKU specification value original name.","type":"string"}}}}}}},"productClusters":{"description":"Product clusters information.","type":"array","items":{"description":"Product cluster information.","type":"object","properties":{"id":{"description":"Product cluster unique identifier.","type":"string"},"name":{"description":"Product cluster name.","type":"string"}}}},"clusterHighlights":{"description":"Cluster highlights information.","type":"array","items":{"description":"Cluster highlight information.","type":"object","properties":{"id":{"description":"Product cluster unique identifier.","type":"string"},"name":{"description":"Product cluster name.","type":"string"}}}},"properties":{"description":"Product properties.","type":"array","items":{"description":"Product property.","type":"object","properties":{"name":{"description":"Property name.","type":"string"},"originalName":{"description":"Property original name.","type":"string"},"values":{"description":"Property values.","type":"array","items":{"description":"Property value.","type":"string"}}}}},"items":{"description":"Information about the related SKUs.","type":"array","items":{"description":"SKU information.","type":"object","additionalProperties":true,"properties":{"sellers":{"description":"List of sellers.","type":"array","items":{"description":"Seller information.","type":"object","properties":{"sellerId":{"description":"Seller unique identifier.","type":"string"},"sellerName":{"description":"Seller name.","type":"string"},"addToCartLink":{"description":"Add to cart link.","type":"string"},"sellerDefault":{"description":"Default seller.","type":"boolean"},"commertialOffer":{"description":"Commercial offer information.","type":"object","properties":{"DeliverySlaSamplesPerRegion":{"description":"Delivery SLA samples per region.","type":"object","additionalProperties":true},"DeliverySlaSamples":{"description":"Delivery SLA samples.","type":"array","items":{"type":"object","description":"Delivery SLA sample.","properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types.","items":{"type":"object","description":"Delivery SLA information.","properties":{"Price":{"type":"integer","description":"Price of the delivery SLA type in cents."},"TypeName":{"type":"string","description":"SLA type name."},"EstimatedTimeSpanToDelivery":{"type":"integer","description":"Estimated delivery time span."}}}},"Region":{"type":["string","null"],"description":"Region ID."}}}},"AvailableQuantity":{"description":"Indicates if the item is available. The value is 10000 when the item is considered available, and 0 when the item is not available.","type":"number"},"discountHighlights":{"description":"Discount highlights.","type":"array","items":{"type":"object","description":"Discount highlight information.","properties":{"name":{"type":"string","description":"Discount highlight name."}}}},"Installments":{"description":"Installments information.","type":"array","items":{"description":"Installment information.","type":"object","properties":{"PaymentSystemName":{"description":"Payment system name.","type":"string"},"Value":{"description":"Total value.","type":"number"},"InterestRate":{"description":"Interest rate.","type":"number"},"TotalValuePlusInterestRate":{"description":"Total value plus interest rate.","type":"number"},"NumberOfInstallments":{"description":"Number of installments.","type":"number"},"Name":{"description":"Payment condition name.","type":"string"},"PaymentSystemGroupName":{"description":"Payment system group.","type":"string"}}}},"Price":{"description":"Price of the item.","type":"number"},"ListPrice":{"description":"List price of the item.","type":"number"},"spotPrice":{"description":"The special promotional price available under specific conditions, such as discounts for upfront payments or specific payment methods. It may differ from the `sellingPrice`.\n\n\nOne common example is when a discount is applied only under certain conditions, such as a discount for using a specific payment method (e.g. 5% off for payments made with a VISA card). In this case, the `spotPrice` would reflect this discounted price, while the `sellingPrice` would show the regular price if the payment method does not qualify for the discount.","type":"number"},"taxPercentage":{"description":"Tax percentage.","type":"number"},"PriceWithoutDiscount":{"description":"Price with discount.","type":"number"},"Tax":{"description":"Tax value.","type":"number"},"GiftSkuIds":{"description":"List of SKU gifts IDs.","type":"array","items":{"type":"string","description":"SKU gift unique identifier."}},"BuyTogether":{"description":"Array of other items that can be bought together with the item in question.","type":"array","items":{"type":"string","description":"Unique identifier of each SKU that can be bought together."}},"ItemMetadataAttachment":{"description":"Item metadata attachment.","type":"array","items":{"description":"Item metadata attachment information.","type":"object","properties":{"Name":{"description":"SKU name.","type":"string"},"NameComplete":{"description":"Complete name of the product combined with the SKU name.","type":"string"},"MainImage":{"description":"Main image URL.","type":"string"},"BrandName":{"description":"Brand name.","type":"string"},"CategoryId":{"description":"Category unique identifier.","type":"number"},"ProductId":{"description":"Product unique identifier.","type":"number"},"id":{"description":"SKU unique identifier.","type":"string"},"seller":{"description":"Seller unique identifier.","type":"string"},"assemblyOptions":{"description":"Assembly options attachment.","type":"array","items":{"description":"Assembly options attachment information.","type":"object","properties":{"id":{"description":"Attachment unique identifier.","type":"string"},"name":{"description":"Attachment name.","type":"string"},"required":{"description":"Defines whether the attachment is required (`true`) or not (`false`).","type":"boolean"},"inputValues":{"description":"Input values information.","type":"object","additionalProperties":true}}}}}}},"RewardValue":{"description":"Credit that the customer receives when finalizing an order that includes the SKU. By filling this field out with `1`, the customer receives credit on the site in the selected currency, e.g. U$ 1.","type":"number"},"PriceValidUntil":{"description":"Date until the price is valid, in ISO 8601 format.","type":"string"},"GetInfoErrorMessage":{"description":"Get info error message.","type":["string","null"]},"CacheVersionUsedToCallCheckout":{"description":"Cache version used to call Checkout.","type":"string"},"teasers":{"description":"Teasers information.","type":"array","items":{"description":"Teaser information.","type":"object","properties":{"name":{"description":"Promotion name.","type":"string"},"conditions":{"description":"Conditions for the promotion the be valid.","type":"object","properties":{"minimumQuantity":{"description":"Minimum quantity of the item for the promotion to be valid.","type":"number"},"parameters":{"description":"Condition parameters.","type":"array","items":{"description":"Condition parameters.","type":"object","properties":{"name":{"description":"Condition name.","type":"string"},"value":{"description":"Condition value.","type":"string"}}}}}},"effects":{"description":"Promotion effects.","type":"object","properties":{"parameters":{"description":"Effects parameters.","type":"array","items":{"description":"Effect parameters.","type":"object","properties":{"name":{"description":"Effect name.","type":"string"},"value":{"description":"Effect value.","type":"string"}}}}}}}}}}}}}},"images":{"description":"SKU images information.","type":"array","items":{"description":"SKU image information.","type":"object","properties":{"imageId":{"description":"Image unique identifier.","type":"string"},"cacheId":{"description":"Cache ID.","type":"string"},"imageTag":{"description":"HTML tag for the selected image.","type":"string"},"imageLabel":{"description":"Image label.","type":"string"},"imageText":{"description":"Image text.","type":"string"},"imageUrl":{"description":"Image URL.","type":"string"}}}},"itemId":{"description":"SKU unique identifier.","type":"string"},"name":{"description":"SKU name.","type":"string"},"nameComplete":{"description":"Combination of the product name with the SKU name.","type":"string"},"complementName":{"description":"Complement name.","type":"string"},"referenceId":{"description":"SKU alternate IDs.","type":"array","items":{"description":"Alternate ID information.","type":"object","properties":{"Key":{"description":"Alternate ID key.","type":"string"},"Value":{"description":"Alternate ID value.","type":"string"}}}},"measurementUnit":{"description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. For example, if a product is sold in boxes, but customers want to buy per square meter (m²). In common cases, use `'un'`.","type":"string"},"unitMultiplier":{"description":"Multiple number of SKU. If the multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward.","type":"number"},"variations":{"description":"Variations.","type":"array","items":{"description":"Variation information.","type":"object","properties":{"name":{"description":"Variation name.","type":"string"},"values":{"description":"Variation values.","type":"array","items":{"description":"Variation value.","type":"string"}}}}},"ean":{"description":"EAN value.","type":"string"},"modalType":{"description":"Links an unusual type of SKU that needs special transportation, such as meat, glass, or a mattress, to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy).","type":"string"},"videos":{"description":"SKU videos.","type":"array","items":{"type":"string","description":"Video URL."}},"attachments":{"description":"Array with information about the attachments that are related to the SKU.","type":"array","items":{"type":"object","description":"Attachment information.","properties":{"id":{"type":"string","description":"Attachment unique identifier."},"name":{"type":"string","description":"Attachment name."},"required":{"type":"boolean","description":"Defines if the attachment is required (`true`) or not (`false`)."},"domainValues":{"type":"array","description":"Attachment domain values.","items":{"type":"object","description":"Attachment information.","properties":{"FieldName":{"type":"string","description":"Attachment name."},"DomainValues":{"type":"string","description":"Attachment value."}}}}}}},"isKit":{"description":"Defines whether the SKU is made up of one or more SKUs (part of a kit) (`true`) or not (`false`). Must be enabled if you are adding a kit. Once activated, this definition cannot be reverted.","type":"boolean"}}}},"releaseDate":{"description":"Release date.","type":"number"},"origin":{"description":"Origin of products in the trade policy.","type":"string"}}}},"recordsFiltered":{"type":"number","description":"Total number of filtered active products."},"correction":{"type":"object","description":"Object with information of misspelled terms.","properties":{"misspelled":{"type":"boolean","description":"Defines whether the term is misspelled (`true`) or not (`false`)."}}},"fuzzy":{"type":"string","description":"Indicates how the search engine corrected the misspelled word by using fuzzy logic. It can be a number representing the max number of misspelled letters, or the string `auto` suggesting that the search-engine should set this value by itself."},"operator":{"type":"string","enum":["and","or"],"description":"Indicates how the search-engine dealt with the fullText when there is more than one word.\n * `and` - It means that the products contains all the words in the query.\n * `or` - It means that the results will contain at least one word from the original search query. If `and` was not possible, `or` will be the fallback."},"translated":{"type":"boolean","description":"Defines whether the list of products was translated by Intelligent Search (`true`) or not (`false`)."},"redirect":{"type":["string","null"],"description":"Redirect URL when the query maps to a configured redirect rule. Present only when a redirect applies."},"options":{"type":"object","description":"Search options available for the query.","properties":{"sorts":{"type":"array","description":"Available sort options.","items":{"type":"object","description":"Sort option entry.","additionalProperties":true}},"counts":{"type":"array","description":"Available product count options.","items":{"type":"object","description":"Product count option entry.","additionalProperties":true}},"deliveryPromisesEnabled":{"type":"boolean","description":"Whether Delivery Promise features are enabled for this query."}}},"searchId":{"type":"string","description":"Unique identifier for the search session. Use this value when sending search analytics events."},"pagination":{"type":"object","description":"Pagination information.","properties":{"count":{"description":"Page count.","type":"number"},"current":{"description":"Information about the current page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"},"proxyUrl":{"description":"Proxy URL.","type":"string"}}},"before":{"description":"Information about the previous pages.","type":"array","items":{"description":"Page information.","type":"object","properties":{"index":{"description":"Page index.","type":"number"},"proxyUrl":{"description":"Proxy URL.","type":"string"}}}},"after":{"description":"Information about the following pages.","type":"array","items":{"description":"Page information.","type":"object","properties":{"index":{"description":"Page index.","type":"number"},"proxyUrl":{"description":"Proxy URL.","type":"string"}}}},"perPage":{"description":"Amount of results per page.","type":"number"},"next":{"description":"Information about the next page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"},"proxyUrl":{"description":"Proxy URL.","type":"string"}}},"previous":{"description":"Information about the previous page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"first":{"description":"Information about the first page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}},"last":{"description":"Information about the last page.","type":"object","properties":{"index":{"description":"Page index.","type":"number"}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the active products for a given query. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching (`Cache-Control: public, max-age=600`), lower latency, and explicit regionalization without relying on the segment cookie. The new endpoint is: `GET` [Search products](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/product-search/-facets-). If you need to look up a single product by a known identifier (for a product detail page), use the new `GET` [Get product](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/products) endpoint. It skips the search pipeline entirely, reducing latency and improving cache-hit rates. See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + >⚠️ **Required facet:** Only the `trade-policy` facet is required in the path. All other facets (such as `productClusterIds`, `category`, `color`, etc.) are optional filters that can be used to narrow down the search results. When no additional facets are provided, all products for the trade policy will be returned. + + >⚠️ When possible, use the store's production domain in the URL (for example, `https://apiexamples.com/api/io/_v/api/intelligent-search`) for a better performance. This is particularly important for headless integrations. In case it's not possible to use the store's production URL, prefer using `https://{accountName}.vtexcommercestable.com.br/api/io/_v/api/intelligent-search`. + + If using this option in a fully headless store with no store domain configured, follow these steps: + 1. Configure a domain by following the [Configuring the store domain](https://help.vtex.com/docs/tutorials/configuring-the-store-domain) guide. + 2. Send the `Host` header with the configured domain: + ```sh + curl --location 'https://{accountName}.vtexcommercestable.com.br/api/io/_v/api/intelligent-search/product_search/' \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --header 'Host: {configured domain}' + ``` + + ## Sponsored products (VTEX Ads) + + The query parameters **`showSponsored`**, **`sponsoredCount`**, **`advertisementPlacement`**, and **`repeatSponsoredProducts`** apply only to stores using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). See each parameter for behavior details. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. >⚠️ **Required:** Only the `trade-policy` facet is mandatory. All other facets are optional filters. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red/color/yellow`. ## Filter combinations When shoppers apply filters, the API combines them according to the following rules: - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only the products that satisfy all selected facet conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. Use the same `not:` prefix with the facet keys and values configured in your catalog. This supports use cases such as including products in one collection but excluding another. The NOT operator excludes specific values. The OR and AND rules in **Filter combinations** still describe how multiple positive facet selections combine. ## Available filters The `facets` parameter allows the following filters: \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` **(required)** \| Filter by trade policy (sales channel) using `trade-policy/{tradePolicyId}`. Some integrations use the `salesChannel` query string for the same purpose when supported. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter the search by category, where n represents the category tree level (1 = department, 2 = category, 3 = subcategory, and so on). Declare the full path from the root level through every parent down to the level you need. For example, using only `category-2/shirts` without the `category-1/...` segment is incorrect. \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug or identifier. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by a catalog specification exposed as a search filter, using `{specificationName}/{specificationValue}` (for example `color/blue`). \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `trade-policy/1/color/blue/price/100:500` (with `?query=shirt` on the full URL when using a text query). \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `count` | query | Number of products per page. | + | `page` | query | Current search page. | + | `sort` | query | Defines how results are sorted. Relevance is Intelligent Search's **default** sorting type, used for typical product search and applied when this parameter is omitted, null or empty. Use one of the other values listed below only when you need a fixed sort instead of relevance. Allowed values: - **Omitted, empty, or null** (default): Results are sorted by relevance. - `price:desc`: Results are sorted by price in descending order, from highest to lowest. - `price:asc`: Results are sorted by price in ascending order, from lowest to highest. - `orders:desc`: Results are sorted by the amount of orders in the past 90 days, in descending order. - `name:desc`: Results are sorted by name in descending alphabetical order. - `name:asc`: Results are sorted by name in ascending alphabetical order. - `release:desc`: Results are sorted by release date in descending order, from most recent to least recent. - `discount:desc`: Results are sorted by discount percentage in descending order, from highest to lowest. | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + | `hideUnavailableItems` | query | Defines whether the result should hide unavailable items (`true`), or not (`false`). When set to `true`, only products with stock are returned; when set to `false`, the API includes unavailable products as well. A product is considered unavailable when `availableQuantity = 0`, while `availableQuantity = 10000` indicates that the product is available. Retailers may choose to show unavailable items for commercial reasons (for example, to signal that they offer those products even if temporarily out-of-stock). The recommended default is `true`. | + | `simulationBehavior` | query | Defines the simulation behavior. * `default` - Calls the simulation for every single seller. * `skip` - Never calls the simulation. * `only1P` - Only calls the simulation for first-party sellers. * `only3P` - Only calls the simulation for third-party sellers. * `regionalize1p` - Calls regionalized simulation for first-party sellers only. | + | `showSponsored` | query | Defines if sponsored products are listed (`true`) or not (`false`). Applicable to stores using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads) to offer ad space. | + | `sponsoredCount` | query | Amount of sponsored products to be returned. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + | `advertisementPlacement` | query | Advertisement placement. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + | `repeatSponsoredProducts` | query | Defines if sponsored products can appear again as organic listings. When set as `true`, it allows the same product to be shown as both sponsored and organic. When set as `false`, it removes duplicates, ensuring a sponsored product does not appear again as organic. Applicable only to merchants using [VTEX Ads](https://developers.vtex.com/docs/guides/vtex-ads). | + + ## Example response (`200`) + + _Omitted here: 17 KB. See `OK + + List of products for the given query.` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of the possible facets for a given query.yml b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of the possible facets for a given query.yml new file mode 100644 index 0000000000..f3e10e8441 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Product list page/Get list of the possible facets for a given query.yml @@ -0,0 +1,260 @@ +info: + name: Get list of the possible facets for a given query + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/facets/:facets" + headers: + - name: Accept + value: application/json + params: + - name: query + value: shirt + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: hideUnavailableItems + value: "false" + type: query + disabled: true + - name: removeHiddenFacets + value: "true" + type: query + disabled: true + - name: facets + value: category-1/clothing/category-2/shirt/category-3/man + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/facets/:facets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/facets/:facets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/facets/:facets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/facets/:facets - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"facets":{"type":"array","description":"List of facets.","items":{"type":"object","description":"Facet information.","properties":{"values":{"type":"array","description":"Possible values.","items":{"type":"object","description":"Value information.","properties":{"id":{"type":"string","description":"Value ID."},"quantity":{"type":"number","description":"Number of resulting products."},"name":{"type":"string","description":"Human-readable format of the facet value."},"key":{"type":"string","description":"Facet key."},"value":{"type":"string","description":"Facet value."},"selected":{"type":"boolean","description":"Defines whether the value is selected (`true`) or not (`false`)."},"href":{"type":"string","description":"Query URL."}}}},"type":{"type":"string","description":"Facet type, which can be:\n\n - `TEXT`: The value is a simple text.\n - `PRICERANGE`: The value contains the property `range` representing the minimum and the maximum price for the query.\n - `DELIVERY`: The value represents a delivery option. Only appears in searches using [Delivery Promise](https://help.vtex.com/docs/tutorials/delivery-promise-beta).","enum":["TEXT","PRICERANGE","DELIVERY"]},"name":{"type":"string","description":"Human-readable format of the facet key."},"hidden":{"type":"boolean","description":"Defines whether the client-side should hide the facet (`true`) or not (`false`)."},"key":{"type":"string","description":"Facet key."},"quantity":{"type":"number","description":"Number of possible values."}}}},"sampling":{"type":"boolean","description":"Indicates whether there was sampling in the aggregation of facets or not. In search results that have many products, only the first 30000 will be aggregated to avoid performance issues."},"breadcrumb":{"type":"array","description":"Generated breadcrumb for the given query.","items":{"type":"object","description":"Breadcrumb information.","properties":{"name":{"type":"string","description":"Human-readable format of the facet key."},"href":{"type":"string","description":"Query link."}}}},"queryArgs":{"type":"object","description":"Term and facets used in the query.","properties":{"query":{"type":"string","description":"Search term used in the query."},"selectedFacets":{"type":"array","description":"Facets used in the query.","items":{"type":"object","description":"Selected facet information.","properties":{"key":{"type":"string","description":"facet key."},"value":{"type":"string","description":"facet value."}}}}}},"translated":{"type":"boolean","description":"Defines whether the facets were translated by Intelligent Search (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the possible facets for a given query. + + >ℹ️ Migrate to [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) for HTTP caching (`Cache-Control: public, max-age=600`), lower latency, and explicit regionalization without relying on the segment cookie. The new endpoint is: `GET` [List filters for a search](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/facets/-facets-). See the [migration guide](https://developers.vtex.com/docs/guides/migrating-to-intelligent-search-api-v1). + + >⚠️ When possible, use the store's production domain in the URL (for example, `https://apiexamples.com/api/io/_v/api/intelligent-search`) for a better performance. This is particularly important for headless integrations. In case it's not possible to use the store's production URL, prefer using `https://{accountName}.vtexcommercestable.com.br/api/io/_v/api/intelligent-search`. + + If using this option in a fully headless store with no store domain configured, follow these steps: + 1. Configure a domain by following the [Configuring the store domain](https://help.vtex.com/docs/tutorials/configuring-the-store-domain) guide. + 2. Send the `Host` header with the configured domain: + ```sh + curl --location 'https://{accountName}.vtexcommercestable.com.br/api/io/_v/api/intelligent-search/facets/' \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --header 'Host: {configured domain}' + ``` + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facets` | path | (Required) ## Format The `facets` parameter follows the format: `/${facetKey1}/${facetValue1}/${facetKey2}/${facetValue2}/.../${facetKeyN}/${facetValueN}`. >⚠️ **Required:** Only the `trade-policy` facet is mandatory. All other facets are optional filters. The order in which the terms appear is not relevant to the search. You can also repeat the same `facetKey` several times for different values. For example: `category-1/shoes/color/blue/color/red/color/yellow`. ## Filter combinations When shoppers apply filters, the API combines them according to the following rules: - **Facets of the same type → OR (union):** When multiple values of the same facet are applied, the API returns the union of all products matching any of those values. - **Facets of different types → AND (intersection):** When different facet types are combined, the API returns only the products that satisfy all selected facet conditions simultaneously. ## Negative filters (NOT operator) To exclude a facet value, prefix the value with **`not:`** in the path segment: `/{facetKey}/not:{facetValue}/`. For example, `color/blue/size/not:42` keeps color blue and excludes size 42. Use the same `not:` prefix with the facet keys and values configured in your catalog. This supports use cases such as including products in one collection but excluding another. The NOT operator excludes specific values. The OR and AND rules in **Filter combinations** still describe how multiple positive facet selections combine. ## Available filters The `facets` parameter allows the following filters: \| `facetKey` \| Description \| Example \| \| - \| - \| - \| \| `trade-policy` **(required)** \| Filter by trade policy (sales channel) using `trade-policy/{tradePolicyId}`. Some integrations use the `salesChannel` query string for the same purpose when supported. \| `trade-policy/2` \| \| `category-${n}` *(optional)* \| Filter the search by category, where n represents the category tree level (1 = department, 2 = category, 3 = subcategory, and so on). Declare the full path from the root level through every parent down to the level you need. For example, using only `category-2/shirts` without the `category-1/...` segment is incorrect. \| `category-1/clothing/category-2/shirts` \| \| `brand` *(optional)* \| Filter by brand slug or identifier. \| `brand/acme` \| \| `{specificationName}` *(optional)* \| Filter by a catalog specification exposed as a search filter, using `{specificationName}/{specificationValue}` (for example `color/blue`). \| `color/blue` \| \| `productClusterIds` *(optional)* \| Filter by collection ID. \| `productClusterIds/262` \| \| `price` *(optional)* \| Filter by price range `${minPrice}:${maxPrice}`. \| `trade-policy/1/color/blue/price/100:500` (with `?query=shirt` on the full URL when using a text query). \| | + | `query` | query | Search term. It can contain any character. This parameter is named `query` in the API. The short form **`q`** is an alias for `query` and has the same semantics. You can search for products or SKUs using specific ID types by adding search parameters (query) at the end of the store URL, respecting one of the following structures: - **Single item search:** `?query=[id type]:[id_1]`. Example: `?query=product:98765` - **Multiple items search:** `?query=[id type]:[id_1];[id_2];[id_3]`. Example: `?query=product:98765;98743` >⚠️ All searched IDs should be of the same type. ## Search by ID On the Intelligent Search API, search products or SKUs by ID by sending the value in the `query` or `q` query parameter on requests such as `/product_search/{facets}`. The `{facets}` path must include the required `trade-policy` facet and any optional filters. - **Product ID:** `.../product_search/trade-policy/1?query=product:98765` or `.../product_search/trade-policy/1?query=product.id:98765`. - **SKU ID:** `.../product_search/trade-policy/1?query=sku.id:12345` or `.../product_search/trade-policy/1?query=sku:12345`. ## Supported ID types The possible value types for the ID segment are `product.id`, `sku.id`, `sku.ean`, `sku.reference`, `product.link`, or `id` (ProductID, ProductRefID, SKUID, SKURefID, and EAN). \| ID Type \| Query format \| Example \| \| - \| - \| - \| \| Product ID \| `?query=product:` or `?query=product.id:` \| `?query=product:98765` \| \| SKU ID \| `?query=sku:` or `?query=sku.id:` \| `?query=sku.id:12345` \| \| Reference ID \| `?query=sku.reference:` \| `?query=sku.reference:REF123` \| \| EAN \| `?query=sku.ean:` \| `?query=sku.ean:7891234567890` \| \| Slug \| `?query=product.link:` \| `?query=product.link:blue-shirt` \| | + | `locale` | query | Indicates the target language as a BCP 47 language code. The Intelligent Search must have indexed the account in the target language. | + | `hideUnavailableItems` | query | Defines whether the result should hide unavailable items (`true`), or not (`false`). When set to `true`, only products with stock are returned; when set to `false`, the API includes unavailable products as well. A product is considered unavailable when `availableQuantity = 0`, while `availableQuantity = 10000` indicates that the product is available. Retailers may choose to show unavailable items for commercial reasons (for example, to signal that they offer those products even if temporarily out-of-stock). The recommended default is `true`. | + | `removeHiddenFacets` | query | When `true`, hidden facets are omitted from the response. | + + ## Example response (`200`) + + ```json + { + "facets": [ + { + "values": [ + { + "id": "47", + "quantity": 1, + "name": "Clothing", + "key": "category-2", + "value": "clothing", + "selected": false, + "href": "shirt/blue/clothing?map=ft,color,category" + } + ], + "type": "TEXT", + "name": "Category", + "hidden": false, + "key": "category-2", + "quantity": 1 + }, + { + "values": [ + { + "quantity": 1, + "name": "", + "key": "price", + "selected": false, + "range": { + "from": 45, + "to": 50 + } + } + ], + "type": "PRICERANGE", + "name": "Price", + "hidden": false, + "key": "price", + "quantity": 1 + }, + { + "values": [ + { + "id": "2000045", + "quantity": 1, + "name": "New Offers!!", + "key": "brand", + "value": "new-offers--", + "selected": false, + "href": "shirt/blue/new-offers--?map=ft,color,brand" + } + ], + "type": "TEXT", + "name": "Brand", + "hidden": false, + "key": "brand", + "quantity": 1 + }, + { + "values": [ + { + "id": "103", + "quantity": 1, + "name": "Blue", + "key": "color", + "value": "blue", + "selected": true, + "href": "shirt/blue/blue?map=ft,color,color" + } + ], + "type": "TEXT", + "name": "Color", + "hidden": true, + "key": "color", + "quantity": 1 + }, + { + "values": [ + { + "id": "25", + "quantity": 1, + "name": "Apparel & Accessories", + "key": "category-1", + "value": "apparel---accessories", + "selected": false, + "href": "shirt/blue/apparel---accessories?map=ft,color,department" + } + ], + "type": "TEXT", + "name": "Department", + "hidden": false, + "key": "category-1", + "quantity": 1 + }, + { + "values": [ + { + "id": "", + "quantity": 1, + "name": "Test", + "key": "filter-test", + "value": "test", + "selected": false, + "href": "shirt/blue/test?map=ft,color,filter-test" + } + ], + "type": "TEXT", + "name": "Filter Test", + "hidden": false, + "key": "filter-test", + "quantity": 1 + }, + { + "values": [ + { + "id": "48", + "quantity": 1, + "name": "Tops", + "key": "category-3", + "value": "tops", + "selected": false, + "href": "shirt/blue/tops?map=ft,color,subcategory" + } + ], + "type": "TEXT", + "name": "Subcategory", + "hidden": false, + "key": "category-3", + "quantity": 1 + } + ], + "sampling": false, + "breadcrumb": [ + { + "name": "shirt", + "href": "/shirt?map=ft" + }, + { + "name": "Blue", + "href": "/shirt/blue?map=ft,color" + } + ], + "queryArgs": { + "query": "shirt", + "selectedFacets": [ + { + "key": "color", + "value": "blue" + }, + { + "key": "ft", + "value": "shirt" + } + ] + }, + "translated": false + } + ``` diff --git a/BrunoCollections/VTEX - Intelligent Search API/Product list page/folder.yml b/BrunoCollections/VTEX - Intelligent Search API/Product list page/folder.yml new file mode 100644 index 0000000000..42a377c851 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/Product list page/folder.yml @@ -0,0 +1,4 @@ +info: + name: Product list page + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Intelligent Search API/environments/VTEX.yml b/BrunoCollections/VTEX - Intelligent Search API/environments/VTEX.yml new file mode 100644 index 0000000000..329136f0a8 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api/io/_v/api/intelligent-search diff --git a/BrunoCollections/VTEX - Intelligent Search API/opencollection.yml b/BrunoCollections/VTEX - Intelligent Search API/opencollection.yml new file mode 100644 index 0000000000..ca8baee403 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search API/opencollection.yml @@ -0,0 +1,30 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Intelligent Search API + +docs: + content: |- + >ℹ️ **A new version of this API is available.** The [Intelligent Search API v1](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1) replaces this API. It adds HTTP caching (`Cache-Control: public, max-age=600`) for faster storefronts, lower latency, explicit regionalization without relying on the segment cookie, and a new `GET` [Get product](https://developers.vtex.com/docs/api-reference/intelligent-search-api-v1#get-/products) endpoint for product detail pages. All new headless integrations must use Intelligent Search API v1. The endpoints listed here will be deprecated in a future announcement. Each endpoint below includes a callout with the equivalent Intelligent Search API v1 route. + + >ℹ️ Onboarding guide + > + > Check the new [Search onboarding guide](https://developers.vtex.com/docs/guides/search-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Search and is organized by focusing on the developer's journey. + + [VTEX Intelligent Search](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/3qgT47zY08biLP3d5os3DG) is a search solution for digital commerce that simply and intuitively displays relevant results based on the catalog from the user's first interaction with the store through the search bar, browsing categories, or even through the window displays. + + The tool also offers features such as autocomplete, displaying search and product suggestions based on the shopper's context, and filters that help when searching for the desired product. + + ## Common parameters + + | **Parameter name** | **Description** | + | --------------- | ----------------- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | + | ` {{environment}}` | Environment to use. Used as part of the URL. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/Save events.yml b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/Save events.yml new file mode 100644 index 0000000000..8b41da8d74 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/Save events.yml @@ -0,0 +1,62 @@ +info: + name: Save events + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/event" + headers: + - name: Content-Type + value: application/json + params: + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "session": "df66a4d239864d2e8497c89aea14a3ad", + "anonymous": "eed429ecf04a4a23ae7f4429033b48cd", + "url": "https://example.com/search/?query=zapatilha", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", + "type": "session.ping" + } + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/event - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/event - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates search events to integrate with VTEX Intelligent Search using a headless implementation. + + Read [VTEX Intelligent Search Events API - Headless - Overview](https://developers.vtex.com/docs/api-reference/intelligent-search-events-api-headless) for more information on event types and user identification. + + >⚠️ **This API applies only to Headless scenarios**. It doesn't apply to stores using VTEX's storefront solution, since they are natively integrated with Intelligent Search. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL. | diff --git a/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/folder.yml b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/folder.yml new file mode 100644 index 0000000000..906ef75a61 --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/Events/folder.yml @@ -0,0 +1,4 @@ +info: + name: Events + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Intelligent Search Events API - Headless/environments/VTEX.yml b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/environments/VTEX.yml new file mode 100644 index 0000000000..a45e88388f --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://sp.vtex.com/event-api/v1/{{accountName}} diff --git a/BrunoCollections/VTEX - Intelligent Search Events API - Headless/opencollection.yml b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/opencollection.yml new file mode 100644 index 0000000000..3a77781c9f --- /dev/null +++ b/BrunoCollections/VTEX - Intelligent Search Events API - Headless/opencollection.yml @@ -0,0 +1,172 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Intelligent Search Events API - Headless + +docs: + content: |- + Intelligent Search Events API is responsible for collecting the search events to improve your search results, such as page interactions and conversion, in a headless implementation. Some of the features improved by this collection are the possibility to sort the products by clicks or record the top search in the autocomplete. + + >⚠️ **This API applies only to Headless scenarios**. It doesn't apply to stores using Store Framework, since they are already integrated with all Intelligent Search features. + + ## Building the request body + + In the following sections, we explain the required structure for the request body for saving events. Check the `POST` [Save events](https://developers.vtex.com/docs/api-reference/intelligent-search-events-api-headless#post-/event) endpoint reference for more detailed field descriptions and examples. + + Full request example (Session Ping): + + ```json + curl --request post \ + --url https://sp.vtex.com/event-api/v1/{accountName}/event \ + --header 'Content-Type: application/json' \ + --data '{"session":"df66a4d239864d2e8497c89aea14a3ad","anonymous":"eed429ecf04a4a23ae7f4429033b48cd","url":"https://example.com/search/?query=zapatilha","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0","type":"search.query","text":"zapatilha","misspelled":true,"match":392,"operator":"and"}' + ``` + + ### User identification + + To identify the user, there are two required identifiers: `session` and `anonymous`. + + - **session**: Identifier related to the current navigation, in UUID v4 format without dashes. The session cookie must be updated with each `session.ping` event, which is essential to determine if a session is active or has been closed. A session is automatically closed after 30 minutes without any `session.ping` event. Events registered for a session that has already been closed by the system are automatically disregarded. The session identifier changes if the user opens another tab in private navigation mode. + + - **anonymous**: Identifier related to the user, in UUID v4 format without dashes. This information is kept in storage for one year. Similar to the session identifier, the anonymous identifier should be renewed to measure returning customers, though the lack of renewal is less critical due to the longer duration of this identifier. + + These IDs must be generated uniquely and must not be copies of other identifiers or tokens from the platform. We recommend using a [Universally Unique Identifier (UUID) v4](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID) without dashes. + + Sample JavaScript code to generate a random UUID without dashes: + + ```js + window.crypto.randomUUID().replaceAll('-', '') + ``` + + >⚠️ The `session` and `anonymous` identifiers must be sent in every request. + + + ### Event type + + To identify the events that occur in our search, the `type` field is required in the request. An event always depends on the previous one to be useful. The first two events (Session Ping and Search Query) are essential for basic search report information, suggestion APIs, most searched terms, and part of the relevance criteria composition. The last two events (Search Click and Page Confirmation) complement the search report and relevance criteria. + + For autocomplete functionality, the Search Autocomplete Query and Search Autocomplete Click events follow a similar pattern: the query event tracks autocomplete searches, and the click event tracks product selections from autocomplete results. These events help improve autocomplete suggestions and track user interactions within the autocomplete feature. + + The most common event types are the following: + + | Event type | Value | Description | + | - | - | - | + | Session Ping | `session.ping` | Sends an ACK to the API to renew the session server-side. It should be sent every 1 minute. This event is essential to keep the session active. A session is automatically closed after 30 minutes without any `session.ping` event, and events registered for closed sessions are automatically disregarded. | + | Search Query | `search.query` | Sends a query event every time the shopper makes a full-text search. | + | Search Click | `search.click` | Sends an event every time a shopper clicks on a product from a search page. | + | Page Confirmation |`page.confirmation` | Sends a confirmation informing the products that were bought. | + | Search Autocomplete Query | `search.autocomplete.query` | Sends a query event every time the shopper makes an autocomplete search. | + | Search Autocomplete Click | `search.autocomplete.click` | Sends an event every time a shopper clicks on a product from an autocomplete search. | + + ### Request body examples per event type + + The body is built by combining the user information, the event type, and add the optional fields. Below there is an example for each type of event. + + #### Session Ping + + + ```json + { + "session":"df66a4d239864d2e8497c89aea14a3ad", + "anonymous":"eed429ecf04a4a23ae7f4429033b48cd", + "url":"https://example.com/search/?query=zapatilha", + "agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", + "type":"session.ping" + } + ``` + + #### Search Query + + ```json + { + "session":"df66a4d239864d2e8497c89aea14a3ad", + "anonymous":"eed429ecf04a4a23ae7f4429033b48cd", + "url":"https://example.com/search/?query=zapatilha", + "agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", + "type":"search.query", + "text":"zapatilha", + "misspelled":true, + "match":392, + "operator":"and" + } + ``` + + #### Search Click + + ```json + { + "type": "search.click", + "product": "12345", + "position": 1, + "url": "https://example.com/s?q=pneu&sort=score_desc&page=0", + "text": "pneu", + "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", + "anonymous": "1ce47e50-3f10-4556-95d3-57d4881c03a4", + "session": "51a53ce3-096d-4740-a6d0-3cf86085ba13" + } + ``` + + #### Page Confirmation + + ```json + { + "session":"df66a4d239864d2e8497c89aea14a3ad", + "anonymous":"eed429ecf04a4a23ae7f4429033b48cd", + "products": [ + { + "product": "ABC123", + "price": 9.99, + "quantity": 3 + }, + { + "product": "XYZ789", + "price": 5.99, + "quantity": 2 + } + ], + "order": "123ABC", + "type": "page.confirmation" + } + ``` + + #### Search Autocomplete Query + + ```json + { + "session":"df66a4d239864d2e8497c89aea14a3ad", + "anonymous":"eed429ecf04a4a23ae7f4429033b48cd", + "url":"https://example.com/search/?query=zapatilha", + "agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0", + "type":"search.autocomplete.query", + "text":"zapatilha", + "misspelled":true, + "match":392, + "operator":"and" + } + ``` + + #### Search Autocomplete Click + + ```json + { + "type": "search.autocomplete.click", + "product": "12345", + "position": 1, + "url": "https://example.com/s?q=pneu&sort=score_desc&page=0", + "text": "pneu", + "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", + "anonymous": "1ce47e50-3f10-4556-95d3-57d4881c03a4", + "session": "51a53ce3-096d-4740-a6d0-3cf86085ba13" + } + ``` + + ### Finding search query information + + Search query information such as `operator`, `fuzzy`, and `correction` is available in the Intelligent Search API response, which is part of the normal context of a search results page. Check the `GET` [Get list of products for a query](https://developers.vtex.com/docs/api-reference/intelligent-search-api#get-/product_search/-facets-?endpoint=get-/product_search/-facets-) endpoint reference for more information. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update all account's websites internet communication protocol.yml b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update all account's websites internet communication protocol.yml new file mode 100644 index 0000000000..897fb22d54 --- /dev/null +++ b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update all account's websites internet communication protocol.yml @@ -0,0 +1,86 @@ +info: + name: Update all account's websites internet communication protocol + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: protocol + value: https + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/changeurischema/:protocol - Schema is valid", function () { + const schema = {"title":"Request Status","description":"Message indicating that the request was successful.","type":"string"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates all account's website protocols to `HTTP` or `HTTPS`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have the appropriate [License Manager resource](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. This is the applicable resource for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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 the resources above to use this endpoint. + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `protocol` | path | (Required) Internet communication protocol, it can be `HTTP` or `HTTPS`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + OK + ``` diff --git a/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update specific website comunication protocol.yml b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update specific website comunication protocol.yml new file mode 100644 index 0000000000..97c5ab14b3 --- /dev/null +++ b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/Update specific website comunication protocol.yml @@ -0,0 +1,90 @@ +info: + name: Update specific website comunication protocol + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: websiteId + value: 292c47c7-0b81-48f9-a5a0-dcf240100884 + type: path + - name: protocol + value: https + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/catalog_system/pvt/virtualfolder/site/:websiteId/changeurischema/:protocol - Schema is valid", function () { + const schema = {"title":"Request Status","description":"Message indicating that the request was successful.","type":"string"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a specific website protocol to `HTTP` or `HTTPS`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have the appropriate [License Manager resource](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. This is the applicable resource for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Configuration | **CMS Management** | + + There 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 the resources above to use this endpoint. + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `websiteId` | path | (Required) Specific website ID. | + | `protocol` | path | (Required) Internet communication protocol, it can be `HTTP` or `HTTPS`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + OK + ``` diff --git a/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/folder.yml b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/folder.yml new file mode 100644 index 0000000000..3f3f5136bf --- /dev/null +++ b/BrunoCollections/VTEX - Legacy CMS Portal API/Change URI Schema/folder.yml @@ -0,0 +1,8 @@ +info: + name: Change URI Schema + type: folder + seq: 1 + +docs: + content: Changes CMS URI + type: text/markdown diff --git a/BrunoCollections/VTEX - Legacy CMS Portal API/environments/VTEX.yml b/BrunoCollections/VTEX - Legacy CMS Portal API/environments/VTEX.yml new file mode 100644 index 0000000000..37cba74798 --- /dev/null +++ b/BrunoCollections/VTEX - Legacy CMS Portal API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.vtexcommercestable.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Legacy CMS Portal API/opencollection.yml b/BrunoCollections/VTEX - Legacy CMS Portal API/opencollection.yml new file mode 100644 index 0000000000..fbc766522c --- /dev/null +++ b/BrunoCollections/VTEX - Legacy CMS Portal API/opencollection.yml @@ -0,0 +1,32 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Legacy CMS Portal API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [CMS (Content Management System)](https://help.vtex.com/en/tracks/cms--2YcpgIljVaLVQYMzxQbc3z/1oN446gRGcR2s70RvBCAmj) is a feature dedicated to manage content in a constant and practical manner. With the Legacy CMS Portal API, you will be able to update your website internet communication protocol. + + **Server** + - `https://{accountName}.vtexcommercestable.com.br/` + + ### Common parameters + + | **Parameter name** | **Description** | **Type** | + | --------------- | ----------------- | ----------------- | + | {{accountName}} | Name of the VTEX account. Used as part of the URL. | Server variable. | + | {{protocol}} | Internet communication protocol, it can be `HTTP` or `HTTPS`. | Path variable. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - License Manager API/API keys/Create new API Key.yml b/BrunoCollections/VTEX - License Manager API/API keys/Create new API Key.yml new file mode 100644 index 0000000000..16a969bc02 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/API keys/Create new API Key.yml @@ -0,0 +1,91 @@ +info: + name: Create new API Key + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/vlm/appkeys" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "label": "my new API Key" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vlm/appkeys - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vlm/appkeys - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vlm/appkeys - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vlm/appkeys - Schema is valid", function () { + const schema = {"description":"Response body of sucessful call to /api/vlm/appkeys.","required":["id","appKey","appToken","label","createdIn","isActive"],"type":"object","properties":{"id":{"description":"ID of the API key.","type":"string"},"appKey":{"description":"AppKey.","type":"string"},"appToken":{"description":"AppToken. For security reasons, it should always be null.","type":["string","null"]},"label":{"description":"Label of the API key.","type":"string"},"createdIn":{"description":"Creation date of the API key.","type":"string","format":"date-time"},"isActive":{"description":"Defines if the API key is active (`true`) or not (`false`).","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new pair of `API Key` and `appToken`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Example response (`200`) + + ```json + { + "id": "a2555e95-9db8-48be-94f8-2a28577c0b4a", + "appKey": "vtexappkey-myaccount-ORYNWX", + "appToken": "WNVUJKYFKJFLTPXHQGAZDHPBHSDQVJJWSFZUBOGCKPEXAIFHTPANKJTOXUKRIIJAAJSOPCFBAXOODRABMUXFJVLJLKWGEOUCFDXRPRRQKYNNUFLGTIEOKERFXJCFFYXL", + "label": "my new API Key", + "createdIn": "2018-07-04T14:09:08.2718405Z", + "isActive": true + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/API keys/Get API keys from account.yml b/BrunoCollections/VTEX - License Manager API/API keys/Get API keys from account.yml new file mode 100644 index 0000000000..fdf2012c16 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/API keys/Get API keys from account.yml @@ -0,0 +1,99 @@ +info: + name: Get API keys from account + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/vlm/appkeys" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vlm/appkeys - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vlm/appkeys - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vlm/appkeys - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vlm/appkeys - Schema is valid", function () { + const schema = {"type":"array","description":"Array of AppKeys object","items":{"description":"Response body for getting all application keys from the account.","required":["id","appKey","label","createdIn","isActive"],"type":"object","properties":{"id":{"description":"ID of the API key.","type":"string"},"appKey":{"description":"API key.","type":"string"},"label":{"description":"Label of the API key.","type":"string"},"createdIn":{"description":"Creation date of the API key.","type":"string","format":"date-time"},"isActive":{"description":"Defines if the API key is active (`true`) or not (`false`).","type":"boolean"}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all application keys from an account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "id": "a2555e95-9db8-48be-94f8-2a28577c0b4a", + "appKey": "vtexappkey-myaccount-ORYNWX", + "label": "my new API Key", + "createdIn": "2018-07-04T14:09:08.2718405Z", + "isActive": true + }, + { + "id": "a2555e95-9db8-48be-94f8-2a28577c0b4a", + "appKey": "vtexappkey-myaccount-ORKPDC", + "label": "my other API Key", + "createdIn": "2018-07-04T14:09:08.2718405Z", + "isActive": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - License Manager API/API keys/Update API Key.yml b/BrunoCollections/VTEX - License Manager API/API keys/Update API Key.yml new file mode 100644 index 0000000000..3a7ed314a6 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/API keys/Update API Key.yml @@ -0,0 +1,66 @@ +info: + name: Update API Key + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/vlm/appkeys/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: aute sunt + type: path + body: + type: json + data: |- + { + "isActive": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/vlm/appkeys/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Activates or deactivates an `appKey` by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) ID from the API Key which will be updated | diff --git a/BrunoCollections/VTEX - License Manager API/API keys/folder.yml b/BrunoCollections/VTEX - License Manager API/API keys/folder.yml new file mode 100644 index 0000000000..b5c4d20f22 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/API keys/folder.yml @@ -0,0 +1,4 @@ +info: + name: API keys + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - License Manager API/Account/Get information about account.yml b/BrunoCollections/VTEX - License Manager API/Account/Get information about account.yml new file mode 100644 index 0000000000..6ff53414fb --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Account/Get information about account.yml @@ -0,0 +1,77 @@ +info: + name: Get information about account + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/vlm/account" + headers: + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vlm/account - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vlm/account - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vlm/account - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vlm/account - Schema is valid", function () { + const schema = {"description":"Successful response for `/api/vlm/account`.","type":"object","properties":{"isActive":{"description":"Defines if the account is active (`true`) or not (`false`).","type":"boolean"},"id":{"description":"ID of the account.","type":"string"},"name":{"description":"Trading name.","type":"string"},"accountName":{"description":"Account name.","type":"string"},"lv":{"type":["string","null"],"description":"Level."},"isOperating":{"description":"Defines if the account is in production (`true`) or not (`false`).","type":"boolean"},"defaultUrl":{"description":"Default URL.","type":["string","null"]},"district":{"description":"Neighborhood of the person assigned as main contact of the store.","type":["string","null"]},"country":{"description":"Country of the person assigned as main contact of the store.","type":["string","null"]},"complement":{"description":"Additional address of the person assigned as main contact of the store.","type":["string","null"]},"companyName":{"description":"Company name.","type":"string"},"cnpj":{"description":"CNPJ (Corporate Tax ID) of account.","type":["string","null"]},"haveParentAccount":{"description":"Defines if the account has a parent account (`true`) or not (`false`).","type":"boolean"},"parentAccountId":{"description":"ID of the parent account.","type":["string","null"]},"parentAccountName":{"description":"Name of the parent account.","type":["string","null"]},"city":{"description":"City of the person assigned as main contact of the store.","type":["string","null"]},"address":{"description":"Address of the person assigned as main contact of the store.","type":["string","null"]},"logo":{"description":"Filename of the account's logotype.","type":["string","null"]},"hasLogo":{"description":"Defines if the store's logotype has been uploaded (`true`) or not (`false`).","type":"boolean"},"number":{"description":"Number of the address of the person assigned as main contact of the store.","type":["string","null"]},"postalCode":{"description":"Zip code of the person assigned as main contact of the store.","type":["string","null"]},"state":{"description":"State or province of the person assigned as main contact of the store.","type":["string","null"]},"telephone":{"description":"Telephone number of the person assigned as main contact of the store.","type":"string"},"tradingName":{"description":"Trading name.","type":"string"},"licenses":{"description":"Licenses of the account.","type":"array","items":{"description":"Object representing licenses.","type":"object","properties":{"expiration":{"type":["string","null"],"format":"date-time","description":"Expiration date."},"id":{"description":"ID of the category of the license.","type":"number"},"isPurchased":{"description":"Defines if the license is purchased (`true`) or not (`false`).","type":"boolean"},"products":{"description":"Array of products.","type":"array","items":{"description":"Object representing products of licenses.","type":"object","properties":{"id":{"description":"ID of the product.","type":"number"},"name":{"description":"Name of the product.","type":"string"},"domains":{"description":"List of domains of the product.","type":"array","items":{"type":"string","description":"Domain of the product."}},"endpoints":{"type":"object","description":"Endpoints.","properties":{"webApiUrl":{"type":["string","null"],"description":"Web API URL."},"consoleUrl":{"type":["string","null"],"description":"Console URL."}}}}}},"name":{"description":"Name of the category of the license.","type":"string"}}}},"sponsor":{"description":"Object with information about the sponsor user.","type":"object","properties":{"name":{"description":"Name of the sponsor user.","type":"string"},"email":{"description":"Email of the sponsor user.","type":"string"},"phone":{"description":"Phone of the sponsor user.","type":"string"}}},"contact":{"type":"object","description":"Information about the person assigned as main contact of the store.","properties":{"name":{"description":"Name of the person assigned as main contact of the store.","type":"string"},"email":{"description":"Email of the person assigned as main contact of the store.","type":"string"},"phone":{"description":"Telephone number of the person assigned as main contact of the store.","type":"string"}}},"operationDate":{"description":"Date when the account went into production.","type":["string","null"],"format":"date-time"},"inactivationDate":{"description":"Date when the account was deactivated.","type":["string","null"],"format":"date-time"},"creationDate":{"description":"Date when the account was created.","type":"string","format":"date-time"},"hosts":{"description":"Hosts of all stores.","type":"array","items":{"type":"string","description":"Host address."}},"sites":{"description":"Array of objects representing each store.","type":"array","items":{"description":"Object containing complete information from a store.","type":"object","properties":{"id":{"description":"ID of the store.","type":"number"},"name":{"description":"Store name.","type":"string"},"tradingName":{"description":"Trading name of the store.","type":"string"},"LV":{"type":["string","null"],"description":"Level."},"logo":{"type":["string","null"],"description":"Logo."},"monetaryUnitId":{"type":"number","description":"Monetary unit ID."},"domains":{"type":["array","null"],"description":"List of domains.","items":{"type":"string","description":"Domain."}},"hosts":{"description":"Hosts associated to the store.","type":"array","items":{"type":"string","description":"Host address."}},"aliases":{"type":"array","description":"Aliases.","items":{"type":"string","description":"Alias."}}}}},"appKey":{"description":"Deprecated. Check the `appKeys` object for all API keys.","type":"object","properties":{"token":{"type":["string","null"],"description":"Token."},"name":{"type":["string","null"],"description":"Token name."}}},"appKeys":{"description":"Array of application keys.","type":"array","items":{"description":"Object representing application keys.","type":"object","properties":{"id":{"description":"ID of the API key.","type":"string"},"appKey":{"description":"API key.","type":"string"},"appToken":{"description":"API token. For security reasons, it should always be null.","type":["string","null"]},"label":{"description":"Label of the API key.","type":"string"},"createdIn":{"description":"Creation date of the API key.","type":"string","format":"date-time"},"isActive":{"description":"Defines if the API key is active (`true`) or not (`false`).","type":"boolean"},"isBlocked":{"description":"Defines if the API key is blocked (`true`) or not (`false`).","type":"boolean"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information from an account, such as company and sponsor user details, stores, and appTokens. + + + This endpoint only accepts requests from the host list designated for that store. If you want to try this request from this portal, be sure to add it to the list. Learn how to add hosts to the list in [How to manage accounts](https://help.vtex.com/en/tutorial/how-to-manage-accounts--tutorials_6285#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save account** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Finance - Full access | Save account | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Example response (`200`) + + _Omitted here: 77 KB. See `Success` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - License Manager API/Account/folder.yml b/BrunoCollections/VTEX - License Manager API/Account/folder.yml new file mode 100644 index 0000000000..14c251169b --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Account/folder.yml @@ -0,0 +1,4 @@ +info: + name: Account + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - License Manager API/Roles/Add roles to user or API Key.yml b/BrunoCollections/VTEX - License Manager API/Roles/Add roles to user or API Key.yml new file mode 100644 index 0000000000..8e68e47d8b --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Roles/Add roles to user or API Key.yml @@ -0,0 +1,74 @@ +info: + name: Add roles to user or API Key + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/license-manager/users/:userId/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: a404870467d24533a085a6b3c6a5a320 + type: path + body: + type: json + data: |- + [ + 9000, + 9111, + 9333, + 9444 + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/license-manager/users/:userId/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/license-manager/users/:userId/roles - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows you to add License Manager [roles](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) to a particular admin user or API key by specifying the list of role IDs on the request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) ID of the user. | diff --git a/BrunoCollections/VTEX - License Manager API/Roles/Get list of roles.yml b/BrunoCollections/VTEX - License Manager API/Roles/Get list of roles.yml new file mode 100644 index 0000000000..14bf1ded56 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Roles/Get list of roles.yml @@ -0,0 +1,143 @@ +info: + name: Get list of roles + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/site/pvt/roles/list/paged" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: numItems + value: "10" + type: query + disabled: true + - name: pageNumber + value: "1" + type: query + disabled: true + - name: sort + value: id + type: query + disabled: true + - name: sortType + value: ASC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/site/pvt/roles/list/paged - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/site/pvt/roles/list/paged - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/site/pvt/roles/list/paged - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/site/pvt/roles/list/paged - Schema is valid", function () { + const schema = {"description":"Response body for listing all roles.","type":"object","properties":{"items":{"description":"Array of role objects.","type":"array","items":{"description":"Object with information about a role.","type":"object","properties":{"id":{"description":"ID of the role.","type":"integer"},"isAdmin":{"description":"Defines if the role has administrative access (`true`) or not (`false`).","type":"boolean"},"roleType":{"description":"Returns `1` for custom roles, and `0` for predefined roles.","type":"integer"},"products":{"type":"array","description":"Array of License Manager product objects.","items":{"description":"Object representing License Manager products.","type":"object","properties":{"id":{"description":"License Manager product ID.","type":["string","null"]},"categoryId":{"description":"Category ID.","type":["string","null"]},"categoryName":{"type":["string","null"],"description":"Category name."},"description":{"type":["string","null"],"description":"Description."},"consoleUrlMask":{"type":["string","null"],"description":"Console URL mask."},"urlConfiguration":{"type":["string","null"],"description":"URL configuration."},"webApiUrlMask":{"type":["string","null"],"description":"Web API mask."},"url":{"type":["string","null"],"description":"URL."},"productResources":{"type":["string","null"],"description":"Product resources."},"name":{"description":"Name of the License Manager product.","type":"string"}}}},"resources":{"type":["string","null"],"description":"Resources."},"logins":{"type":["string","null"],"description":"Logins."},"name":{"description":"Name of the role.","type":"string"}}}},"paging":{"description":"Paging object.","required":["page","perPage","total","pages"],"type":"object","properties":{"page":{"description":"Current page number.","type":"integer"},"perPage":{"description":"Items per page.","type":"integer"},"total":{"description":"Total of items.","type":"integer"},"pages":{"description":"Total of pages.","type":"integer"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of License Manager [roles](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc). The response is divided in pages. The query parameter `numItems` defines the number of items in each page, and consequently the amount of pages for the whole list. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Get paged roles** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `numItems` | query | Number of items in the returned page. | + | `pageNumber` | query | Which page from the whole list will be returned. | + | `sort` | query | Chooses the field that the list will be sorted by. | + | `sortType` | query | Defines the sorting order. `ASC` is used for ascendant order. `DSC` is used for descendant order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "id": 957, + "isAdmin": false, + "roleType": 0, + "products": [ + { + "id": null, + "categoryId": null, + "categoryName": null, + "description": null, + "consoleUrlMask": null, + "urlConfiguration": null, + "webApiUrlMask": null, + "url": null, + "productResources": null, + "name": "Catalog" + }, + { + "id": null, + "categoryId": null, + "categoryName": null, + "description": null, + "consoleUrlMask": null, + "urlConfiguration": null, + "webApiUrlMask": null, + "url": null, + "productResources": null, + "name": "OMS" + } + ], + "resources": null, + "logins": null, + "name": "Call center operator" + } + ], + "paging": { + "page": 1, + "perPage": 1, + "total": 1, + "pages": 1 + } + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Roles/Get roles by user ID or API Key.yml b/BrunoCollections/VTEX - License Manager API/Roles/Get roles by user ID or API Key.yml new file mode 100644 index 0000000000..a05aa1088a --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Roles/Get roles by user ID or API Key.yml @@ -0,0 +1,93 @@ +info: + name: Get roles by user ID or API Key + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/users/:userId/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: e845b52a40e24654a2c70766adb5762b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/users/:userId/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/users/:userId/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/users/:userId/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/users/:userId/roles - Schema is valid", function () { + const schema = {"type":"array","description":"Array of role objects.","items":{"type":"object","description":"Object with information about each role.","properties":{"id":{"description":"ID of role.","type":"integer","format":"int32"},"name":{"description":"Name of the role.","type":"string"}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves License Manager [roles](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) of a particular user or API key. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Find user by email** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) ID of the user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": 957, + "name": "Call center operator" + }, + { + "id": 1, + "name": "Owner (Admin Super)" + } + ] + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Roles/Remove role from user or API Key.yml b/BrunoCollections/VTEX - License Manager API/Roles/Remove role from user or API Key.yml new file mode 100644 index 0000000000..1728469961 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Roles/Remove role from user or API Key.yml @@ -0,0 +1,74 @@ +info: + name: Remove role from user or API Key + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/users/:userId/roles/:roleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: e845b52a40e24654a2c70766adb5762b + type: path + - name: roleId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/license-manager/users/:userId/roles/:roleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/users/:userId/roles/:roleId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows you to remove a License Manager [role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) from a specific admin user or API key. This method only allows the removal of one role per request. The role's ID must be specified on the request path, not on the request body. + + + > Note that a successful response returns a `204` response with an empty body. A deletion on a role or user that does not exist will also return a `204`. Thus, this method should not be used to verify the existence of a specific user or role. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) ID of the user. | + | `roleId` | path | (Required) ID of the role which will be removed from the user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - License Manager API/Roles/folder.yml b/BrunoCollections/VTEX - License Manager API/Roles/folder.yml new file mode 100644 index 0000000000..b99ecca12b --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Roles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Roles + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - License Manager API/Stores/Get stores.yml b/BrunoCollections/VTEX - License Manager API/Stores/Get stores.yml new file mode 100644 index 0000000000..2f6817c1fa --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Stores/Get stores.yml @@ -0,0 +1,93 @@ +info: + name: Get stores + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/vlm/account/stores" + headers: + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vlm/account/stores - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vlm/account/stores - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vlm/account/stores - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vlm/account/stores - Schema is valid", function () { + const schema = {"type":"array","description":"Array of store objects.","items":{"description":"Object containing summarized information from a store.","type":"object","properties":{"id":{"description":"ID of the store.","type":"number"},"name":{"description":"Name of the store.","type":"string"},"hosts":{"description":"Array of hosts corresponding to the store.","type":"array","items":{"type":"string","description":"Host address."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the stores of the account and their respective hosts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Get account by identifier** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Finance - Full access | Get account by identifier | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Example response (`200`) + + ```json + [ + { + "id": 1213, + "name": "ambientecrm", + "hosts": [ + "loja.ambientecrm.com.br", + "www.ambientecrm.com.br" + ] + }, + { + "id": 213, + "name": "ambienteqa", + "hosts": [ + "loja.blackbox.com.br", + "www.blackbox.com.br" + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Stores/folder.yml b/BrunoCollections/VTEX - License Manager API/Stores/folder.yml new file mode 100644 index 0000000000..23aa42e502 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Stores/folder.yml @@ -0,0 +1,4 @@ +info: + name: Stores + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - License Manager API/Users/Create user.yml b/BrunoCollections/VTEX - License Manager API/Users/Create user.yml new file mode 100644 index 0000000000..581e4a3735 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/Create user.yml @@ -0,0 +1,89 @@ +info: + name: Create user + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/users" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "Jane", + "email": "jane@mail.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/users - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/users - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/users - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/users - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"description":"ID of the user.","type":"string"},"email":{"description":"Email of the user.","type":"string"},"name":{"description":"Name of the user.","type":"string"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows you to create an admin user by providing an email (mandatory) and name (optional). The email must be in a valid format. The success response will contain the generated `userId` for that user. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Example response (`200`) + + ```json + { + "id": "a404870467d24533a085a6b3c6a5a320", + "email": "jane@mail.com", + "name": "Jane" + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Users/Delete user.yml b/BrunoCollections/VTEX - License Manager API/Users/Delete user.yml new file mode 100644 index 0000000000..bf2ab73cb8 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/Delete user.yml @@ -0,0 +1,63 @@ +info: + name: Delete user + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: e845b52a40e24654a2c70766adb5762b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/license-manager/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows you to delete an admin user from the database, using the `userId` as the identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Save user** | + | License Manager | Services access control | **Remove user** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) ID from queried user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - License Manager API/Users/Get list of users.yml b/BrunoCollections/VTEX - License Manager API/Users/Get list of users.yml new file mode 100644 index 0000000000..755c4f785f --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/Get list of users.yml @@ -0,0 +1,119 @@ +info: + name: Get list of users + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/site/pvt/logins/list/paged" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: numItems + value: "10" + type: query + disabled: true + - name: pageNumber + value: "1" + type: query + disabled: true + - name: sort + value: name + type: query + disabled: true + - name: sortType + value: ASC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/site/pvt/logins/list/paged - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/site/pvt/logins/list/paged - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/site/pvt/logins/list/paged - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/site/pvt/logins/list/paged - Schema is valid", function () { + const schema = {"description":"Response body for listing all users.","type":"object","properties":{"items":{"description":"Array of user objects.","type":"array","items":{"description":"Object with information about an user.","type":"object","properties":{"id":{"description":"ID of the user.","type":"string"},"email":{"description":"Email of the user.","type":"string"},"isAdmin":{"description":"Defines if the user has administrative access (`true`) or not (`false`).","type":"boolean"},"isReliable":{"description":"For internal use only.","type":"boolean"},"isBlocked":{"description":"Defines if the user is blocked (`true`) or not (`false`).","type":"boolean"},"roles":{"type":"array","description":"Array of user roles. This field is deprecated and should always be empty.","items":{"type":"string","description":"Role ID."}},"accountNames":{"type":"array","description":"Array of account names.","items":{"type":"string","description":"Account names."}},"name":{"description":"Name of the user.","type":"string"}}}},"paging":{"description":"Paging object.","required":["page","perPage","total","pages"],"type":"object","properties":{"page":{"description":"Current page number.","type":"integer"},"perPage":{"description":"Items per page.","type":"integer"},"total":{"description":"Total of items.","type":"integer"},"pages":{"description":"Total of pages.","type":"integer"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of registered admin users. The response is divided in pages. The query parameter `numItems` defines the number of items in each page, and consequently the amount of pages for the whole list. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Get paged users** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `numItems` | query | Number of items in the returned page. | + | `pageNumber` | query | Which page from the whole list will be returned. | + | `sort` | query | Chooses the field that the list will be sorted by. | + | `sortType` | query | Defines the sorting order. `ASC` is used for ascendant order. `DSC` is used for descendant order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "id": "a404870467d24533a085a6b3c6a5a320", + "email": "mynewuser@mydomain.com", + "isAdmin": false, + "isReliable": false, + "isBlocked": false, + "roles": [], + "accountNames": [], + "name": "testuser" + } + ], + "paging": { + "page": 1, + "perPage": 1, + "total": 1, + "pages": 1 + } + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Users/Get user information by user ID.yml b/BrunoCollections/VTEX - License Manager API/Users/Get user information by user ID.yml new file mode 100644 index 0000000000..6b24df17e2 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/Get user information by user ID.yml @@ -0,0 +1,96 @@ +info: + name: Get user information by user ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: e845b52a40e24654a2c70766adb5762b + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/users/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/users/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/users/:userId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"description":"ID of the user.","type":"string"},"name":{"description":"Name of the user.","type":"string"},"email":{"description":"Email of the user.","type":"string"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows you to obtain information about an admin user, using the `userId` as the identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Remove user** | + | License Manager | Services access control | **Save user** | + | License Manager | Services access control | **Find user by email** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | Save user | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) ID from queried user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "e845b52a40e24654a2c70766adb5762b", + "name": "Jane", + "email": "jane@mail.com" + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Users/Get user information by user email.yml b/BrunoCollections/VTEX - License Manager API/Users/Get user information by user email.yml new file mode 100644 index 0000000000..487e6b6572 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/Get user information by user email.yml @@ -0,0 +1,90 @@ +info: + name: Get user information by user email + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/users/:userEmail/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userEmail + value: john@mail.com + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/users/:userEmail/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/users/:userEmail/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/users/:userEmail/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/users/:userEmail/roles - Schema is valid", function () { + const schema = {"type":"object","description":"","properties":{"UserId":{"type":"string","description":"ID of the user."},"Email":{"type":"string","description":"Email of the user."},"Roles":{"type":"array","description":"Array of role objects.","items":{"type":"object","description":"Object with information about each role.","properties":{"name":{"description":"Name of the role.","type":"string"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves user ID and License Manager [roles](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) of a particular user. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View_Storefront_User_Permissions** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userEmail` | path | (Required) Email of the user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "UserId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "Email": "john@mail.com", + "Roles": [ + "Organizational Unit Admin" + ] + } + ``` diff --git a/BrunoCollections/VTEX - License Manager API/Users/folder.yml b/BrunoCollections/VTEX - License Manager API/Users/folder.yml new file mode 100644 index 0000000000..99de5ce934 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/Users/folder.yml @@ -0,0 +1,4 @@ +info: + name: Users + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - License Manager API/environments/VTEX.yml b/BrunoCollections/VTEX - License Manager API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - License Manager API/opencollection.yml b/BrunoCollections/VTEX - License Manager API/opencollection.yml new file mode 100644 index 0000000000..10a0624c0d --- /dev/null +++ b/BrunoCollections/VTEX - License Manager API/opencollection.yml @@ -0,0 +1,31 @@ +opencollection: 1.0.0 + +info: + name: VTEX - License Manager API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The License Manager API allows you to create users, modify their names and emails, add and remove [roles](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) from users, and create and manage [API keys](https://help.vtex.com/en/tutorial/api-keys--2iffYzlvvz4BDMr6WGUtet). + + ## Common parameters + + |Attribute name | Description | + |:------------|--------------| + |`accountName` | Account name in VTEX License Manager. | + |`environment` | Environment on which you want to run the query, e.g. `vtexcommercestable`. | + |`userId` | Unique user identification string. | + |`roleId` | Integer that represents a role, can be obtained from the [Get List of Roles](https://developers.vtex.com/docs/api-reference/license-manager-api#get-/api/license-manager/site/pvt/roles/list/paged) endpoint. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Logistics API/Batch operations/Confirm batch inventory.yml b/BrunoCollections/VTEX - Logistics API/Batch operations/Confirm batch inventory.yml new file mode 100644 index 0000000000..8c9c9a6622 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Batch operations/Confirm batch inventory.yml @@ -0,0 +1,58 @@ +info: + name: Confirm batch inventory + type: http + seq: 2 + +http: + method: POST + url: https://logistics.{{environment}}.com.br/:accountName/availability/v1/inventory/batch/:batchId/confirm + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: batchId + value: 550e8400-e29b-41d4-a716-446655440000 + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Confirms that the CSV upload is complete and triggers asynchronous processing of the batch inventory. The batch status will transition to `QUEUED`. + + >ℹ️ This feature is in early access, which means that we are working to improve it. If you want to use this feature, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + This endpoint is part of the Batch operations section for high-throughput [inventory updates](https://help.vtex.com/en/docs/tutorials/updating-the-quantity-of-items-in-inventory). Learn more about [inventory management at VTEX](https://help.vtex.com/en/docs/tutorials/managing-stock-items). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics - Full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics - Full access | + | OMS - Full access | Logistics - Full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `batchId` | path | (Required) Unique identifier for the batch job, returned by the [Create batch inventory job](https://developers.vtex.com/docs/api-reference/logistics-api#post-/availability/v1/inventory/batch) endpoint. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Batch operations/Create batch inventory job.yml b/BrunoCollections/VTEX - Logistics API/Batch operations/Create batch inventory job.yml new file mode 100644 index 0000000000..f6eb707d57 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Batch operations/Create batch inventory job.yml @@ -0,0 +1,71 @@ +info: + name: Create batch inventory job + type: http + seq: 1 + +http: + method: POST + url: https://logistics.{{environment}}.com.br/:accountName/availability/v1/inventory/batch + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new batch inventory job and returns a pre-signed URL for uploading the CSV file. The batch will be in `AWAITING_UPLOAD` status until the CSV is uploaded and committed. + + >ℹ️ This feature is in early access, which means that we are working to improve it. If you want to use this feature, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + This endpoint is part of the Batch operations section for high-throughput [inventory updates](https://help.vtex.com/en/docs/tutorials/updating-the-quantity-of-items-in-inventory). Learn more about [inventory management at VTEX](https://help.vtex.com/en/docs/tutorials/managing-stock-items). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics - Full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics - Full access | + | OMS - Full access | Logistics - Full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "batchId": "550e8400-e29b-41d4-a716-446655440000", + "status": "AWAITING_UPLOAD", + "upload": { + "method": "PUT", + "url": "https://availability-bulk-upload.s3.amazonaws.com/550e8400-e29b-41d4-a716-446655440000.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&...", + "headers": { + "Content-Type": "text/csv" + }, + "expiresAt": "2026-01-12T20:10:00Z" + } + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory errors.yml b/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory errors.yml new file mode 100644 index 0000000000..cc6e95d3c7 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory errors.yml @@ -0,0 +1,114 @@ +info: + name: Get batch inventory errors + type: http + seq: 4 + +http: + method: GET + url: https://logistics.{{environment}}.com.br/:accountName/availability/v1/inventory/batch/:batchId/errors + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: batchId + value: 550e8400-e29b-41d4-a716-446655440000 + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a pre-signed URL to download a CSV file containing all rows that failed processing, along with error codes and messages. The error reports are available until the batch metadata expires (7 days after batch completion). + + >ℹ️ This feature is in early access, which means that we are working to improve it. If you want to use this feature, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + This endpoint is part of the Batch operations section for high-throughput [inventory updates](https://help.vtex.com/en/docs/tutorials/updating-the-quantity-of-items-in-inventory). Learn more about [inventory management at VTEX](https://help.vtex.com/en/docs/tutorials/managing-stock-items). + + ## Endpoint Availability + + The Get batch inventory errors endpoint is available when: + - `errorCount > 0` in the status response + - [Status](https://developers.vtex.com/docs/api-reference/logistics-api#get-/availability/v1/inventory/batch/-batchId-/status) is one of: `PROCESSING`, `COMPLETED`, `COMPLETED_WITH_ERRORS`, or `FAILED` + + If these conditions are not met, the endpoint response will be `204 No Content`. + + ## Error Types + + **Deterministic Errors**: Errors caused by invalid or incomplete data in the submitted file, for example a missing required fields or invalid values. These errors are detected during the file ingestion from S3 and will cause the affected records to fail. The system doesn't retry these operations automatically. The user must fix the data in the CSV file and resubmit a new batch. + + **Non-Deterministic Errors**: Errors caused by infrastructure or system issues. The system will automatically retry the operation up to 3 times. If the operation still fails after these attempts, the message will be sent to a Dead Letter Queue (DLQ) for further investigation. These errors will show `UPDATE_FAILED` in the error CSV. + + ## Error CSV Schema + + The downloaded CSV file contains the following fields: + + | **Field** | **Type** | **Description** | + | --------------- | ----------------- | ----------------- | + | `line_number` | integer | Original line number in the uploaded CSV. | + | `item_id` | string | SKU identifier from the failed row. | + | `container_id` | string | Warehouse ID from the failed row. | + | `error_code` | string | Machine-readable error code. | + | `error_message` | string | Human-readable error description. | + + ## Error Codes + + - `INVALID_QUANTITY`: Quantity value is invalid (negative, non-numeric) + - `MISSING_REQUIRED_FIELD`: Required field is empty or missing + - `INVALID_DATE_FORMAT`: Date/time field has invalid format + - `UPDATE_FAILED`: Database update failed after retries (non-deterministic error) + - `INSERT_CONFLICT`: Insert conflicted with a concurrent operation + - `INVALID_FORMAT`: Row format is invalid (e.g., wrong number of columns) + - `CONFLICT`: Compare-And-Set conflict or per-item routing conflict + - `UNKNOWN`: Unclassified error + + ## Error CSV Example + + ```csv + line_number,item_id,container_id,error_code,error_message + 1523,SKU-12345,WH-01,INVALID_QUANTITY,"quantity cannot be negative: -50" + 4892,SKU-67890,WH-01,MISSING_REQUIRED_FIELD,"container_id is required" + 10234,SKU-11111,WH-01,INVALID_DATE_FORMAT,"supply_date is not valid" + ``` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics - Full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics - Full access | + | OMS - Full access | Logistics - Full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `batchId` | path | (Required) Unique identifier for the batch job, returned by the [Create batch inventory job](https://developers.vtex.com/docs/api-reference/logistics-api#post-/availability/v1/inventory/batch) endpoint. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "batchId": "550e8400-e29b-41d4-a716-446655440000", + "downloadUrl": "https://availability-bulk-upload-errors.s3.amazonaws.com/550e8400-e29b-41d4-a716-446655440000-errors.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&...", + "errorCount": 3 + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory status.yml b/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory status.yml new file mode 100644 index 0000000000..69e1f3c09f --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Batch operations/Get batch inventory status.yml @@ -0,0 +1,89 @@ +info: + name: Get batch inventory status + type: http + seq: 3 + +http: + method: GET + url: https://logistics.{{environment}}.com.br/:accountName/availability/v1/inventory/batch/:batchId/status + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: batchId + value: 550e8400-e29b-41d4-a716-446655440000 + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the current processing status and progress information for a batch inventory job. Use this endpoint to poll the batch status and track processing progress. + + >ℹ️ This feature is in early access, which means that we are working to improve it. If you want to use this feature, please contact our [Support Center](https://support.vtex.com/hc/en-us/requests). + + This endpoint is part of the Batch operations section for high-throughput [inventory updates](https://help.vtex.com/en/docs/tutorials/updating-the-quantity-of-items-in-inventory). Learn more about [inventory management at VTEX](https://help.vtex.com/en/docs/tutorials/managing-stock-items). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics - Full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics - Full access | + | OMS - Full access | Logistics - Full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `batchId` | path | (Required) Unique identifier for the batch job, returned by the [Create batch inventory job](https://developers.vtex.com/docs/api-reference/logistics-api#post-/availability/v1/inventory/batch) endpoint. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "batchId": "550e8400-e29b-41d4-a716-446655440000", + "status": "PROCESSING", + "rowCount": 13800000, + "processedCount": 8500000, + "errorCount": 0, + "amountCompleted": 61, + "createdAt": "2026-01-12T20:00:00Z", + "startedAt": "2026-01-12T20:01:00Z", + "stages": { + "ingestedChunks": 276, + "classifiedChunks": 250, + "processedChunks": 170, + "notifiedChunks": 165, + "totalChunks": 276 + }, + "summary": { + "insertCount": 5200000, + "updateCount": 3100000, + "noopCount": 200000, + "conflictCount": 0, + "skippedDueApiUpdateCount": 0, + "perItemRoutedCount": 0, + "dlqEventsCount": 0 + } + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Batch operations/folder.yml b/BrunoCollections/VTEX - Logistics API/Batch operations/folder.yml new file mode 100644 index 0000000000..9488252a07 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Batch operations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Batch operations + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Logistics API/Docks/Activate dock.yml b/BrunoCollections/VTEX - Logistics API/Docks/Activate dock.yml new file mode 100644 index 0000000000..08f17fb416 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/Activate dock.yml @@ -0,0 +1,66 @@ +info: + name: Activate dock + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks/:dockId/activation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dockId + value: dock_1f95 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/docks/:dockId/activation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/configuration/docks/:dockId/activation - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Activates a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) of your store's [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3), searching by dock ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Docks/Create or update dock.yml b/BrunoCollections/VTEX - Logistics API/Docks/Create or update dock.yml new file mode 100644 index 0000000000..77ddd86e2c --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/Create or update dock.yml @@ -0,0 +1,120 @@ +info: + name: Create or update dock + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "1a8bce3", + "name": "Catete dock_3", + "priority": 0, + "dockTimeFake": "00:00:00", + "timeFakeOverhead": "00:00:00", + "salesChannels": [ + "3" + ], + "salesChannel": "1", + "freightTableIds": [ + "11cc4b6" + ], + "wmsEndPoint": null, + "address": { + "postalCode": "02220070", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Catete", + "street": "Artur Bernardes Street", + "number": "100", + "complement": "apartment", + "coordinates": [ + [ + -34.82939147949219 + ] + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics/pvt/configuration/docks - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/configuration/docks - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics/pvt/configuration/docks - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics/pvt/configuration/docks - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) or updates an existing one for your store's [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Docks/Deactivate dock.yml b/BrunoCollections/VTEX - Logistics API/Docks/Deactivate dock.yml new file mode 100644 index 0000000000..8ff695f73a --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/Deactivate dock.yml @@ -0,0 +1,66 @@ +info: + name: Deactivate dock + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks/:dockId/deactivation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dockId + value: dock_1f95 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/docks/:dockId/deactivation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/configuration/docks/:dockId/deactivation - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deactivates a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) of your store's [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3), searching by dock ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Docks/Delete dock.yml b/BrunoCollections/VTEX - Logistics API/Docks/Delete dock.yml new file mode 100644 index 0000000000..9b4892a732 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/Delete dock.yml @@ -0,0 +1,91 @@ +info: + name: Delete dock + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks/:dockId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dockId + value: dock_1f95 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/logistics/pvt/configuration/docks/:dockId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/logistics/pvt/configuration/docks/:dockId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/logistics/pvt/configuration/docks/:dockId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/logistics/pvt/configuration/docks/:dockId - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj), searching by dock ID. + + Successful requests receive a `200 OK` status code with `true` in the response body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Docks/List all docks.yml b/BrunoCollections/VTEX - Logistics API/Docks/List all docks.yml new file mode 100644 index 0000000000..6296dbe161 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/List all docks.yml @@ -0,0 +1,236 @@ +info: + name: List all docks + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/docks - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/docks - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/docks - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/docks - Schema is valid", function () { + const schema = {"type":"array","description":"List with docks information.","items":{"type":"object","description":"Loading dock information.","properties":{"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","properties":{"isPickupStore":{"type":["boolean","null"],"description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"storeId":{"type":["string","null"],"description":"Store ID for stores that acted as pickup points."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":["string","null"],"description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information about the delivery or the pickup point."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj related to the delivery or the pickup point ID."},"distance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address, measured as a straight line."},"businessHours":{"type":["string","null"],"description":"Pickup point business hours configurations."},"pickupHolidays":{"type":["string","null"],"description":"Holiday's configurations applicable to the pickup point."},"sellerId":{"type":["string","null"],"description":"Seller ID."},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup was third party (`true`) or not (`false`)."}}},"storeId":{"type":["string","null"],"description":"Store ID."},"pickupInStoreInfo":{"type":"object","description":"Information about the physical store as a pickup point.","properties":{"isActice":{"type":"boolean","description":"Defines if the physical store is a pickup point (`true`) or not (`false`)."},"additionalInfo":{"type":["string","null"],"description":"Additional information of the store as a pickup point."}}},"deliveryFromStoreInfo":{"type":"object","description":"Settings for delivery from a physical store.","properties":{"isActice":{"type":"boolean","description":"Defines if the settings for delivery from physical stores are active (`true`) or inactive (`false`)."},"deliveryRadius":{"type":"number","description":"Delivery radius."},"deliveryFee":{"type":"number","description":"Delivery fee."},"deliveryTime":{"type":"string","description":"Delivery time in the format `DD.HH:MM:SS`."},"maximumWeight":{"type":"number","description":"Delivery maximum weight."}}},"address":{"type":"object","description":"Loading dock address.","properties":{"postalCode":{"type":"string","description":"Loading dock address postal code."},"country":{"type":"object","description":"Information about the loading dock address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the loading dock address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the loading dock address."}}},"city":{"type":"string","description":"Loading dock address city."},"state":{"type":"string","description":"Loading dock address state."},"neighborhood":{"type":"string","description":"Loading dock address neighborhood."},"street":{"type":"string","description":"Loading dock address street."},"number":{"type":"string","description":"Loading dock address number."},"complement":{"type":["string","null"],"description":"Loading dock address complement."},"reference":{"type":["string","null"],"description":"Loading dock address reference point."},"location":{"type":"object","description":"Loading dock address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"location":{"type":["object","null"],"description":"Loading dock location details.","properties":{"zipCode":{"type":"string","description":"Loading dock address postal code."},"country":{"type":"string","description":"Three-digit country code of the loading dock address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"inStore":{"type":"object","description":"Information related to orders made via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).","properties":{"IsCheckedIn":{"type":"boolean","description":"Defines if orders can be placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"StoreId":{"type":["string","null"],"description":"ID of purchases made in the GoCommerce context."}}}}},"shippingRatesProviders":{"type":["array","null"],"description":"Shipping rates providers information.","items":{"type":"string","description":"Shipping rates."}},"deliveryAgreementsIds":{"type":["array","null"],"description":"Delivery agreements IDs information.","items":{"type":"string","description":"Delivery agreements IDs."}},"id":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"name":{"type":"string","description":"Loading dock name."},"priority":{"type":"integer","description":"Value from `0` to `10` used as a tie-breaking rule for loading dock selecting. The greater the priority, the greater the possibility of the loading dock being chosen in [shipping calculation](https://help.vtex.com/en/tutorial/how-shipping-calculation-works--tutorials_116). When no priority was set, it corresponds to `0`."},"dockTimeFake":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When not configured, it returns `00:00:00`."},"timeFakeOverhead":{"type":"string","description":"Time frame used to choose a loading dock when there is more than one loading dock with the same processing time. The lower the value entered in this field, the greater the possibility of the loading dock being chosen. \r\n>ℹ️ This field is not considered when calculating the delivery time."},"salesChannels":{"type":"array","description":"Sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the loading dock.","items":{"type":"string","description":"Sales channel ID."}},"salesChannel":{"type":"string","description":"Main sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the loading dock."},"freightTableIds":{"type":"array","description":"List with freight table IDs associated with the loading dock.","items":{"type":"string","description":"Freight table ID."}},"wmsEndPoint":{"type":["string","null"],"description":"Endpoint for integrating an external Warehouse Management System (WMS)."},"isActive":{"type":"boolean","description":"Defines if the loading dock is active (`true`) or inactive (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about all [loading docks](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) of your store's [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "pickupStoreInfo": { + "isPickupStore": false, + "storeId": null, + "friendlyName": null, + "address": { + "postalCode": "01001-000", + "country": { + "acronym": "BRA", + "name": "Brasil" + }, + "city": "São Paulo", + "state": "SP", + "neighborhood": "Sé", + "street": "Praça da Sé", + "number": "100", + "complement": null, + "reference": "Next to the pink building", + "location": { + "latitude": -46.6342009, + "longitude": -23.5503099 + } + }, + "additionalInfo": null, + "dockId": null, + "distance": null, + "businessHours": null, + "pickupHolidays": null, + "sellerId": null, + "isThirdPartyPickup": false + }, + "storeId": null, + "pickupInStoreInfo": { + "isActice": false, + "additionalInfo": null + }, + "deliveryFromStoreInfo": { + "isActice": false, + "deliveryRadius": 0, + "deliveryFee": 0, + "deliveryTime": "00:00:00", + "maximumWeight": 0 + }, + "address": { + "postalCode": "01001-000", + "country": { + "acronym": "BRA", + "name": "Brasil" + }, + "city": "São Paulo", + "state": "SP", + "neighborhood": "Sé", + "street": "Praça da Sé", + "number": "", + "complement": null, + "reference": null, + "location": { + "latitude": -46.6342009, + "longitude": -23.5503099 + } + }, + "location": null, + "shippingRatesProviders": [], + "deliveryAgreementsIds": [], + "id": "1aa131g", + "name": "Dock Pac", + "priority": 0, + "dockTimeFake": "00:00:00", + "timeFakeOverhead": "00:00:00", + "salesChannels": [ + "1", + "2", + "3" + ], + "freightTableIds": [ + "1602051" + ], + "wmsEndPoint": null, + "isActive": true + }, + { + "pickupStoreInfo": { + "isPickupStore": false, + "storeId": null, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null, + "distance": null, + "businessHours": null, + "pickupHolidays": null, + "sellerId": null, + "isThirdPartyPickup": false + }, + "storeId": null, + "pickupInStoreInfo": { + "isActice": false, + "additionalInfo": null + }, + "deliveryFromStoreInfo": { + "isActice": false, + "deliveryRadius": 0, + "deliveryFee": 0, + "deliveryTime": "00:00:00", + "maximumWeight": 0 + }, + "address": { + "postalCode": "22220070", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Catete", + "street": "Artur Bernardes Street", + "number": "100", + "complement": "apartment", + "coordinates": [ + -34.82939147949219, + -7.115228652954102 + ] + }, + "location": { + "zipCode": "22220070", + "country": "BRA", + "inStore": { + "IsCheckedIn": false, + "StoreId": null + } + }, + "shippingRatesProviders": [], + "deliveryAgreementsIds": [], + "id": "doc_dockTest", + "name": "Central dock", + "priority": 0, + "dockTimeFake": "00:00:00", + "timeFakeOverhead": "00:00:00", + "salesChannels": [ + "1" + ], + "salesChannel": "1", + "freightTableIds": [ + "andreia-sp-01" + ], + "wmsEndPoint": null, + "isActive": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Docks/List dock by ID.yml b/BrunoCollections/VTEX - Logistics API/Docks/List dock by ID.yml new file mode 100644 index 0000000000..35f0432645 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/List dock by ID.yml @@ -0,0 +1,160 @@ +info: + name: List dock by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/docks/:dockId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dockId + value: dock_1f95 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/docks/:dockId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/docks/:dockId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/docks/:dockId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/docks/:dockId - Schema is valid", function () { + const schema = {"type":"object","description":"Loading dock information.","properties":{"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","properties":{"isPickupStore":{"type":["boolean","null"],"description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"storeId":{"type":["string","null"],"description":"Store ID for stores that acted as pickup points."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":["string","null"],"description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information about the delivery or the pickup point."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj related to the delivery or the pickup point ID."},"distance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address, measured as a straight line."},"businessHours":{"type":["string","null"],"description":"Pickup point business hours configurations."},"pickupHolidays":{"type":["string","null"],"description":"Holiday's configurations applicable to the pickup point."},"sellerId":{"type":["string","null"],"description":"Seller ID."},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup was third party (`true`) or not (`false`)."}}},"storeId":{"type":["string","null"],"description":"Store ID."},"pickupInStoreInfo":{"type":"object","description":"Information about the physical store as a pickup point.","properties":{"isActice":{"type":"boolean","description":"Defines if the physical store is a pickup point (`true`) or not (`false`)."},"additionalInfo":{"type":["string","null"],"description":"Additional information of the store as a pickup point."}}},"deliveryFromStoreInfo":{"type":"object","description":"Settings for delivery from a physical store.","properties":{"isActice":{"type":"boolean","description":"Defines if the settings for delivery from physical stores are active (`true`) or inactive (`false`)."},"deliveryRadius":{"type":"number","description":"Delivery radius."},"deliveryFee":{"type":"number","description":"Delivery fee."},"deliveryTime":{"type":"string","description":"Delivery time in the format `DD.HH:MM:SS`."},"maximumWeight":{"type":"number","description":"Delivery maximum weight."}}},"address":{"type":"object","description":"Loading dock address.","properties":{"postalCode":{"type":"string","description":"Loading dock address postal code."},"country":{"type":"object","description":"Information about the loading dock address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the loading dock address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the loading dock address."}}},"city":{"type":"string","description":"Loading dock address city."},"state":{"type":"string","description":"Loading dock address state."},"neighborhood":{"type":"string","description":"Loading dock address neighborhood."},"street":{"type":"string","description":"Loading dock address street."},"number":{"type":"string","description":"Loading dock address number."},"complement":{"type":["string","null"],"description":"Loading dock address complement."},"reference":{"type":["string","null"],"description":"Loading dock address reference point."},"location":{"type":"object","description":"Loading dock address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"location":{"type":["object","null"],"description":"Loading dock location details.","properties":{"zipCode":{"type":"string","description":"Loading dock address postal code."},"country":{"type":"string","description":"Three-digit country code of the loading dock address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"inStore":{"type":"object","description":"Information related to orders made via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).","properties":{"IsCheckedIn":{"type":"boolean","description":"Defines if orders can be placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"StoreId":{"type":["string","null"],"description":"ID of purchases made in the GoCommerce context."}}}}},"shippingRatesProviders":{"type":["array","null"],"description":"Shipping rates providers information.","items":{"type":"string","description":"Shipping rates."}},"deliveryAgreementsIds":{"type":["array","null"],"description":"Delivery agreements IDs information.","items":{"type":"string","description":"Delivery agreements IDs."}},"id":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"name":{"type":"string","description":"Loading dock name."},"priority":{"type":"integer","description":"Value from `0` to `10` used as a tie-breaking rule for loading dock selecting. The greater the priority, the greater the possibility of the loading dock being chosen in [shipping calculation](https://help.vtex.com/en/tutorial/how-shipping-calculation-works--tutorials_116). When no priority was set, it corresponds to `0`."},"dockTimeFake":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When not configured, it returns `00:00:00`."},"timeFakeOverhead":{"type":"string","description":"Time frame used to choose a loading dock when there is more than one loading dock with the same processing time. The lower the value entered in this field, the greater the possibility of the loading dock being chosen. \r\n>ℹ️ This field is not considered when calculating the delivery time."},"salesChannels":{"type":"array","description":"Sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the loading dock.","items":{"type":"string","description":"Sales channel ID."}},"salesChannel":{"type":"string","description":"Main sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the loading dock."},"freightTableIds":{"type":"array","description":"List with freight table IDs associated with the loading dock.","items":{"type":"string","description":"Freight table ID."}},"wmsEndPoint":{"type":["string","null"],"description":"Endpoint for integrating an external Warehouse Management System (WMS)."},"isActive":{"type":"boolean","description":"Defines if the loading dock is active (`true`) or inactive (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) of your store's [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3), searching by dock ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "pickupStoreInfo": { + "isPickupStore": false, + "storeId": null, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null, + "distance": null, + "businessHours": null, + "pickupHolidays": null, + "sellerId": null, + "isThirdPartyPickup": false + }, + "storeId": null, + "pickupInStoreInfo": { + "isActice": false, + "additionalInfo": null + }, + "deliveryFromStoreInfo": { + "isActice": false, + "deliveryRadius": 0, + "deliveryFee": 0, + "deliveryTime": "00:00:00", + "maximumWeight": 0 + }, + "address": { + "postalCode": "22220070", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Catete", + "street": "Artur Bernardes Street", + "number": "100", + "complement": "apartment", + "reference": "Next to the pink building", + "location": { + "latitude": -34.82939147949219, + "longitude": -7.115228652954102 + } + }, + "location": { + "zipCode": "22220070", + "country": "BRA", + "inStore": { + "IsCheckedIn": false, + "StoreId": null + } + }, + "shippingRatesProviders": [], + "deliveryAgreementsIds": [], + "id": "doc_dockTest", + "name": "Central dock", + "priority": 0, + "dockTimeFake": "00:00:00", + "timeFakeOverhead": "00:00:00", + "salesChannels": [ + "1" + ], + "salesChannel": "1", + "freightTableIds": [ + "andreia-sp-01" + ], + "wmsEndPoint": null, + "isActive": true + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Docks/folder.yml b/BrunoCollections/VTEX - Logistics API/Docks/folder.yml new file mode 100644 index 0000000000..4ddfbfad0b --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Docks/folder.yml @@ -0,0 +1,4 @@ +info: + name: Docks + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Logistics API/Freight values/Create or update freight values.yml b/BrunoCollections/VTEX - Logistics API/Freight values/Create or update freight values.yml new file mode 100644 index 0000000000..c591ae7911 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Freight values/Create or update freight values.yml @@ -0,0 +1,83 @@ +info: + name: Create or update freight values + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/freights/:carrierId/values/update" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: carrierId + value: carrier123 + type: path + body: + type: json + data: |- + [ + { + "absoluteMoneyCost": "1.00", + "country": "BRA", + "maxVolume": 1000000000, + "operationType": 1, + "pricePercent": 10, + "pricePercentByWeight": 0, + "timeCost": "2.00:00:00", + "weightEnd": 1000, + "weightStart": 1, + "zipCodeEnd": "1234500", + "zipCodeStart": "1000000", + "polygon": "polygon2" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/freights/:carrierId/values/update - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates freight values for your store's carriers. Learn more in [Shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Freight values/List freight values.yml b/BrunoCollections/VTEX - Logistics API/Freight values/List freight values.yml new file mode 100644 index 0000000000..703d7a95ab --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Freight values/List freight values.yml @@ -0,0 +1,134 @@ +info: + name: List freight values + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/freights/:carrierId/:postalcode/values" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: carrierId + value: carrier-123 + type: path + - name: postalcode + value: "12345000" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/freights/:carrierId/:postalcode/values - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/freights/:carrierId/:postalcode/values - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/freights/:carrierId/:postalcode/values - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/freights/:carrierId/:postalcode/values - Schema is valid", function () { + const schema = {"type":"array","description":"List of freight values.","items":{"required":["zipCodeStart","zipCodeEnd","weightStart","weightEnd","absoluteMoneyCost","pricePercent","pricePercentByWeight","maxVolume","timeCost","country","operationType","restrictedFreights","polygon","minimumValueInsurance"],"type":"object","description":"Freight values object.","properties":{"zipCodeStart":{"type":"string","description":"Postal code interval starting point."},"zipCodeEnd":{"type":"string","description":"Postal code interval ending point."},"weightStart":{"type":"number","description":"Minimum weight allowed."},"weightEnd":{"type":"number","description":"Maximum weight allowed."},"absoluteMoneyCost":{"type":"number","description":"Fixed shipping cost to be charged, in a decimal number."},"pricePercent":{"type":"number","description":"[Price-based additional shipping charge](https://help.vtex.com/en/tutorial/additional-shipping-costs--2vqGwMn0LabkOHY6zSHYNV), calculated based on the total price of the order, in decimal number. You must fill in this field with a percentage value. For example, for an additional charge of 10%, fill in the table with `10`."},"pricePercentByWeight":{"type":"number","description":"[Weight-based additional shipping charge](https://help.vtex.com/en/tutorial/additional-shipping-costs--2vqGwMn0LabkOHY6zSHYNV), calculated based on the total weight of the order."},"maxVolume":{"type":"number","description":"Maximum volume that can be transported by the carrier in cm³."},"timeCost":{"type":"string","description":"Delivery time frame informed by the carrier, in the format `DD.HH:MM:SS`."},"country":{"type":"string","description":"Three letter ISO code for the country for the given postal code."},"operationType":{"type":"integer","description":"Indicates the operation type, which can be `1` (Insert), `2` (Update) or `3`(Delete)."},"restrictedFreights":{"type":["array","null"],"items":{"type":"string","description":"Restricted freight postal codes."},"description":"List of postal codes where the delivery is restricted for the given carrier."},"polygon":{"type":"string","description":"Polygon ID, according to the [geolocation](https://help.vtex.com/en/tutorial/registering-geolocation/) feature."},"minimumValueInsurance":{"type":"number","description":"Insurance minimum value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists freight values appointed to your store's carriers, searching by carrier ID and postal code (`cep`). The information is retrieved from your [shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) configurations. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `postalcode` | path | (Required) Postal code of the area in which you wish to retrieve freight values for a given carrier, according to your [shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) configurations. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "zipCodeStart": "01000001", + "zipCodeEnd": "05999999", + "weightStart": 250.001, + "weightEnd": 300, + "absoluteMoneyCost": 329.9, + "pricePercent": 0, + "pricePercentByWeight": 0, + "maxVolume": 100000000, + "timeCost": "2.00:00:00", + "country": "BRA", + "operationType": 0, + "restrictedFreights": [ + "01056051" + ], + "polygon": "central_RJ", + "minimumValueInsurance": 0 + }, + { + "zipCodeStart": "01230020", + "zipCodeEnd": "06959949", + "weightStart": 1001.001, + "weightEnd": 10000, + "absoluteMoneyCost": 15, + "pricePercent": 0, + "pricePercentByWeight": 0, + "maxVolume": 900000000, + "timeCost": "1.00:00:00", + "country": "BRA", + "operationType": 0, + "restrictedFreights": [], + "polygon": "zone_RJ", + "minimumValueInsurance": 0 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Freight values/folder.yml b/BrunoCollections/VTEX - Logistics API/Freight values/folder.yml new file mode 100644 index 0000000000..c19c1ac681 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Freight values/folder.yml @@ -0,0 +1,4 @@ +info: + name: Freight values + type: folder + seq: 12 diff --git a/BrunoCollections/VTEX - Logistics API/Holidays/Create or update holiday.yml b/BrunoCollections/VTEX - Logistics API/Holidays/Create or update holiday.yml new file mode 100644 index 0000000000..cb6be4183c --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Holidays/Create or update holiday.yml @@ -0,0 +1,71 @@ +info: + name: Create or update holiday + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/configuration/holidays/:holidayId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: holidayId + value: christmas2025 + type: path + body: + type: json + data: |- + { + "name": "Christmas", + "startDate": "2024-12-25" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/logistics/pvt/configuration/holidays/:holidayId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates a [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk), searching by holiday ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `holidayId` | path | (Required) [Holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) ID. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Holidays/Delete holiday.yml b/BrunoCollections/VTEX - Logistics API/Holidays/Delete holiday.yml new file mode 100644 index 0000000000..035aeb0592 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Holidays/Delete holiday.yml @@ -0,0 +1,64 @@ +info: + name: Delete holiday + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/configuration/holidays/:holidayId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: holidayId + value: christmas2025 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/logistics/pvt/configuration/holidays/:holidayId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) set up in your store, searching by holiday ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `holidayId` | path | (Required) [Holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Holidays/List all holidays.yml b/BrunoCollections/VTEX - Logistics API/Holidays/List all holidays.yml new file mode 100644 index 0000000000..d593dfe537 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Holidays/List all holidays.yml @@ -0,0 +1,62 @@ +info: + name: List all holidays + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/holidays" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/logistics/pvt/configuration/holidays - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists information about all [holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured on your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Holidays/List holiday by ID.yml b/BrunoCollections/VTEX - Logistics API/Holidays/List holiday by ID.yml new file mode 100644 index 0000000000..a6e44a77e9 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Holidays/List holiday by ID.yml @@ -0,0 +1,67 @@ +info: + name: List holiday by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/holidays/:holidayId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: holidayId + value: christmas2025 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/logistics/pvt/configuration/holidays/:holidayId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists information about a [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk), searching by holiday ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `holidayId` | path | (Required) [Holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Holidays/folder.yml b/BrunoCollections/VTEX - Logistics API/Holidays/folder.yml new file mode 100644 index 0000000000..c5cb8bdeb0 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Holidays/folder.yml @@ -0,0 +1,4 @@ +info: + name: Holidays + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU per warehouse.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU per warehouse.yml new file mode 100644 index 0000000000..b129f53263 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU per warehouse.yml @@ -0,0 +1,123 @@ +info: + name: List inventory by SKU per warehouse + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: warehouseId + value: whs15hs6c + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Inventory information for a given warehouse.","properties":{"skuId":{"type":"string","description":"SKU ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Dock ID."},"totalQuantity":{"type":"integer","description":"Total quantity of SKU."},"reservedQuantity":{"type":"integer","description":"Reserved quantity of the SKU."},"availableQuantity":{"type":"integer","description":"Amount of items available for sale. Difference between total quantity and reserved quantity."},"isUnlimited":{"type":"boolean","description":"Indicates whether the SKU's availability is unlimited (\"unlimited inventory\")."},"salesChannel":{"type":"array","description":"List of sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) associated.","items":{"type":"string","description":"Sales channel (trade policy) ID."}},"deliveryChannel":{"type":"array","description":"List of delivery channels available.","items":{"type":"string","description":"Delivery channel type available."}},"timeToRefill":{"type":"string","description":"Time to refill."},"dateOfSupplyUtc":{"type":"string","description":"Date of supply lot in UTC."},"keepSellingAfterExpiration":{"type":"boolean","description":"Indicates whether SKU can continue to be sold after the available quantity gets to 0."},"transfer":{"type":"string","description":"Transfer."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) information, searching by [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique identifier. | + | `warehouseId` | path | (Required) Warehouse ID is the unique identifier of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "skuId": "1", + "warehouseId": "1", + "dockId": "1", + "totalQuantity": 1000000, + "reservedQuantity": 0, + "availableQuantity": 1000000, + "isUnlimited": true, + "salesChannel": [ + "1" + ], + "deliveryChannels": [ + "delivery" + ], + "timeToRefill": "1", + "dateOfSupplyUtc": "12020-04-05T00:00:00+00:00", + "supplyLotId": "05-05-22", + "keepSellingAfterExpiration": false, + "transfer": "Transfer 1" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU.yml new file mode 100644 index 0000000000..9138b339ba --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory by SKU.yml @@ -0,0 +1,132 @@ +info: + name: List inventory by SKU + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/skus/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "36" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/skus/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/skus/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/skus/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/skus/:skuId - Schema is valid", function () { + const schema = {"type":"object","properties":{"skuId":{"type":"string","description":"SKU ID."},"balance":{"type":"array","description":"List with warehouses' inventory details.","items":{"type":"object","description":"Warehouse inventory details.","properties":{"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"warehouseName":{"type":"string","description":"Warehouse name."},"totalQuantity":{"type":"integer","format":"int32","description":"Total quantity of items of the given SKU."},"reservedQuantity":{"type":"integer","format":"int32","description":"SKU reserved quantity."},"hasUnlimitedQuantity":{"type":"boolean","description":"When set as `false`, every sold unit decreases the item's available quantity. When set as `true`, the SKU from the warehouse is always available for sale. No matter how many units are sold, the SKU available quantity never decreases, and the SKU is never out of stock."},"timeToRefill":{"type":["string","null"],"description":"Time to refill."},"dateOfSupplyUtc":{"type":["string","null"],"description":"Supply date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"leadTime":{"type":"string","description":"[Lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) is an optional time configuration you can make for a SKU in a warehouse. It can be handling time, fabrication or how long it takes for the item to be available to be shipped to customers. The lead time is a part of the total shipping time and will be considered for shipping date calculation. The format is `DD.HH:MM:SS`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) information, searching by SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Every SKU has a unique identifier called SKU ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "skuId": "10", + "balance": [ + { + "warehouseId": "1fabf84", + "warehouseName": "Main Warehouse", + "totalQuantity": 0, + "reservedQuantity": 0, + "hasUnlimitedQuantity": false, + "timeToRefill": null, + "dateOfSupplyUtc": null, + "leadTime": "00:00:00" + }, + { + "warehouseId": "14e3fcc", + "warehouseName": "Warehouse dew56", + "totalQuantity": 0, + "reservedQuantity": 0, + "hasUnlimitedQuantity": false, + "timeToRefill": null, + "dateOfSupplyUtc": null, + "leadTime": "1.00:00:00" + }, + { + "warehouseId": "102e53e", + "warehouseName": "wh-03", + "totalQuantity": 0, + "reservedQuantity": 0, + "hasUnlimitedQuantity": false, + "timeToRefill": null, + "dateOfSupplyUtc": null, + "leadTime": "00:00:00" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock and warehouse.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock and warehouse.yml new file mode 100644 index 0000000000..70b9e8f604 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock and warehouse.yml @@ -0,0 +1,127 @@ +info: + name: List inventory per dock and warehouse + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/docks/:dockId/warehouses/:warehouseId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: dockId + value: dock13a + type: path + - name: warehouseId + value: whs15hs6c + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId/warehouses/:warehouseId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId/warehouses/:warehouseId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId/warehouses/:warehouseId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId/warehouses/:warehouseId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Inventory information for the given dock and warehouse.","properties":{"skuId":{"type":"string","description":"SKU ID."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"totalQuantity":{"type":"integer","description":"Total quantity of SKU."},"reservedQuantity":{"type":"integer","description":"Reserved quantity of the SKU."},"availableQuantity":{"type":"integer","description":"Amount of items available for sales. Difference between total quantity and reserved quantity."},"isUnlimited":{"type":"boolean","description":"Indicates if the unlimited inventory is activated so the SKU's availability is unlimited (`true`) or not (`false`)."},"salesChannel":{"type":"array","description":"List of sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) associated.","items":{"type":"string","description":"Sales channel ID."}},"deliveryChannel":{"type":"array","description":"List of delivery channels available.","items":{"type":"string","description":"Delivey channel type."}},"timeToRefill":{"type":"string","description":"Time to refill (deprecated)."},"dateOfSupplyUtc":{"type":"string","description":"Date of supply lot in UTC."},"keepSellingAfterExpiration":{"type":"boolean","description":"Indicates whether SKU can continue to be sold after the available quantity gets to 0."},"transfer":{"type":"string","description":"Transfer."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists inventory information from the combination of a given [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) and a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique identifier. | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "skuId": "1", + "warehouseId": "1", + "dockId": "1", + "totalQuantity": 1000000, + "reservedQuantity": 0, + "availableQuantity": 1000000, + "isUnlimited": true, + "salesChannel": [ + "1" + ], + "deliveryChannels": [ + "delivery" + ], + "timeToRefill": "12:50:00", + "dateOfSupplyUtc": "2020-04-05T00:00:00+00:00", + "supplyLotId": null, + "keepSellingAfterExpiration": false, + "transfer": "Tranfer1" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock.yml new file mode 100644 index 0000000000..5722cf7ae7 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory per dock.yml @@ -0,0 +1,143 @@ +info: + name: List inventory per dock + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/docks/:dockId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: dockId + value: dock13a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/docks/:dockId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Loading dock inventory information.","properties":{"skuId":{"type":"string","description":"SKU ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Dock ID."},"totalQuantity":{"type":"integer","description":"Total quantity of SKU."},"reservedQuantity":{"type":"integer","description":"Reserved quantity of the SKU."},"availableQuantity":{"type":"integer","description":"Amount of items available for sales. Difference between total quantity and reserved quantity."},"isUnlimited":{"type":"boolean","description":"Indicates whether the SKU's availability is unlimited (\"unlimited inventory\")."},"salesChannel":{"type":"array","description":"List of sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) associated.","items":{"type":"string","description":"Sales channel ID."}},"deliveryChannel":{"type":"array","description":"List of delivery channels available.","items":{"type":"string","description":"Delivery channel type available."}},"timeToRefill":{"type":"string","description":"Time to refill."},"dateOfSupplyUtc":{"type":"string","description":"Date of supply lot in UTC."},"keepSellingAfterExpiration":{"type":"boolean","description":"Indicates whether SKU can continue to be sold after the available quantity gets to 0."},"transfer":{"type":"string","description":"Transfer supply lot."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists inventory information, searching by [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU unique identifier. | + | `dockId` | path | (Required) [Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "skuId": "1", + "warehouseId": "1", + "dockId": "1", + "totalQuantity": 1000000, + "reservedQuantity": 0, + "availableQuantity": 1000000, + "isUnlimited": true, + "salesChannel": [ + "1" + ], + "deliveryChannels": [ + "delivery" + ], + "timeToRefill": "01:50:00", + "dateOfSupplyUtc": "2020-04-05T00:00:00+00:00", + "supplyLotId": null, + "keepSellingAfterExpiration": false, + "transfer": "transfer1" + }, + { + "skuId": "1", + "warehouseId": "1_1", + "dockId": "1", + "totalQuantity": 1000117, + "reservedQuantity": 117, + "availableQuantity": 1000000, + "isUnlimited": true, + "salesChannel": [ + "1" + ], + "deliveryChannels": [ + "delivery" + ], + "timeToRefill": "01:50:00", + "dateOfSupplyUtc": "2020-04-05T00:00:00+00:00", + "supplyLotId": null, + "keepSellingAfterExpiration": false, + "transfer": "transfer2" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List inventory with dispatched reservations.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory with dispatched reservations.yml new file mode 100644 index 0000000000..acb58ca438 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List inventory with dispatched reservations.yml @@ -0,0 +1,116 @@ +info: + name: List inventory with dispatched reservations + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:itemId/warehouses/:warehouseId/dispatched" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "89" + type: path + - name: warehouseId + value: warehouse-1-StoreName + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/items/:itemId/warehouses/:warehouseId/dispatched - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:itemId/warehouses/:warehouseId/dispatched - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:itemId/warehouses/:warehouseId/dispatched - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:itemId/warehouses/:warehouseId/dispatched - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Inventory information.","properties":{"skuId":{"type":"string","description":"SKU ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"quantity":{"type":"integer","description":"SKU quantity."},"isUnlimitedQuantity":{"type":"boolean","description":"Indicates whether the SKU's availability is unlimited (\"unlimited inventory\")."},"totalReservedQuantity":{"type":"integer","description":"Total reserved quantity of the SKU."},"dispatchedReservationsQuantity":{"type":"integer","description":"Dispatched reservations quantity."},"availableQuantity":{"type":"integer","description":"Available quantity."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + [Reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) is the VTEX solution that prevents stores from selling the same item more than once. Adding products to the shopping cart does not create a reservation, this only happens after the shopper completes the purchase. + + This endpoint lists your [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) information about dispatched reservations from a given warehouse. A reservation is considered dispatched after the order has passed the `authorize-fulfillment` status in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) and is not canceled. + + **Response 400 Bad Request:** When the store has more than 2.000 active reservations, you receive a `400 Bad Request` error with the message: _Too many active reservations_. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU unique identifier called SKU ID. This field is an equivalent to `skuId`. | + | `warehouseId` | path | (Required) Warehouse ID is the unique identifier of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "skuId": "1", + "warehouseId": "1", + "quantity": 2147483647, + "isUnlimitedQuantity": true, + "totalReservedQuantity": 0, + "dispatchedReservationsQuantity": 0, + "availableQuantity": 2147483647 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/List supply lots.yml b/BrunoCollections/VTEX - Logistics API/Inventory/List supply lots.yml new file mode 100644 index 0000000000..0133938667 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/List supply lots.yml @@ -0,0 +1,128 @@ +info: + name: List supply lots + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: warehouseId + value: whs15hs6c + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Supply lot details.","properties":{"skuId":{"type":"string","description":"SKU ID related to the supply lot."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID where the SKU supply lot will arrive."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"totalQuantity":{"type":"integer","description":"Total quantity scheduled for the SKU in the supply lot."},"reservedQuantity":{"type":"integer","description":"Total [reserved quantity](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) scheduled for the SKU in the supply lot."},"availableQuantity":{"type":"integer","description":"Available quantity scheduled for the SKU in the supply lot."},"isUnlimited":{"type":"boolean","description":"Indicates if the unlimited inventory is activated so the SKU availability for sales is unlimited (`true`), or not (`false`)."},"salesChannel":{"type":"array","description":"List of sales channels ([trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) associated with the supply lot.","items":{"type":"string","description":"Sales channel (trade policy) ID."}},"deliveryChannels":{"type":"array","description":"List of delivery channels type associated with the supply lot.","items":{"type":"string","description":"Delivery channel type.","enum":["delivery","pickup"]}},"timeToRefill":{"type":["string","null"],"description":"Time to refill in the format `HH:MM:SS`."},"dateOfSupplyUtc":{"type":"string","description":"Date and time scheduled for the SKU from the warehouse to have quantity and availability for sales again. The format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"supplyLotId":{"type":"string","description":"Supply lot ID."},"keepSellingAfterExpiration":{"type":"boolean","description":"Defines if the SKU from the warehouse should be available for sales after running _out-of-stock_ (`true`), or not (`false`)."},"transfer":{"type":["string","null"],"description":"Transfer system."},"leadTime":{"type":["string","null"],"description":"[Lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) is an optional time configuration for a SKU in a warehouse. It can be handling time, fabrication or how long it takes for the item to be available to be shipped to customers. The lead time is a part of the total shipping time and is considered for shipping date calculation. The format is `DD.HH:MM:SS`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists supply lots of a SKU in a given [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). + + In architectures with franchise accounts or multiple sellers, the scheduled lead time of supply lots is not considered during seller selection or SLA calculation, so this feature may not behave as expected in these scenarios. + + In architectures that use Delivery Promise, supply lots are not considered in the SLA calculation, which may cause divergences between the lead time configured in the supply lot and the lead time displayed to the shopper. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics inventory full access** | + | Logistics | Logistics access | **Logistics inventory read only** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + | Logistics - Full access | Logistics inventory read only | + | Logistics - Read only | Logistics inventory read only | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU ID. | + | `warehouseId` | path | (Required) ID of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) where the SKU is located. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "skuId": "12", + "warehouseId": "124816", + "dockId": "1839", + "totalQuantity": 0, + "reservedQuantity": 0, + "availableQuantity": 0, + "isUnlimited": false, + "salesChannel": [ + "1" + ], + "deliveryChannels": [ + "delivery" + ], + "timeToRefill": "12:50:00", + "dateOfSupplyUtc": "2025-10-18T00:00:00+00:00", + "supplyLotId": "supplyId1", + "keepSellingAfterExpiration": true, + "transfer": null, + "leadTime": "10.00:00:00" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/Save supply lot.yml b/BrunoCollections/VTEX - Logistics API/Inventory/Save supply lot.yml new file mode 100644 index 0000000000..eecd4a07f9 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/Save supply lot.yml @@ -0,0 +1,89 @@ +info: + name: Save supply lot + type: http + seq: 10 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: warehouseId + value: whs15hs6c + type: path + - name: supplyLotId + value: 7100-1023-04 + type: path + body: + type: json + data: |- + { + "quantity": 1200, + "dateOfSupplyUtc": "2025-02-25T09:00:00+00:00", + "keepSellingAfterExpiration": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new supply lot, which allows you to sell a SKU that is currently _out-of-stock_ in your [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) and unavailable for sales. Creating a supply lot is useful when you know the date of when the SKU will have quantity and availability for sales again. + + In architectures with franchise accounts or multiple sellers, the scheduled lead time of supply lots is not considered during seller selection or SLA calculation, so this feature may not behave as expected in these scenarios. + + In architectures that use Delivery Promise, supply lots are not considered in the SLA calculation, which may cause divergences between the lead time configured in the supply lot and the lead time displayed to the shopper. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics inventory full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU ID being scheduled for availability for sales. | + | `warehouseId` | path | (Required) ID of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) where the SKU will arrive. | + | `supplyLotId` | path | (Required) ID of the supply lot of the SKU availability scheduling. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/Transfer supply lot.yml b/BrunoCollections/VTEX - Logistics API/Inventory/Transfer supply lot.yml new file mode 100644 index 0000000000..7ffc4423a8 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/Transfer supply lot.yml @@ -0,0 +1,81 @@ +info: + name: Transfer supply lot + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId/transfer" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "36" + type: path + - name: warehouseId + value: whs15hs6c + type: path + - name: supplyLotId + value: 7100-1023-04 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId/transfer - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/inventory/items/:skuId/warehouses/:warehouseId/supplyLots/:supplyLotId/transfer - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Transfers a SKU from a supply lot to the currently available inventory. + + In architectures with franchise accounts or multiple sellers, the scheduled lead time of supply lots is not considered during seller selection or SLA calculation, so this feature may not behave as expected in these scenarios. + + In architectures that use Delivery Promise, supply lots are not considered in the SLA calculation, which may cause divergences between the lead time configured in the supply lot and the lead time displayed to the shopper. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics inventory full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) ID of the SKU. | + | `warehouseId` | path | (Required) ID of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) where the SKU is located. | + | `supplyLotId` | path | (Required) ID of the supply lot in which the SKU is currently located and from where it will be transfered. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory by SKU and warehouse.yml b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory by SKU and warehouse.yml new file mode 100644 index 0000000000..aa42add584 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory by SKU and warehouse.yml @@ -0,0 +1,91 @@ +info: + name: Update inventory by SKU and warehouse + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "25" + type: path + - name: warehouseId + value: store-warehouse + type: path + body: + type: json + data: |- + { + "quantity": 202, + "unlimitedQuantity": false, + "dateUtcOnBalanceSystem": "2024-06-13T00:52:16", + "leadTime": "10.10:00:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) quantity and [lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) for a given SKU in a warehouse. + + >ℹ️ If you wish to configure lead time exclusively, use the [Update inventory lead time by SKU and warehouse](https://developers.vtex.com/docs/api-reference/logistics-api#patch-/api/logistics/pvt/inventory/skus/-skuId-/warehouses/-warehouseId-/lead-time) endpoint, and if the quantity only, use the [Update inventory quantity by SKU and warehouse](https://developers.vtex.com/docs/api-reference/logistics-api#patch-/api/logistics/pvt/inventory/skus/-skuId-/warehouses/-warehouseId-/quantity) endpoint. + + This endpoint allows you to: + + - **Define a quantity:** Indicate a specific number of items of a SKU from a warehouse, and it will decrease whenever an item is sold. When the last item is sold, the SKU will run out of stock. + + - **Set an unlimited inventory:** Always have items of a SKU from a warehouse considered available for sale. When this configuration is active, the SKU never goes out of stock. + + - **Configure lead time:** Set the [lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) for a given SKU from a warehouse, and this period will be added to the order total shipping time. This configuration is optional and by default it is set to `0` days. + + Successful requests receive a `200 OK` status code with `true` in the response body, and unsuccessful requests receive a `400 Bad Request` error code. + + >❗ Requests made with an incomplete response body can be successful and receive a `200 OK` message. However, sending the request body without the `leadTime` field sets the SKU [lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) to `0`. The same is valid for the `quantity` field, which, if not sent, makes the SKU count equal to `0`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics inventory full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU you wish to update. | + | `warehouseId` | path | (Required) Unique identifier of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) of the SKU you wish to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory lead time by SKU and warehouse.yml b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory lead time by SKU and warehouse.yml new file mode 100644 index 0000000000..c8b2840c4c --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory lead time by SKU and warehouse.yml @@ -0,0 +1,83 @@ +info: + name: Update inventory lead time by SKU and warehouse + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/lead-time" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "25" + type: path + - name: warehouseId + value: storeWarehouse + type: path + body: + type: json + data: |- + { + "leadTime": "8.00:00:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/lead-time - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/lead-time - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Configures the [lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) for a SKU of a warehouse, and the period is added to the order's total shipping time. + + Among other [main use cases](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B#main-use-cases), lead time can represent an item's manufacturing time or scenarios where there are third-party suppliers, for example. + + Lead time is an optional configuration and by default is set to `0` days. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics inventory full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU you wish to update. | + | `warehouseId` | path | (Required) Unique identifier of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) of the SKU you wish to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory quantity by SKU and warehouse.yml b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory quantity by SKU and warehouse.yml new file mode 100644 index 0000000000..5b6e95bef4 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/Update inventory quantity by SKU and warehouse.yml @@ -0,0 +1,85 @@ +info: + name: Update inventory quantity by SKU and warehouse + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/quantity" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "25" + type: path + - name: warehouseId + value: storeWarehouse + type: path + body: + type: json + data: |- + { + "quantity": 201, + "unlimitedQuantity": false, + "dateUtcOnBalanceSystem": "2024-01-31T19:12:01.025662+00:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/quantity - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/logistics/pvt/inventory/skus/:skuId/warehouses/:warehouseId/quantity - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) with a SKU count and availability for a given [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). You can do it in two ways: + + - **Define a quantity:** Indicate a specific number of items of a SKU from a warehouse, and it will decrease whenever an item is sold. When the last item is sold, the SKU will run out of stock. + + - **Set an unlimited inventory:** Always have items of a SKU from a warehouse considered available for sales. When this configuration is active, the SKU never runs out of stock. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics inventory full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics inventory full access | + | OMS - Full access | Logistics inventory full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU you wish to update. | + | `warehouseId` | path | (Required) Unique identifier of the [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) of the SKU you wish to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Inventory/folder.yml b/BrunoCollections/VTEX - Logistics API/Inventory/folder.yml new file mode 100644 index 0000000000..39f437e96b --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Inventory/folder.yml @@ -0,0 +1,4 @@ +info: + name: Inventory + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/Create or update pickup point.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/Create or update pickup point.yml new file mode 100644 index 0000000000..b586fb6c73 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/Create or update pickup point.yml @@ -0,0 +1,210 @@ +info: + name: Create or update pickup point + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/configuration/pickuppoints/:pickupPointId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pickupPointId + value: b8e7ca56 + type: path + body: + type: json + data: |- + { + "id": "b8e7ca56", + "name": "Pickup store.", + "description": "Pickup your items in our store.", + "instructions": "Bring your ID in order to pickup your order.", + "formatted_address": "undefined", + "address": { + "postalCode": "22070002", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Botafogo", + "street": "Praia de botafogo.", + "number": "200", + "complement": "3rd floor", + "reference": "Grey building", + "location": { + "latitude": -22.974477767944336, + "longitude": -43.18672561645508 + } + }, + "isActive": true, + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "08:00:00", + "closingTime": "20:00:00" + } + ], + "tagsLabel": [ + "w67" + ], + "isThirdPartyPickup": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Schema is valid", function () { + const schema = {"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID."},"name":{"type":"string","description":"Pickup point name displayed to customers at checkout."},"description":{"type":"string","description":"Pickup point description displayed to customers at checkout."},"instructions":{"type":"string","description":"Instructions for customers when collecting their package."},"formatted_address":{"type":["string","null"],"description":"Formatted address."},"address":{"type":"object","description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":"string","description":"Reference point to help the customer find the pickup point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"isActive":{"type":"boolean","description":"Defines if the pickup point is active (`true`) or inactive (`false`)."},"distance":{"type":"number","description":"Pickup point configured distance."},"seller":{"type":"string","description":"Seller that corresponds to the pickup point."},"_sort":{"type":"array","description":"Sort array.","items":{"type":"number","description":"Pickup point sort information."}},"businessHours":{"type":"array","description":"Pickup point business hours configurations.","items":{"type":"object","description":"Business hours configurations from Monday to Friday.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday."},"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."}}}},"tagsLabel":{"type":"array","description":"Tags that identify a group of pickup points.","items":{"type":"string","description":"Pickup point tag label."}},"pickupHolidays":{"type":"array","description":"[Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point.","items":{"type":"object","description":"Holiday information.","properties":{"date":{"type":"string","description":"Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"hourBegin":{"type":"string","description":"Holiday beginning time in `HH:MM` format."},"hourEnd":{"type":"string","description":"Holiday ending time in `HH:MM` format."}}}},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup point is third-party (`true`) or not (`false`)."},"accountOwnerName":{"type":"string","description":"Account owner name."},"accountOwnerId":{"type":"string","description":"Account owner ID."},"parentAccountName":{"type":"string","description":"Parent account name."},"originalId":{"type":["string","null"],"description":"Original ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store, searching by pickup point ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `pickupPointId` | path | (Required) [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID. Cannot contain spaces. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "b8e7ca56", + "name": "Pickup Shopping Center", + "description": "Shopping Center from Barra", + "instructions": "You have to present a document to collect your package", + "formatted_address": "undefined", + "address": { + "postalCode": "22250040", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Botafogo", + "street": "Botafogo beach", + "number": "300", + "complement": "Shopping Center", + "reference": "Third floor", + "location": { + "latitude": -22.906847, + "longitude": -43.172897 + } + }, + "isActive": true, + "distance": 0, + "seller": "Fashion Skirts", + "_sort": [ + 1574240390000 + ], + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + } + ], + "tagsLabel": [ + "w67", + "p34" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" + }, + { + "date": "2024-11-17T03:00:00Z", + "hourBegin": "00:00", + "hourEnd": "00:00" + } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "fashionstore", + "accountOwnerId": "1b4018ec-48bf-4a59-9eae-547403e11afc", + "parentAccountName": "fashionstore", + "originalId": "b8e7ca56" + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/Delete pickup point.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/Delete pickup point.yml new file mode 100644 index 0000000000..cbe16cb0db --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/Delete pickup point.yml @@ -0,0 +1,69 @@ +info: + name: Delete pickup point + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/configuration/pickuppoints/:pickupPointId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pickupPointId + value: b8e7ca56 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store, searching by pickup point ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `pickupPointId` | path | (Required) [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/List paged pickup points.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/List paged pickup points.yml new file mode 100644 index 0000000000..4a3c988817 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/List paged pickup points.yml @@ -0,0 +1,106 @@ +info: + name: List paged pickup points + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/pickuppoints/_search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: page + value: "2" + type: query + disabled: true + - name: pageSize + value: "15" + type: query + disabled: true + - name: keyword + value: Rio + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/_search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/_search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/_search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/_search - Schema is valid", function () { + const schema = {"type":"object","description":"Paged pickup points list.","properties":{"items":{"type":"array","description":"List of pickup points.","items":{"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID."},"name":{"type":"string","description":"Pickup point name displayed to customers at checkout."},"description":{"type":"string","description":"Pickup point description displayed to customers at checkout."},"instructions":{"type":"string","description":"Instructions for customers when collecting their package."},"formatted_address":{"type":["string","null"],"description":"Formatted address."},"address":{"type":"object","description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":"string","description":"Reference point to help the customer find the pickup point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"isActive":{"type":"boolean","description":"Defines if the pickup point is active (`true`) or inactive (`false`)."},"distance":{"type":"number","description":"Pickup point configured distance."},"seller":{"type":"string","description":"Seller that corresponds to the pickup point."},"_sort":{"type":"array","description":"Sort array.","items":{"type":"number","description":"Pickup point sort information."}},"businessHours":{"type":"array","description":"Pickup point business hours configurations.","items":{"type":"object","description":"Business hours configurations from Monday to Friday.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday."},"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."}}}},"tagsLabel":{"type":"array","description":"Tags that identify a group of pickup points.","items":{"type":"string","description":"Pickup point tag label."}},"pickupHolidays":{"type":"array","description":"[Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point.","items":{"type":"object","description":"Holiday information.","properties":{"date":{"type":"string","description":"Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"hourBegin":{"type":"string","description":"Holiday beginning time in `HH:MM` format."},"hourEnd":{"type":"string","description":"Holiday ending time in `HH:MM` format."}}}},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup point is third-party (`true`) or not (`false`)."},"accountOwnerName":{"type":"string","description":"Account owner name."},"accountOwnerId":{"type":"string","description":"Account owner ID."},"parentAccountName":{"type":"string","description":"Parent account name."},"originalId":{"type":["string","null"],"description":"Original ID."}}}},"paging":{"type":"object","description":"Pagination information.","properties":{"page":{"type":"integer","description":"Number of the current page of the response. By default, it returns page `1`, unless a different value is informed in the `page` query parameter."},"perPage":{"type":"integer","description":"Number of pickup points per page."},"total":{"type":"integer","description":"Total number of existing pickup points."},"pages":{"type":"integer","description":"Total number of pages, considering the total number of pickup points. Even though there might be other results, the maximum value of this field will be `100`, because the response is limited to 100 pages."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists paged [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store. + + >⚠️ The response is limited to 100 pages. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | query | Number of the page of the response. When not informed, the default page returned is `1`, but you can use this parameter to retrieve a specific page. The response is limited to 100 pages. | + | `pageSize` | query | Number of [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) per page. | + | `keyword` | query | Search pickup points by using a keyword. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 3 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup point by ID.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup point by ID.yml new file mode 100644 index 0000000000..23f1090e89 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup point by ID.yml @@ -0,0 +1,173 @@ +info: + name: List pickup point by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/pickuppoints/:pickupPointId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: pickupPointId + value: b8e7ca56 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints/:pickupPointId - Schema is valid", function () { + const schema = {"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID."},"name":{"type":"string","description":"Pickup point name displayed to customers at checkout."},"description":{"type":"string","description":"Pickup point description displayed to customers at checkout."},"instructions":{"type":"string","description":"Instructions for customers when collecting their package."},"formatted_address":{"type":["string","null"],"description":"Formatted address."},"address":{"type":"object","description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":"string","description":"Reference point to help the customer find the pickup point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"isActive":{"type":"boolean","description":"Defines if the pickup point is active (`true`) or inactive (`false`)."},"distance":{"type":"number","description":"Pickup point configured distance."},"seller":{"type":"string","description":"Seller that corresponds to the pickup point."},"_sort":{"type":"array","description":"Sort array.","items":{"type":"number","description":"Pickup point sort information."}},"businessHours":{"type":"array","description":"Pickup point business hours configurations.","items":{"type":"object","description":"Business hours configurations from Monday to Friday.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday."},"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."}}}},"tagsLabel":{"type":"array","description":"Tags that identify a group of pickup points.","items":{"type":"string","description":"Pickup point tag label."}},"pickupHolidays":{"type":"array","description":"[Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point.","items":{"type":"object","description":"Holiday information.","properties":{"date":{"type":"string","description":"Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"hourBegin":{"type":"string","description":"Holiday beginning time in `HH:MM` format."},"hourEnd":{"type":"string","description":"Holiday ending time in `HH:MM` format."}}}},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup point is third-party (`true`) or not (`false`)."},"accountOwnerName":{"type":"string","description":"Account owner name."},"accountOwnerId":{"type":"string","description":"Account owner ID."},"parentAccountName":{"type":"string","description":"Parent account name."},"originalId":{"type":["string","null"],"description":"Original ID."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), searching by pickup point ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `pickupPointId` | path | (Required) [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "b8e7ca56", + "name": "Pickup Shopping Center", + "description": "Shopping Center from Barra", + "instructions": "You have to present a document to collect your package", + "formatted_address": "undefined", + "address": { + "postalCode": "22250040", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Botafogo", + "street": "Botafogo beach", + "number": "300", + "complement": "Shopping Center", + "reference": "Third floor", + "location": { + "latitude": -22.906847, + "longitude": -43.172897 + } + }, + "isActive": true, + "distance": 0, + "seller": "Fashion Skirts", + "_sort": [ + 1574240390000 + ], + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + } + ], + "tagsLabel": [ + "w67", + "p34" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" + }, + { + "date": "2024-11-17T03:00:00Z", + "hourBegin": "00:00", + "hourEnd": "00:00" + } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "fashionstore", + "accountOwnerId": "1b4018ec-48bf-4a59-9eae-547403e11afc", + "parentAccountName": "fashionstore", + "originalId": "b8e7ca56" + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup points.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup points.yml new file mode 100644 index 0000000000..06fe7e9506 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/List pickup points.yml @@ -0,0 +1,246 @@ +info: + name: List pickup points + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/pickuppoints" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/pickuppoints - Schema is valid", function () { + const schema = {"type":"array","description":"List of pickup points, limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint.","items":{"type":"object","description":"Pickup point information.","properties":{"id":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID."},"name":{"type":"string","description":"Pickup point name displayed to customers at checkout."},"description":{"type":"string","description":"Pickup point description displayed to customers at checkout."},"instructions":{"type":"string","description":"Instructions for customers when collecting their package."},"formatted_address":{"type":["string","null"],"description":"Formatted address."},"address":{"type":"object","description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":"string","description":"Reference point to help the customer find the pickup point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"isActive":{"type":"boolean","description":"Defines if the pickup point is active (`true`) or inactive (`false`)."},"distance":{"type":"number","description":"Pickup point configured distance."},"seller":{"type":"string","description":"Seller that corresponds to the pickup point."},"_sort":{"type":"array","description":"Sort array.","items":{"type":"number","description":"Pickup point sort information."}},"businessHours":{"type":"array","description":"Pickup point business hours configurations.","items":{"type":"object","description":"Business hours configurations from Monday to Friday.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday."},"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."}}}},"tagsLabel":{"type":"array","description":"Tags that identify a group of pickup points.","items":{"type":"string","description":"Pickup point tag label."}},"pickupHolidays":{"type":"array","description":"[Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point.","items":{"type":"object","description":"Holiday information.","properties":{"date":{"type":"string","description":"Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"hourBegin":{"type":"string","description":"Holiday beginning time in `HH:MM` format."},"hourEnd":{"type":"string","description":"Holiday ending time in `HH:MM` format."}}}},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup point is third-party (`true`) or not (`false`)."},"accountOwnerName":{"type":"string","description":"Account owner name."},"accountOwnerId":{"type":"string","description":"Account owner ID."},"parentAccountName":{"type":"string","description":"Parent account name."},"originalId":{"type":["string","null"],"description":"Original ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about your store [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R). + + >⚠️ The response is limited to 1.000 pickup points. If you need more results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "b8e7ca56", + "name": "Pickup Shopping Center", + "description": "Shopping Center from Barra", + "instructions": "You have to present a document to collect your package", + "formatted_address": "undefined", + "address": { + "postalCode": "22250040", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Botafogo", + "street": "Botafogo beach", + "number": "300", + "complement": "Shopping Center", + "reference": "Third floor", + "location": { + "latitude": -22.906847, + "longitude": -43.172897 + } + }, + "isActive": true, + "distance": 0, + "seller": "Fashion Skirts", + "_sort": [ + 1574240390000 + ], + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + } + ], + "tagsLabel": [ + "w67", + "p34" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" + }, + { + "date": "2024-11-17T03:00:00Z", + "hourBegin": "00:00", + "hourEnd": "00:00" + } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "Fashion Store", + "accountOwnerId": "1b4018ec-48bf-4a59-9eae-547403e11afc", + "parentAccountName": "Fashion Store", + "originalId": null + }, + { + "id": "792893547449051", + "name": "Bleu PUP", + "description": "Bleu Store", + "instructions": "You must present a document to collect your order", + "formatted_address": "undefined", + "address": { + "postalCode": "18550-000", + "country": { + "acronym": "BRA", + "name": "Brasil" + }, + "city": "Boituva", + "state": "SP", + "neighborhood": "Tancredo Neves", + "street": "BTV-250", + "number": "01", + "complement": "Second floor", + "reference": "Next to the city hall", + "location": { + "latitude": -23.2863329, + "longitude": -47.6783742 + } + }, + "isActive": true, + "distance": 1574240387072, + "seller": "Recurrency", + "_sort": [ + 1574240390000 + ], + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + } + ], + "tagsLabel": [ + "kr47", + "yk15" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" + } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "sportsstore", + "accountOwnerId": "9ddcfba5-3855-49ec-b61e-b2847b9314cc", + "parentAccountName": "sportsstore", + "originalId": "b8e7ca56" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Pickup points/folder.yml b/BrunoCollections/VTEX - Logistics API/Pickup points/folder.yml new file mode 100644 index 0000000000..0b37ce4fff --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Pickup points/folder.yml @@ -0,0 +1,4 @@ +info: + name: Pickup points + type: folder + seq: 10 diff --git a/BrunoCollections/VTEX - Logistics API/Polygons/Create or update polygon.yml b/BrunoCollections/VTEX - Logistics API/Polygons/Create or update polygon.yml new file mode 100644 index 0000000000..045c99f8d2 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Polygons/Create or update polygon.yml @@ -0,0 +1,102 @@ +info: + name: Create or update polygon + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/configuration/geoshape" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "ipanema_leblon", + "geoShape": { + "coordinates": [ + [ + [ + -43.23171615600586 + ] + ] + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/logistics/pvt/configuration/geoshape - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/logistics/pvt/configuration/geoshape - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/logistics/pvt/configuration/geoshape - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/logistics/pvt/configuration/geoshape - Schema is valid", function () { + const schema = {"type":"string","description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) created or updated."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates a [polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) of your store, using geolocation coordinates. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + ipanema_leblon + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Polygons/Delete polygon.yml b/BrunoCollections/VTEX - Logistics API/Polygons/Delete polygon.yml new file mode 100644 index 0000000000..be287b6e09 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Polygons/Delete polygon.yml @@ -0,0 +1,94 @@ +info: + name: Delete polygon + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/configuration/geoshape/:polygonName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: polygonName + value: ipanema_leblon + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/logistics/pvt/configuration/geoshape/:polygonName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/logistics/pvt/configuration/geoshape/:polygonName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/logistics/pvt/configuration/geoshape/:polygonName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/logistics/pvt/configuration/geoshape/:polygonName - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) of your store, searching by polygon ID. + + Successful requests receive a `200 OK` status code with `true` in the response body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `polygonName` | path | (Required) [Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) ID (same as the polygon name). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Polygons/List paged polygons.yml b/BrunoCollections/VTEX - Logistics API/Polygons/List paged polygons.yml new file mode 100644 index 0000000000..acd99c6f3e --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Polygons/List paged polygons.yml @@ -0,0 +1,113 @@ +info: + name: List paged polygons + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/geoshape" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: page + value: "2" + type: query + disabled: true + - name: perPage + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/geoshape - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape - Schema is valid", function () { + const schema = {"type":"object","properties":{"items":{"type":"array","description":"Polygons list.","items":{"type":"string","description":"Polygon name."}},"paging":{"type":"object","description":"Pagination information.","properties":{"page":{"type":"integer","description":"Number of the current page of the response. By default, it returns page `1`."},"perPage":{"type":"integer","description":"Number of polygons per page."},"total":{"type":"integer","description":"Total number of existing polygons."},"pages":{"type":"integer","description":"Total number of pages, considering the total number of polygons."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists paged [polygons](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) of your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | query | Number of the page of the response. | + | `perPage` | query | Number of [polygons](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) per page. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + "ipanema_leblon", + "SP", + "south_brazil" + ], + "paging": { + "page": 1, + "perPage": 15, + "total": 22, + "pages": 2 + } + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Polygons/List polygon by ID.yml b/BrunoCollections/VTEX - Logistics API/Polygons/List polygon by ID.yml new file mode 100644 index 0000000000..1f794f3d6f --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Polygons/List polygon by ID.yml @@ -0,0 +1,125 @@ +info: + name: List polygon by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/geoshape/:polygonName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: polygonName + value: ipanema_leblon + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/geoshape/:polygonName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape/:polygonName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape/:polygonName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/geoshape/:polygonName - Schema is valid", function () { + const schema = {"type":"object","properties":{"isActive":{"type":"boolean","description":"Defines if the polygon is active (`true`) or inactive (`false`)."},"name":{"type":"string","description":"[Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) ID, which is the same as the polygon name."},"geoShape":{"type":"object","description":"Polygon geolocation coordinates.","properties":{"coordinates":{"type":"array","description":"List of geolocation coordinates that make part of the polygon.","items":{"type":"array","description":"Polygon geolocation coordinates. The first and the last pair of coordinates must be equal.","items":{"type":"array","description":"Polygon geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}},"type":{"type":"string","description":"Polygon identification."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a [polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) of your store, searching by polygon ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `polygonName` | path | (Required) [Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) ID (same as the polygon name). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "isActive": true, + "name": "ipanema_leblon", + "geoShape": { + "coordinates": [ + [ + [ + -43.23171615600586, + -22.990713500405295 + ], + [ + -43.182621002197266, + -22.990713500405295 + ], + [ + -43.182621002197266, + -22.977043559707305 + ], + [ + -43.23171615600586, + -22.977043559707305 + ], + [ + -43.23171615600586, + -22.990713500405295 + ] + ] + ], + "type": "polygon" + } + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Polygons/folder.yml b/BrunoCollections/VTEX - Logistics API/Polygons/folder.yml new file mode 100644 index 0000000000..8efae2daa3 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Polygons/folder.yml @@ -0,0 +1,4 @@ +info: + name: Polygons + type: folder + seq: 11 diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/Acknowledgment reservation.yml b/BrunoCollections/VTEX - Logistics API/Reservations/Acknowledgment reservation.yml new file mode 100644 index 0000000000..fcc0ae1b6e --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/Acknowledgment reservation.yml @@ -0,0 +1,61 @@ +info: + name: Acknowledgment reservation + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations/:reservationId/acknowledge" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reservationId + value: 00-1336411707838-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/inventory/reservations/:reservationId/acknowledge - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Acknowledges a [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92), searching by reservation ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reservationId` | path | (Required) [Reservation](https://help.vtex.com/en/tutorial/how-the-reservation-works--tutorials_92) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/Cancel reservation.yml b/BrunoCollections/VTEX - Logistics API/Reservations/Cancel reservation.yml new file mode 100644 index 0000000000..7318cce577 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/Cancel reservation.yml @@ -0,0 +1,61 @@ +info: + name: Cancel reservation + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations/:reservationId/cancel" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reservationId + value: 00-1336411707838-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/inventory/reservations/:reservationId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92), searching by reservation ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reservationId` | path | (Required) [Reservation](https://help.vtex.com/en/tutorial/how-the-reservation-works--tutorials_92) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/Confirm reservation.yml b/BrunoCollections/VTEX - Logistics API/Reservations/Confirm reservation.yml new file mode 100644 index 0000000000..59ea1ec327 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/Confirm reservation.yml @@ -0,0 +1,61 @@ +info: + name: Confirm reservation + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations/:reservationId/confirm" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reservationId + value: 00-1336411707838-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/inventory/reservations/:reservationId/confirm - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Confirms a [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92), searching by reservation ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reservationId` | path | (Required) [Reservation](https://help.vtex.com/en/tutorial/how-the-reservation-works--tutorials_92) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/Create reservation.yml b/BrunoCollections/VTEX - Logistics API/Reservations/Create reservation.yml new file mode 100644 index 0000000000..9f7e639e98 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/Create reservation.yml @@ -0,0 +1,199 @@ +info: + name: Create reservation + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "salesChannel": "1", + "lockId": null, + "autorizationExpirationTTL": "10.00:00:00", + "deliveryItemOptions": [ + { + "item": { + "id": "29", + "quantity": 1, + "kitItem": [], + "price": 14128.9, + "modal": "FURNITURE", + "additionalHandlingTime": "00:00:00", + "dimension": { + "weight": 186.37, + "height": 23.5, + "width": 165, + "length": 67.5 + } + }, + "slaType": "delivery", + "slaTypeName": "Normal delivery", + "listPrice": 10.5, + "promotionalPrice": 10.5, + "transitTime": "2.00:00:00", + "dockTime": "00:00:00", + "timeToDockPlusDockTime": "1.00:00:00", + "aditionalTimeBlockedDays": "1.00:00:00", + "totalTime": "3.00:00:00", + "deliveryWindows": [ + { + "startDateUtc": "2024-02-25T09:00:00+00:00", + "endDateUtc": "2024-02-25T12:00:00+00:00", + "listPrice": "0.0" + } + ], + "wareHouseId": "1937054", + "dockId": "1a8bce3", + "location": { + "zipCode": "22220070", + "country": "BRA", + "inStore": { + "IsCheckedIn": false, + "StoreId": "180082" + } + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics/pvt/inventory/reservations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/inventory/reservations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics/pvt/inventory/reservations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics/pvt/inventory/reservations - Schema is valid", function () { + const schema = {"type":"object","properties":{"LastUpdateDateUtc":{"type":"string","description":"Last update date and time in the format [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"SalesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) valid for the reservation."},"LockId":{"type":"string","description":"Reservation ID."},"ReservationDateUtc":{"type":"string","description":"Reservation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"MaximumConfirmationDateUtc":{"type":"string","description":"Maximum confirmation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"Status":{"type":"integer","format":"int32","description":"Reservation status, meaning:\r\n\r\n- `0`: `NotCommitted`\r\n\r\n- `1`: `Authorized`\r\n\r\n- `2`: `Confirmed`\r\n\r\n- `3`: `Canceled_AbortedCommitted`\r\n\r\n- `4`: `Canceled_AuthorizationExpired`\r\n\r\n- `5`: `Canceled_Manually`"},"SlaRequest":{"type":"array","description":"SLA (Service Level Agreement) request information.","items":{"type":"object","description":"SLA details.","properties":{"item":{"type":"object","description":"Information about the reserved item.","properties":{"id":{"type":"string","description":"SKU ID."},"groupItemId":{"type":["string","null"],"description":"Group item ID."},"quantity":{"type":"integer","format":"int32","description":"Item quantity."},"price":{"type":"number","description":"Item price."},"modal":{"type":["string","null"],"description":"Type of [modal](https://help.vtex.com/en/tutorial/how-the-modal-works--tutorials_125), a special freight.","enum":["CHEMICALS","ELECTRONICS","FURNITURE","GLASS","LIQUID","MATTRESSES","REFRIGERATED","TIRES","WHITE_GOODS","FIREARMS"]},"additionalHandlingTime":{"type":"string","description":"Additional handling time in the format `DD.HH:MM:SS`."},"dimension":{"type":"object","description":"Item dimensions.","properties":{"weight":{"type":"number","description":"Item weight."},"height":{"type":"number","description":"Item height."},"width":{"type":"number","description":"Item width."},"length":{"type":"number","description":"Item length."},"maxSumDimension":{"type":"number","description":"Maximum sum of dimensions."}}},"kitItem":{"type":["array","null"],"items":{"type":"string","description":"SKU ID."},"description":"[Kit](https://help.vtex.com/en/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) item information."},"unlimitedQuantity":{"type":"boolean","description":"When set as `false`, every sold unit decreases the item's available quantity. When set as `true`, the SKU from the warehouse is always available for sale. No matter how many units are sold, the SKU available quantity never decreases, and the SKU is never out of stock."}}},"slaType":{"type":"string","description":"SLA (Service Level Agreement) type."},"slaTypeName":{"type":"string","description":"SLA name."},"freightTableName":{"type":"string","description":"[Shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) name."},"freightTableId":{"type":"string","description":"Shipping rate template ID."},"listPrice":{"type":"number","description":"List price."},"promotionalPrice":{"type":"number","description":"Promotion price."},"transitTime":{"type":"string","description":"Transit time in the format `DD.HH:MM:SS`."},"dockTime":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`."},"timeToDockPlusDockTime":{"type":"string","description":"Time spent in loading dock plus `dockTime` in the format `D.HH:MM:SS`."},"totalTime":{"type":"string","description":"SLA total time in the format `DD.HH:MM:SS`."},"deliveryWindows":{"type":["object","null"],"items":{"type":"object","description":"Delivery window details.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"listPrice":{"type":"number","description":"List price."}}},"description":"[Delivery windows](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz)."},"wareHouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"wmsEndPoint":{"type":["string","null"],"description":"Warehouse Management System (WMS) fulfillment endpoint."},"location":{"type":"object","description":"Shipping location information.","properties":{"zipCode":{"type":"string","description":"Shipping address postal code."},"country":{"type":"string","description":"Three-digit country code of the shipping address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"deliveryPointId":{"type":["string","null"],"description":"Delivery point ID."},"point":{"type":["array","null"],"description":"Location delivery point coordinates.","items":{"type":"number","description":"Location coordinates, first longitude, then latitude."}},"inStore":{"type":"object","description":"Information related to [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).","properties":{"IsCheckedIn":{"type":"boolean","description":"This field is set as `true` when the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) and `false` when it was not."},"StoreId":{"type":["string","null"],"description":"ID of purchases made in the GoCommerce context."}}}}},"pickupStoreInfo":{"type":["string","null"],"description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."}}}},"PickupPointItemOptions":{"type":["string","null"],"description":"(Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) item options."},"CanceledDateUtc":{"type":"string","description":"Reservation canceled date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"AuthorizedDateUtc":{"type":"string","description":"Authorized date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"ConfirmedDateUtc":{"type":"string","description":"Confirmed date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"Errors":{"type":["array","null"],"description":"Errors details, if there are any.","items":{"type":["string","null"],"description":"Error message."}},"IsSucess":{"type":"boolean","description":"Defines if the reservation was successful (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "LastUpdateDateUtc": "2024-04-15T19:59:20.0397988+00:00", + "SalesChannel": "1", + "LockId": "3bfe679d-c0a8-475a-b315-706f84a9deb4", + "ReservationDateUtc": "2024-04-15T19:59:20.0397988+00:00", + "MaximumConfirmationDateUtc": "2024-04-15T20:09:20.0397988+00:00", + "Status": 1, + "SlaRequest": [ + { + "item": { + "id": "29", + "groupItemId": null, + "quantity": 1, + "price": 0, + "modal": "FURNITURE", + "additionalHandlingTime": "00:00:00", + "dimension": { + "weight": 186.37, + "height": 23.5, + "width": 165, + "length": 67.5, + "maxSumDimension": 300 + }, + "kitItem": [], + "unlimitedQuantity": false + }, + "slaType": "delivery", + "slaTypeName": "Normal delivery", + "freightTableName": "Correios PAC", + "freightTableId": "11cc4b6", + "listPrice": 10.5, + "promotionalPrice": 10.5, + "transitTime": "2.00:00:00", + "dockTime": "00:00:00", + "timeToDockPlusDockTime": "1.00:00:00", + "totalTime": "3.00:00:00", + "deliveryWindows": { + "startDateUtc": "2024-02-25T09:00:00+00:00", + "endDateUtc": "2024-02-25T12:00:00+00:00", + "listPrice": 0 + }, + "wareHouseId": "1937054", + "dockId": "1a8bce3", + "wmsEndPoint": null, + "location": { + "zipCode": "22220070", + "country": "BRA", + "deliveryPointId": null, + "point": null, + "inStore": { + "IsCheckedIn": false, + "StoreId": "180082" + } + }, + "pickupStoreInfo": null + } + ], + "PickupPointItemOptions": null, + "CanceledDateUtc": "0001-01-01T00:00:00+00:00", + "AuthorizedDateUtc": "2024-04-15T19:59:20.0397988+00:00", + "ConfirmedDateUtc": "0001-01-01T00:00:00+00:00", + "Errors": [], + "IsSucess": true + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by ID.yml b/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by ID.yml new file mode 100644 index 0000000000..6992437aa6 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by ID.yml @@ -0,0 +1,176 @@ +info: + name: List reservation by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations/:reservationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reservationId + value: 00-1336411707838-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/inventory/reservations/:reservationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/inventory/reservations/:reservationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/inventory/reservations/:reservationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/inventory/reservations/:reservationId - Schema is valid", function () { + const schema = {"type":"object","properties":{"LastUpdateDateUtc":{"type":"string","description":"Last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"SalesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) valid for the reservation."},"LockId":{"type":"string","description":"Reservation ID."},"ReservationDateUtc":{"type":"string","description":"Reservation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"MaximumConfirmationDateUtc":{"type":"string","description":"Maximum confirmation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"Status":{"type":"integer","format":"int32","description":"Reservation status, meaning:\r\n\r\n- `0`: `NotCommitted`\r\n\r\n- `1`: `Authorized`\r\n\r\n- `2`: `Confirmed`\r\n\r\n- `3`: `Canceled_AbortedCommitted`\r\n\r\n- `4`: `Canceled_AuthorizationExpired`\r\n\r\n- `5`: `Canceled_Manually`"},"SlaRequest":{"type":"array","description":"SLA (Service Level Agreement) request information.","items":{"type":"object","description":"SLA details.","properties":{"item":{"type":"object","description":"Information about the reserved item.","properties":{"id":{"type":"string","description":"SKU ID."},"groupItemId":{"type":["string","null"],"description":"Group item ID."},"quantity":{"type":"integer","format":"int32","description":"Item quantity."},"price":{"type":"number","description":"Item price."},"modal":{"type":["string","null"],"description":"Type of [modal](https://help.vtex.com/en/tutorial/how-the-modal-works--tutorials_125), a special freight.","enum":["CHEMICALS","ELECTRONICS","FURNITURE","GLASS","LIQUID","MATTRESSES","REFRIGERATED","TIRES","WHITE_GOODS","FIREARMS"]},"additionalHandlingTime":{"type":"string","description":"Additional handling time in the format `DD.HH:MM:SS`."},"dimension":{"type":"object","description":"Item dimensions.","properties":{"weight":{"type":"number","description":"Item weight."},"height":{"type":"number","description":"Item height."},"width":{"type":"number","description":"Item width."},"length":{"type":"number","description":"Item length."},"maxSumDimension":{"type":"number","description":"Maximum sum of dimensions."}}},"kitItem":{"type":["array","null"],"items":{"type":"string","description":"Kit SKU ID."},"description":"[Kit](https://help.vtex.com/en/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) item information."},"unlimitedQuantity":{"type":"boolean","description":"When set as `false`, every sold unit decreases the item's available quantity. When set as `true`, the SKU from the warehouse is always available for sale — no matter how many units are sold, the SKU available quantity never decreases, and the SKU is never out of stock."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"wareHouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"provider":{"type":["string","null"],"description":"SLA request provider."}}},"slaType":{"type":"string","description":"SLA (Service Level Agreement) type."},"slaTypeName":{"type":"string","description":"SLA name."},"freightTableName":{"type":"string","description":"[Shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) name."},"freightTableId":{"type":"string","description":"Shipping rate template ID."},"listPrice":{"type":"number","description":"List price."},"promotionalPrice":{"type":"number","description":"Promotion price."},"timeToPresale":{"type":"string","description":"Time to presale in the format `D.HH:MM:SS`."},"transitTime":{"type":"string","description":"Transit time in the format `DD.HH:MM:SS`."},"dockTime":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`."},"timeToDockPlusDockTime":{"type":"string","description":"Time spent in loading dock plus `dockTime` in the format `D.HH:MM:SS`."},"totalTime":{"type":"string","description":"SLA total time in the format `DD.HH:MM:SS`."},"deliveryWindows":{"type":["object","null"],"items":{"type":"object","description":"Delivery window details.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"listPrice":{"type":"number","description":"List price."}}},"description":"[Delivery windows](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz)."},"wareHouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"kitReservation":{"type":["string","null"],"description":"Kit reservation."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"wmsEndPoint":{"type":["string","null"],"description":"Warehouse Management System (WMS) fulfillment endpoint."},"location":{"type":"object","description":"Shipping location information.","properties":{"zipCode":{"type":"string","description":"Shipping address postal code."},"country":{"type":"string","description":"Three-digit country code of the shipping address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"point":{"type":["array","null"],"description":"Location delivery point coordinates.","items":{"type":"number","description":"Location coordinates, first longitude, then latitude."}},"inStore":{"type":"object","description":"Information related to [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).","properties":{"IsCheckedIn":{"type":"boolean","description":"This field is set as `true` when the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) and `false` when it was not."},"StoreId":{"type":["string","null"],"description":"ID of purchases made in the GoCommerce context."}}}}},"pickupStoreInfo":{"type":["string","null"],"description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"deliveryOnWeekends":{"type":["boolean","null"],"description":"Defines if the delivery on weekends configuration is active (`true`) or not (`false`)."},"weekendAndHolidays":{"type":"object","description":"Delivery on weekends and holidays information.","properties":{"saturday":{"type":"boolean","description":"Defines if the delivery on Saturday configuration is active (`true`) or not (`false`)."},"sunday":{"type":"boolean","description":"Defines if the delivery on Sunday configuration is active (`true`) or not (`false`)."},"holiday":{"type":"boolean","description":"Defines if the delivery on [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configuration is active (`true`) or not (`false`)."}}},"estimateDate":{"type":"string","description":"Delivery estimate date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"totalTimePlusCarrierSchedule":{"type":"string","description":"Total shipping time plus carrier schedule, in the format `DD.HH:MM:SS`."},"polygonName":{"type":"string","description":"[Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) name."},"distanceLevel":{"type":["string","null"],"description":"SLA distance level."},"accountCarrier":{"type":"string","description":"Account carrier."},"dateOfSupplyUtc":{"type":["string","null"],"description":"Supply date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"supplyLotId":{"type":["string","null"],"description":"Supply lot ID."},"isExternal":{"type":"boolean","description":"Defines if the SLA request is external (`true`) or not (`false`)."}}}},"CanceledDateUtc":{"type":"string","description":"Reservation canceled date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"AuthorizedDateUtc":{"type":"string","description":"Authorized date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"ConfirmedDateUtc":{"type":"string","description":"Confirmed date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"Errors":{"type":["array","null"],"description":"Error details, if there are any.","items":{"type":["string","null"],"description":"Error message."}},"IsSucess":{"type":"boolean","description":"Defines if the reservation was successful (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists information about a [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92), searching by reservation ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reservationId` | path | (Required) [Reservation](https://help.vtex.com/en/tutorial/how-the-reservation-works--tutorials_92) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "LastUpdateDateUtc": "2024-05-01T17:14:51.5898912+00:00", + "SalesChannel": "1", + "LockId": "00-1336411707838-01", + "ReservationDateUtc": "2024-05-01T17:14:40.4900134+00:00", + "MaximumConfirmationDateUtc": "2024-06-13T17:14:40.4900134+00:00", + "Status": 2, + "SlaRequest": [ + { + "item": { + "id": "229", + "groupItemId": null, + "quantity": 1, + "price": 5, + "modal": "FURNITURE", + "additionalHandlingTime": "00:00:00", + "dimension": { + "weight": 186.37, + "height": 23.5, + "width": 165, + "length": 67.5, + "maxSumDimension": 300 + }, + "kitItem": [], + "unlimitedQuantity": false, + "dockId": "dk_temp", + "warehouseId": "wh_temp", + "provider": null + }, + "slaType": "delivery", + "slaTypeName": "Normal delivery", + "freightTableName": "Correios PAC", + "freightTableId": "11cc4b6", + "listPrice": 10.35, + "promotionalPrice": 10.35, + "timeToPresale": "00:00:00", + "transitTime": "1.00:00:00", + "dockTime": "00:00:00", + "timeToDockPlusDockTime": "00:00:00", + "totalTime": "1.00:00:00", + "deliveryWindows": { + "startDateUtc": "2024-02-25T09:00:00+00:00", + "endDateUtc": "2024-02-25T12:00:00+00:00", + "listPrice": 0 + }, + "wareHouseId": "wh_temp", + "kitReservation": null, + "dockId": "dk_temp", + "wmsEndPoint": null, + "location": { + "zipCode": "58039210", + "country": "BRA", + "point": [ + -34.82939147949219, + -7.115228652954102 + ], + "inStore": { + "isCheckedIn": false, + "storeId": "180082" + } + }, + "pickupStoreInfo": null, + "deliveryOnWeekends": true, + "weekendAndHolidays": { + "saturday": true, + "sunday": true, + "holiday": true + }, + "estimateDate": "2024-05-02T17:14:51.5742729+00:00", + "deliveryChannel": "delivery", + "totalTimePlusCarrierSchedule": "1.00:00:00", + "polygonName": "centerlRio", + "distanceLevel": null, + "accountCarrier": "recorrenciaqa", + "dateOfSupplyUtc": null, + "supplyLotId": null, + "isExternal": false + } + ], + "CanceledDateUtc": "0001-01-01T00:00:00+00:00", + "AuthorizedDateUtc": "2024-05-01T17:14:40.4900134+00:00", + "ConfirmedDateUtc": "2024-05-01T17:14:51.5898912+00:00", + "Errors": [], + "IsSucess": true + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by warehouse and SKU.yml b/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by warehouse and SKU.yml new file mode 100644 index 0000000000..0ed2884b82 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/List reservation by warehouse and SKU.yml @@ -0,0 +1,68 @@ +info: + name: List reservation by warehouse and SKU + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/inventory/reservations/:warehouseId/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: warehouseId + value: whs15hs6c + type: path + - name: skuId + value: "36" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/logistics/pvt/inventory/reservations/:warehouseId/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists information about [reservations](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92), searching by a given [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID and SKU ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `skuId` | path | (Required) SKU ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Reservations/folder.yml b/BrunoCollections/VTEX - Logistics API/Reservations/folder.yml new file mode 100644 index 0000000000..874c6fb6d4 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Reservations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Reservations + type: folder + seq: 8 diff --git a/BrunoCollections/VTEX - Logistics API/SLA/Calculate SLA.yml b/BrunoCollections/VTEX - Logistics API/SLA/Calculate SLA.yml new file mode 100644 index 0000000000..9503262bee --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/SLA/Calculate SLA.yml @@ -0,0 +1,143 @@ +info: + name: Calculate SLA + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/shipping/calculate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "items": [ + { + "id": "1", + "quantity": 1, + "price": 14128.9, + "modal": "FURNITURE", + "additionalHandlingTime": "00:00:00", + "dimension": { + "weight": 86.37, + "height": 23.5, + "width": 65, + "length": 67.5, + "maxSumDimension": 243.9 + }, + "kitItem": [ + { + "id": "2", + "kitItem": [ + "1" + ], + "quantity": 1, + "price": 1, + "additionalHandlingTime": "00:00:00", + "dimension": { + "weight": 1, + "height": 1, + "width": 1, + "length": 1, + "maxSumDimension": 5 + } + } + ], + "dockId": "1a8bce3", + "wareHouseId": "1937054" + } + ], + "location": { + "zipCode": "22780084", + "country": "BRA", + "point": [ + -43.23171615600586 + ], + "inStore": { + "IsCheckedIn": false, + "StoreId": "180082" + } + }, + "salesChannel": "1", + "deliveryChannel": "delivery" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics/pvt/shipping/calculate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/shipping/calculate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics/pvt/shipping/calculate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics/pvt/shipping/calculate - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"array","description":"List of Service Level Agreements (SLA).","items":{"type":"object","description":"Service Level Agreements (SLA) conditions.","properties":{"itemId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","format":"int32","description":"SKU quantity."},"kitItem":{"type":"array","description":"[Kit](https://help.vtex.com/en/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items' information.","items":{"type":"object","description":"Kit item object.","properties":{"id":{"type":"string","description":"Kit SKU ID."},"quantity":{"type":"integer","description":"Kit SKU quantity."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID where the kit SKU is stored."},"supplyLotId":{"type":["string","null"],"description":"Kit SKU supply lot ID."}}}},"availabilityQuantity":{"type":"integer","format":"int32","description":"SKU quantity available for sales. [Reserved](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) items do not count."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) valid for the SLA calculation."},"slaType":{"type":"string","description":"Service Level Agreement (SLA) type."},"slaTypeName":{"type":"string","description":"Service Level Agreement (SLA) name."},"freightTableName":{"type":"string","description":"[Shipping rate template](https://help.vtex.com/en/tutorial/shipping-rate-template--tutorials_127) name."},"freightTableId":{"type":"string","description":"Shipping rate template ID."},"listPrice":{"type":"number","description":"SKU list price."},"transitTime":{"type":"string","description":"Transit time in the format `DD.HH:MM:SS`."},"dockTime":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`."},"timeToDockPlusDockTime":{"type":"string","description":"Time spent in loading dock plus `dockTime` in the format `D.HH:MM:SS`."},"aditionalTimeBlockedDays":{"type":"string","description":"Additional time blocked in the format `DD.HH:MM:SS`."},"leadTime":{"type":"string","description":"[Lead time](https://help.vtex.com/en/tutorial/lead-time-shipping-time-at-sku-level--16yv5Mkj6bTyWR1hCN2f4B) is an optional time configuration for a SKU in a warehouse. It can be handling time, fabrication or how long it takes for the item to be available to be shipped to customers. The lead time is a part of the total shipping time and is considered for shipping date calculation. The format is `DD.HH:MM:SS`."},"totalTime":{"type":"string","description":"SLA total time in the format `DD.HH:MM:SS`."},"deliveryWindows":{"type":"array","description":"[Delivery windows](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz) configurations.","items":{"type":"object","description":"Delivery window details.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"listPrice":{"type":"number","description":"List price."}}}},"wareHouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"location":{"type":"object","description":"Shipping location information.","properties":{"zipCode":{"type":"string","description":"Shipping adress postal code."},"country":{"type":"string","description":"Three-digit country code of the shipping address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"point":{"type":["array","null"],"description":"Shipping address coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"inStore":{"type":"object","description":"Information related to [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc).","properties":{"isCheckedIn":{"type":"boolean","description":"This field is set as `true` when the order is placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) and `false` when it is not."},"storeId":{"type":["string","null"],"description":"ID of purchases made in the GoCommerce context."}}}}},"deliveryOnWeekends":{"type":"boolean","description":"Defines if the delivery on weekends configuration is active (`true`) or inactive (`false`)."},"weekendAndHolidays":{"type":["object","null"],"description":"Delivery on weekends and holidays information.","properties":{"saturday":{"type":"boolean","description":"Defines if the delivery on Saturday configuration is active (`true`) or inactive (`false`)."},"sunday":{"type":"boolean","description":"Defines if the delivery on Sunday configuration is active (`true`) or inactive (`false`)."},"holiday":{"type":"boolean","description":"Defines if the delivery on [holiday](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configuration is active (`true`) or inactive (`false`)."}}},"carrierSchedule":{"type":"array","description":"Schedule sent by the carrier.","items":{"type":"object","description":"Carrier schedule object.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week, from `0` (Sunday) to `6` (Saturday).","enum":[0,1,2,3,4,5,6]},"timeLimit":{"type":"string","description":"Time limit."}}}},"totalTimePlusCarrierSchedule":{"type":"string","description":"Total shipping time plus carrier schedule, in the format `DD.HH:MM:SS`."},"restrictedFreight":{"type":["array","null"],"description":"List of postal codes where the delivery is restricted for the carrier.","items":{"type":["string","null"],"description":"Restricted freight postal code."}},"coordinates":{"type":["array","null"],"description":"Shipping address geolocation coordinates, first longitude then latitude.","items":{"type":["number","null"],"description":"Longitude or latitude."}},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","properties":{"isPickupStore":{"type":["boolean","null"],"description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"storeId":{"type":["string","null"],"description":"Store ID for stores that acted as pickup points."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"object","description":"Information about the pickup point address country.","properties":{"acronym":{"type":"string","description":"Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"name":{"type":"string","description":"Country name of the pickup point address."}}},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":["string","null"],"description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference point."},"location":{"type":"object","description":"Pickup point address geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information about the delivery or the pickup point."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj related to the delivery or the pickup point ID."},"distance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address, measured as a straight line."},"businessHours":{"type":["string","null"],"description":"Pickup point business hours configurations."},"pickupHolidays":{"type":["string","null"],"description":"Holiday's configurations applicable to the pickup point."},"sellerId":{"type":["string","null"],"description":"Seller ID."},"isThirdPartyPickup":{"type":"boolean","description":"Defines if the pickup was third party (`true`) or not (`false`)."}}},"timeToPresale":{"type":"string","description":"Time to presale in the format `DD.HH:MM:SS`."},"deliveryChannel":{"type":"string","description":"Defines if the shipping type is `delivery` or `pickup`."},"availabilityQuantityByDeliveryChannel":{"type":"integer","description":"Availability and quantity by the given delivery channel."},"polygonName":{"type":"string","description":"[Polygon](https://help.vtex.com/en/tutorial/registering-geolocation--tutorials_138) ID (same as the polygon name)."},"distanceLevel":{"type":"string","description":"SLA distance level."},"accountCarrier":{"type":"string","description":"Account carrier."},"carrierBusinessHours":{"type":"array","description":"Carrier business hours configurations for the week.","items":{"type":"object","description":"Carrier business hours configurations for a day of the week.","properties":{"openingTime":{"type":"string","description":"Carrier opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Carrier closing time in `HH:MM:SS` format."},"dayOfWeek":{"type":"integer","description":"Day of the week, from `0` (Sunday) to `6` (Saturday).","enum":[0,1,2,3,4,5,6]}}}},"provider":{"type":["string","null"],"description":"Provider system."},"dateOfSupplyUtc":{"type":["string","null"],"description":"Supply date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"estimateDate":{"type":"string","description":"Delivery estimate date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`."},"supplyLotId":{"type":["string","null"],"description":"Supply lot ID."},"isExternal":{"type":"boolean","description":"Defines if the SLA request is external (`true`) or not (`false`)."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Checkout uses this endpoint to calculate a Service Level Agreement (SLA), a contract between the store and a customer about their order fulfillment conditions, such as the shipping estimated date. + + The calculation of the estimated date considers the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) and [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) related to the order. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Logistics API/SLA/folder.yml b/BrunoCollections/VTEX - Logistics API/SLA/folder.yml new file mode 100644 index 0000000000..6a412bbf46 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/SLA/folder.yml @@ -0,0 +1,4 @@ +info: + name: SLA + type: folder + seq: 9 diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Add blocked delivery windows.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Add blocked delivery windows.yml new file mode 100644 index 0000000000..cf71579657 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Add blocked delivery windows.yml @@ -0,0 +1,98 @@ +info: + name: Add blocked delivery windows + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/carriers/:carrierId/adddayofweekblocked" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: carrierId + value: carrier-123 + type: path + body: + type: json + data: 2025-12-09T08:00:00 + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/adddayofweekblocked - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/adddayofweekblocked - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/adddayofweekblocked - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/adddayofweekblocked - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds blocked delivery windows for your store's shipping policies. + + + >⚠️ While most of our API endpoints return time fields in UTC format, this endpoint returns time adjusted to the configured time zone of the account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics shipping full access** | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) [Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID (carrier ID). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Get capacity reservation usage by window.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Get capacity reservation usage by window.yml new file mode 100644 index 0000000000..d1c27dc635 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Get capacity reservation usage by window.yml @@ -0,0 +1,97 @@ +info: + name: Get capacity reservation usage by window + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/logistics-capacity/resources/carrier@{{capacityType}}@{{shippingPolicyId}}/time-frames/{{windowDay}}F{{windowStartTime}}T{{windowEndTime}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.availability.v1+json + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves capacity usage of a specific [scheduled delivery](https://help.vtex.com/en/tutorial/entrega-agendada--22g3HAVCGLFiU7xugShOBi) reservation window. + + + >⚠️ While most API endpoints return time fields in UTC format, this endpoint returns time adjusted to the configured time zone of the VTEX account. + + + > Note that the combined string `carrier@{capacityType}@{shippingPolicyId}` can be referred to as a "resource" in the API's messages. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2024-07-19F1300T1700", + "resourceId": "carrier@skus_quantity@168e017", + "startDate": "2024-07-19T13:00:00+00:00", + "endDate": "2024-07-26T17:00:59+00:00", + "ownMaxCapacity": 10, + "resourceMaxCapacity": 16, + "reservedValue": 6, + "reservations": [ + { + "id": "SLR-1379840726134-01", + "value": 4 + }, + { + "id": "SLR-1379840726341-01", + "value": 2 + } + ], + "log": [ + { + "when": "2024-07-20T15:56:09.1732357+00:00", + "who": "Daniel Thompson", + "why": "Reservation `SLR-1379840726134-01` with 4.0 units.", + "what": "Unblocked" + }, + { + "when": "2024-07-22T17:29:11.9250354+00:00", + "who": "Daniel Thompson", + "why": "Reservation `SLR-1379840726341-01` with 2.0 units.", + "what": "Unblocked" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Remove blocked delivery windows.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Remove blocked delivery windows.yml new file mode 100644 index 0000000000..572a013084 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Remove blocked delivery windows.yml @@ -0,0 +1,98 @@ +info: + name: Remove blocked delivery windows + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/carriers/:carrierId/removedayofweekblocked" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: carrierId + value: carrier-123 + type: path + body: + type: json + data: 2024-12-09T08:00:00 + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/removedayofweekblocked - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/removedayofweekblocked - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/removedayofweekblocked - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/logistics/pvt/configuration/carriers/:carrierId/removedayofweekblocked - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes blocked delivery windows configured for a shipping policy of your [shipping strategy](https://help.vtex.com/en/tutorial/shipping-strategy--58vLBDbjYVQzJ6rRc5QNz3). + + + >⚠️ While most of our endpoints return time values in UTC format, this endpoint returns time adjusted to the time zone set for the account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics shipping full access** | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) [Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID (carrier ID). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Retrieve blocked delivery windows.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Retrieve blocked delivery windows.yml new file mode 100644 index 0000000000..17867a5572 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Retrieve blocked delivery windows.yml @@ -0,0 +1,101 @@ +info: + name: Retrieve blocked delivery windows + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/carriers/:carrierId/getdayofweekblocked" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: carrierId + value: carrier-123 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/carriers/:carrierId/getdayofweekblocked - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/carriers/:carrierId/getdayofweekblocked - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/carriers/:carrierId/getdayofweekblocked - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/carriers/:carrierId/getdayofweekblocked - Schema is valid", function () { + const schema = {"type":"array","description":"List of blocked delivery windows date and time.","items":{"type":"string","description":"Blocked delivery windows date and time in the format `YYYY-MM-DDTHH:MM:SS`. The time zone is set according to the store account."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all blocked delivery windows of your store's shipping policies, searching by carrier ID. + + + >⚠️ While most of our API endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the configured time zone of the account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) [Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID (carrier ID). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "2024-12-09T08:00:00", + "2025-12-09T08:00:00" + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Search capacity reservations in time range.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Search capacity reservations in time range.yml new file mode 100644 index 0000000000..de0bc57f3c --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/Search capacity reservations in time range.yml @@ -0,0 +1,105 @@ +info: + name: Search capacity reservations in time range + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/logistics-capacity/resources/carrier@{{capacityType}}@{{shippingPolicyId}}/time-frames?rangeStart=2024-07-19&rangeEnd=2024-07-26" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.availability.v1+json + params: + - name: rangeStart + value: 2024-07-19 + type: query + - name: rangeEnd + value: 2024-07-26 + type: query + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of all [capacity reservations](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz) made to scheduled delivery windows in a given time range. + + >⚠️ While most of our API endpoints return time fields in UTC format, this endpoint returns time adjusted to the configured time zone of the VTEX account. + + + > Note that the combined string `carrier@{capacityType}@{shippingPolicyId}` can be referred to as a `resource` in request messages. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `rangeStart` | query | (Required) Starting date range in the format `YYYY-MM-DD`. | + | `rangeEnd` | query | (Required) Ending date range in the format `YYYY-MM-DD`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2024-07-19F1300T1700", + "resourceId": "carrier@skus_quantity@168e017", + "startDate": "2024-07-19T13:00:00+00:00", + "endDate": "2024-07-26T17:00:59+00:00", + "ownMaxCapacity": 10, + "resourceMaxCapacity": 16, + "reservedValue": 6, + "reservations": [ + { + "id": "SLR-1379840726134-01", + "value": 4 + }, + { + "id": "SLR-1379840726341-01", + "value": 2 + } + ], + "log": [ + { + "when": "2024-07-20T15:56:09.1732357+00:00", + "who": "Daniel Thompson", + "why": "Reservation `SLR-1379840726134-01` with 4.0 units.", + "what": "Unblocked" + }, + { + "when": "2024-07-22T17:29:11.9250354+00:00", + "who": "Daniel Thompson", + "why": "Reservation `SLR-1379840726341-01` with 2.0 units.", + "what": "Unblocked" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Scheduled delivery/folder.yml b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/folder.yml new file mode 100644 index 0000000000..fae76e2d34 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Scheduled delivery/folder.yml @@ -0,0 +1,4 @@ +info: + name: Scheduled delivery + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/Create shipping policy.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/Create shipping policy.yml new file mode 100644 index 0000000000..616be53218 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/Create shipping policy.yml @@ -0,0 +1,141 @@ +info: + name: Create shipping policy + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/shipping-policies" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "id": "123", + "name": "Normal", + "shippingMethod": "Normal", + "weekendAndHolidays": { + "saturday": false, + "sunday": false, + "holiday": false + }, + "maxDimension": { + "largestMeasure": 0, + "maxMeasureSum": 0 + }, + "numberOfItemsPerShipment": 5, + "minimumValueAceptable": 0, + "maximumValueAceptable": 0, + "deliveryScheduleSettings": { + "useDeliverySchedule": true, + "maxRangeDelivery": 0, + "dayOfWeekForDelivery": [ + { + "dayOfWeek": 2, + "deliveryRanges": [ + { + "startTime": "11:00:00", + "endTime": "12:30:00", + "listPrice": 0, + "deliveryCapacity": [ + { + "capacityType": "ORDERS_QUANTITY", + "maxValue": 55 + } + ] + } + ] + } + ] + }, + "carrierSchedule": [ + { + "dayOfWeek": 0, + "timeLimit": "time_limit" + } + ], + "cubicWeightSettings": { + "volumetricFactor": 3, + "minimunAcceptableVolumetricWeight": 5 + }, + "modalSettings": { + "modals": [ + "ELECTRONICS" + ], + "useOnlyItemsWithDefinedModal": false + }, + "businessHourSettings": { + "carrierBusinessHours": [ + { + "openingTime": "00:00:00", + "closingTime": "23:59:59", + "dayOfWeek": 1 + } + ], + "isOpenOutsideBusinessHours": true + }, + "pickupPointsSettings": { + "pickupPointIds": [ + "Id1" + ], + "pickupPointTags": [ + "Tag1" + ], + "sellers": [ + "Seller1" + ] + }, + "isActive": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/shipping-policies - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Configure a new [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) for your store. + + >⚠️ While most endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the time zone configured for the VTEX account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/Delete shipping policy by ID.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/Delete shipping policy by ID.yml new file mode 100644 index 0000000000..038754614b --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/Delete shipping policy by ID.yml @@ -0,0 +1,66 @@ +info: + name: Delete shipping policy by ID + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/shipping-policies/:id" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: id + value: id + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/logistics/pvt/shipping-policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) of your store, searching by shipping policy ID. + + >⚠️ While most endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the time zone configured for the VTEX account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) ID of the shipping policy. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/List shipping policies.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/List shipping policies.yml new file mode 100644 index 0000000000..3f46dc894e --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/List shipping policies.yml @@ -0,0 +1,101 @@ +info: + name: List shipping policies + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/shipping-policies" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: page + value: "1" + type: query + disabled: true + - name: perPage + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/shipping-policies - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/shipping-policies - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/shipping-policies - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/shipping-policies - Schema is valid", function () { + const schema = {"type":"object","description":"Paged shipping policies list.","properties":{"items":{"type":"array","description":"List of shipping policies related to the account.","items":{"type":"object","description":"Details about a given shipping policy.","properties":{"id":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID."},"name":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) name."},"shippingMethod":{"type":"string","description":"Type of shipping available for this shipping policy (carrier). Options are shown on [shipping simulation](https://help.vtex.com/en/tutorial/shipping-simulation--tutorials_144)."},"weekendAndHolidays":{"type":"object","description":"If the shipping policy includes deliveries on weekends and holidays.","properties":{"saturday":{"type":"boolean","description":"Defines if shipping on Saturdays is valid (`true`) or not (`false`)."},"sunday":{"type":"boolean","description":"Defines if shipping on Sundays is valid (`true`) or not (`false`)."},"holiday":{"type":"boolean","description":"Defines if shipping on holidays is valid (`true`) or not (`false`)."}}},"maxDimension":{"type":"object","description":"Object containing attributes of maximum dimension permitted by the shipping policy (carrier).","properties":{"largestMeasure":{"type":"number","description":"Largest measure acceptable of the package."},"maxMeasureSum":{"type":"number","description":"Limit for the sum of all maximum measures of the package."}}},"numberOfItemsPerShipment":{"type":"integer","description":"Determines the number of items allowed per shipment."},"minimumValueAceptable":{"type":"number","description":"Minimum value accepted by the carrier for delivering."},"maximumValueAceptable":{"type":"number","description":"Maximum value accepted by the carrier for delivering."},"additionalTime":{"type":"string","description":"Additional time configured in `HH:MM:SS` format."},"additionalPrice":{"type":"object","description":"Additional price object.","properties":{"method":{"type":"integer","description":"Additional price method."},"value":{"type":"number","description":"Payment value."}}},"deliveryScheduleSettings":{"type":"object","description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) settings.","properties":{"useDeliverySchedule":{"type":"boolean","description":"Defines if the scheduled delivery configuration is active (`true`) or not (`false`)."},"maxRangeDelivery":{"type":"number","description":"Range of days available within a delivery window, for the customer to choose the scheduled delivery. For example, if the configured `maxRangeDelivery` is equal `7`, and the customer buys something on a Tuesday, the options for scheduled delivery will be shown until the following Tuesday (7 days from the purchase day). If no options are available within the `maxRangeDelivery` set, the shipping policy will not be shown on the checkout."},"dayOfWeekForDelivery":{"type":"array","description":"Selected days for delivery, from `0` (Sunday) to `6` (Saturday).","items":{"type":"object","description":"Selected days for delivery objects.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week, from `0` (Sunday) to `6` (Saturday)."},"deliveryRanges":{"type":"array","description":"Reservation window for scheduled delivery.","items":{"type":"object","description":"Reservation window for scheduled delivery object.","properties":{"startTime":{"type":"string","description":"Start time for day of the week in `hh:mm:ss` format."},"endTime":{"type":"string","description":"End time for day of the week in `hh:mm:ss` format."},"listPrice":{"type":"number","description":"List price for day of the week."},"deliveryCapacity":{"type":["array","null"],"description":"Sets maximum [delivery capacity](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz) for a given reservation window for scheduled delivery.","items":{"type":"object","description":"Object with the maximum delivery capacity for a reservation window.","properties":{"capacityType":{"type":"string","description":"Defines how the delivery capacity is measured for this reservation window, by maximum number of orders (`ORDERS_QUANTITY`) or items (`SKUS_QUANTITY`)."},"maxValue":{"type":"number","description":"Maximum number of orders or SKUs that the store is capable of fulfilling."}}}}}}}}}},"dayOfWeekBlockeds":{"type":["array","null"],"description":"Defines if there are any days of the week that are blocked.","items":{"type":"string","description":"Date and time of the blocked day in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss`."}}}},"carrierSchedule":{"type":"array","description":"Schedule sent by the carrier to configure the shipping policy.","items":{"type":"object","description":"Carrier schedule for configuring the shipping policy object.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday)."},"timeLimit":{"type":"string","description":"Time limit in `HH:MM:SS` format."}}}},"cubicWeightSettings":{"type":"object","description":"Settings for the cubic weight of a package, which accounts for the [package's volume](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128), and not only weight.","properties":{"volumetricFactor":{"type":"number","description":"Factor that will be used on the cubic weight calculation, usually given by the carrier."},"minimunAcceptableVolumetricWeight":{"type":"number","description":"Packages' minimum acceptable [volumetric weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."}}},"modalSettings":{"type":"object","description":"Configurations for the [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125), which is the attachement of a specific product to a carrier specialized in delivering that type of product.","properties":{"modals":{"type":"array","description":"Type of special freight.","items":{"type":"string","enum":["CHEMICALS","ELECTRONICS","FURNITURE","GLASS","LIQUID","MATTRESSES","REFRIGERATED","TIRES","WHITE_GOODS","FIREARMS"],"description":"Modal values assigned to the special freight."}},"useOnlyItemsWithDefinedModal":{"type":"boolean","description":"When set as `true`, the modal's configurations will apply only for items with a defined modal, when `false`, the modal configuration will not be set."}}},"businessHourSettings":{"type":"object","description":"Business hours configurations.","properties":{"carrierBusinessHours":{"type":"array","description":"Business hours configurations array for the days of the week.","items":{"type":"object","description":"Business hours configurations for a single day of the week.","properties":{"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."},"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday).","enum":[0,1,2,3,4,5,6]}}}},"isOpenOutsideBusinessHours":{"type":"boolean","description":"Defines if deliveries outside business hours are allowed (`true`) or not (`false`)."}}},"pickupPointsSettings":{"type":"object","description":"[Pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) configurations of the shipping policy.","properties":{"pickupPointIds":{"type":"array","description":"Pickup point IDs configured for the shipping policy.","items":{"type":"string","description":"Pickup point ID."}},"pickupPointTags":{"type":"array","description":"Pickup points tags configured for the shipping policy.","items":{"type":"string","description":"Tag identification."}},"sellers":{"type":"array","description":"Sellers associated with [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the shipping policy.","items":{"type":"string","description":"Sellers IDS."}}}},"processingStatus":{"type":"object","description":"Shipping policy processing status.","properties":{"status":{"type":"integer","format":"int32","description":"Shipping policy processing status code."},"errorMessage":{"type":["string","null"],"description":"Error message, when applicable."},"errorsMetadata":{"type":["string","null"],"description":"Error metadata, when applicable."}}},"deliveryChannel":{"type":"string","description":"Defines if the shipping type is `delivery` or `pickup`."},"calculationType":{"type":"integer","description":"Shipping policy calculation type."},"isActive":{"type":"boolean","description":"Defines if the shipping policy is active (`true`) or not (`false`)."},"lastIndexedAt":{"type":["string","null"],"description":"Date and time since the last [indexing](https://help.vtex.com/en/tutorial/understanding-how-indexation-works--tutorials_256), in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."},"shippingHoursSettings":{"type":"object","description":"Shipping hours settings configurations.","properties":{"shippingHours":{"type":"array","description":"Shipping hours settings array.","items":{"type":"object","description":"Object with details on shipping hours settings.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday)."},"openingTime":{"type":"string","description":"Opening time in `hh:mm:ss` format."},"closingTime":{"type":"string","description":"Closing time in `hh:mm:ss` format."}}}},"acceptOrdersOutsideShippingHours":{"type":"boolean","description":"Defines if the configuration that allows accepting orders outside shipping hours is active (`true`) or not (`false`)."}}},"carrierInfo":{"type":"object","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) information.","properties":{"carrierAccountName":{"type":"string","description":"VTEX store account name related to the shipping policy."},"deliveryAgreementId":{"type":["string","null"],"description":"Delivery agreement ID."},"linkedDocks":{"type":"array","description":"Shipping policy [loading docks](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) valid for the carrier.","items":{"type":"object","description":"Loading dock object.","properties":{"id":{"type":"string","description":"Loading dock ID."},"name":{"type":"string","description":"Loading dock name."}}}},"readyToUse":{"type":"boolean","description":"Defines if shipping configurations related to the carrier make them ready for shipping (`true`) or not (`false`)."}}}}}},"paging":{"type":"object","description":"Pagination information.","properties":{"page":{"type":"integer","description":"Number of the current page of the response. By default, it returns page `1`."},"perPage":{"type":"integer","description":"Number of shipping policies per page."},"total":{"type":"integer","description":"Total number of existing shipping policies."},"pages":{"type":"integer","description":"Total number of pages, considering all shipping policies."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all [shipping policies](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) from your store. + + >⚠️ While most endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the time zone configured for the VTEX account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | query | Number of the starting page of the response. When no value is sent, it starts in page `1`. | + | `perPage` | query | Desired number of items per page, to retrieve information from your shipping policies. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 5 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/Retrieve shipping policy by ID.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/Retrieve shipping policy by ID.yml new file mode 100644 index 0000000000..f1d4328b63 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/Retrieve shipping policy by ID.yml @@ -0,0 +1,95 @@ +info: + name: Retrieve shipping policy by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/shipping-policies/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: sp12 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/shipping-policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/shipping-policies/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/shipping-policies/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/shipping-policies/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Details about a given shipping policy.","properties":{"id":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID."},"name":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) name."},"shippingMethod":{"type":"string","description":"Type of shipping available for this shipping policy (carrier). Options are shown on [shipping simulation](https://help.vtex.com/en/tutorial/shipping-simulation--tutorials_144)."},"weekendAndHolidays":{"type":"object","description":"If the shipping policy includes deliveries on weekends and holidays.","properties":{"saturday":{"type":"boolean","description":"Defines if shipping on Saturdays is valid (`true`) or not (`false`)."},"sunday":{"type":"boolean","description":"Defines if shipping on Sundays is valid (`true`) or not (`false`)."},"holiday":{"type":"boolean","description":"Defines if shipping on holidays is valid (`true`) or not (`false`)."}}},"maxDimension":{"type":"object","description":"Object containing attributes of maximum dimension permitted by the shipping policy (carrier).","properties":{"largestMeasure":{"type":"number","description":"Largest measure acceptable of the package."},"maxMeasureSum":{"type":"number","description":"Limit for the sum of all maximum measures of the package."}}},"numberOfItemsPerShipment":{"type":"integer","description":"Determines the number of items allowed per shipment."},"minimumValueAceptable":{"type":"number","description":"Minimum value accepted by the carrier for delivering."},"maximumValueAceptable":{"type":"number","description":"Maximum value accepted by the carrier for delivering."},"additionalTime":{"type":"string","description":"Additional time configured in `HH:MM:SS` format."},"additionalPrice":{"type":"object","description":"Additional price object.","properties":{"method":{"type":"integer","description":"Additional price method."},"value":{"type":"number","description":"Payment value."}}},"deliveryScheduleSettings":{"type":"object","description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) settings.","properties":{"useDeliverySchedule":{"type":"boolean","description":"Defines if the scheduled delivery configuration is active (`true`) or not (`false`)."},"maxRangeDelivery":{"type":"number","description":"Range of days available within a delivery window, for the customer to choose the scheduled delivery. For example, if the configured `maxRangeDelivery` is equal `7`, and the customer buys something on a Tuesday, the options for scheduled delivery will be shown until the following Tuesday (7 days from the purchase day). If no options are available within the `maxRangeDelivery` set, the shipping policy will not be shown on the checkout."},"dayOfWeekForDelivery":{"type":"array","description":"Selected days for delivery, from `0` (Sunday) to `6` (Saturday).","items":{"type":"object","description":"Selected days for delivery objects.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week, from `0` (Sunday) to `6` (Saturday)."},"deliveryRanges":{"type":"array","description":"Reservation window for scheduled delivery.","items":{"type":"object","description":"Reservation window for scheduled delivery object.","properties":{"startTime":{"type":"string","description":"Start time for day of the week in `hh:mm:ss` format."},"endTime":{"type":"string","description":"End time for day of the week in `hh:mm:ss` format."},"listPrice":{"type":"number","description":"List price for day of the week."},"deliveryCapacity":{"type":["array","null"],"description":"Sets maximum [delivery capacity](https://help.vtex.com/en/tutorial/managing-delivery-capacity--2y217FQZCjD0I1n62yxVcz) for a given reservation window for scheduled delivery.","items":{"type":"object","description":"Object with the maximum delivery capacity for a reservation window.","properties":{"capacityType":{"type":"string","description":"Defines how the delivery capacity is measured for this reservation window, by maximum number of orders (`ORDERS_QUANTITY`) or items (`SKUS_QUANTITY`)."},"maxValue":{"type":"number","description":"Maximum number of orders or SKUs that the store is capable of fulfilling."}}}}}}}}}},"dayOfWeekBlockeds":{"type":["array","null"],"description":"Defines if there are any days of the week that are blocked.","items":{"type":"string","description":"Date and time of the blocked day in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss`."}}}},"carrierSchedule":{"type":"array","description":"Schedule sent by the carrier to configure the shipping policy.","items":{"type":"object","description":"Carrier schedule for configuring the shipping policy object.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday)."},"timeLimit":{"type":"string","description":"Time limit in `HH:MM:SS` format."}}}},"cubicWeightSettings":{"type":"object","description":"Settings for the cubic weight of a package, which accounts for the [package's volume](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128), and not only weight.","properties":{"volumetricFactor":{"type":"number","description":"Factor that will be used on the cubic weight calculation, usually given by the carrier."},"minimunAcceptableVolumetricWeight":{"type":"number","description":"Packages' minimum acceptable [volumetric weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)."}}},"modalSettings":{"type":"object","description":"Configurations for the [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125), which is the attachement of a specific product to a carrier specialized in delivering that type of product.","properties":{"modals":{"type":"array","description":"Type of special freight.","items":{"type":"string","enum":["CHEMICALS","ELECTRONICS","FURNITURE","GLASS","LIQUID","MATTRESSES","REFRIGERATED","TIRES","WHITE_GOODS","FIREARMS"],"description":"Modal values assigned to the special freight."}},"useOnlyItemsWithDefinedModal":{"type":"boolean","description":"When set as `true`, the modal's configurations will apply only for items with a defined modal, when `false`, the modal configuration will not be set."}}},"businessHourSettings":{"type":"object","description":"Business hours configurations.","properties":{"carrierBusinessHours":{"type":"array","description":"Business hours configurations array for the days of the week.","items":{"type":"object","description":"Business hours configurations for a single day of the week.","properties":{"openingTime":{"type":"string","description":"Opening time in `HH:MM:SS` format."},"closingTime":{"type":"string","description":"Closing time in `HH:MM:SS` format."},"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday).","enum":[0,1,2,3,4,5,6]}}}},"isOpenOutsideBusinessHours":{"type":"boolean","description":"Defines if deliveries outside business hours are allowed (`true`) or not (`false`)."}}},"pickupPointsSettings":{"type":"object","description":"[Pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) configurations of the shipping policy.","properties":{"pickupPointIds":{"type":"array","description":"Pickup point IDs configured for the shipping policy.","items":{"type":"string","description":"Pickup point ID."}},"pickupPointTags":{"type":"array","description":"Pickup points tags configured for the shipping policy.","items":{"type":"string","description":"Tag identification."}},"sellers":{"type":"array","description":"Sellers associated with [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the shipping policy.","items":{"type":"string","description":"Sellers IDS."}}}},"processingStatus":{"type":"object","description":"Shipping policy processing status.","properties":{"status":{"type":"integer","format":"int32","description":"Shipping policy processing status code."},"errorMessage":{"type":["string","null"],"description":"Error message, when applicable."},"errorsMetadata":{"type":["string","null"],"description":"Error metadata, when applicable."}}},"deliveryChannel":{"type":"string","description":"Defines if the shipping type is `delivery` or `pickup`."},"calculationType":{"type":"integer","description":"Shipping policy calculation type."},"isActive":{"type":"boolean","description":"Defines if the shipping policy is active (`true`) or not (`false`)."},"lastIndexedAt":{"type":["string","null"],"description":"Date and time since the last [indexing](https://help.vtex.com/en/tutorial/understanding-how-indexation-works--tutorials_256), in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."},"shippingHoursSettings":{"type":"object","description":"Shipping hours settings configurations.","properties":{"shippingHours":{"type":"array","description":"Shipping hours settings array.","items":{"type":"object","description":"Object with details on shipping hours settings.","properties":{"dayOfWeek":{"type":"integer","description":"Day of the week from `0` (Sunday) to `6` (Saturday)."},"openingTime":{"type":"string","description":"Opening time in `hh:mm:ss` format."},"closingTime":{"type":"string","description":"Closing time in `hh:mm:ss` format."}}}},"acceptOrdersOutsideShippingHours":{"type":"boolean","description":"Defines if the configuration that allows accepting orders outside shipping hours is active (`true`) or not (`false`)."}}},"carrierInfo":{"type":"object","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) information.","properties":{"carrierAccountName":{"type":"string","description":"VTEX store account name related to the shipping policy."},"deliveryAgreementId":{"type":["string","null"],"description":"Delivery agreement ID."},"linkedDocks":{"type":"array","description":"Shipping policy [loading docks](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) valid for the carrier.","items":{"type":"object","description":"Loading dock object.","properties":{"id":{"type":"string","description":"Loading dock ID."},"name":{"type":"string","description":"Loading dock name."}}}},"readyToUse":{"type":"boolean","description":"Defines if shipping configurations related to the carrier make them ready for shipping (`true`) or not (`false`)."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information from a [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) from your store, searching by shipping policy ID. + + >⚠️ While most endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the time zone configured for the VTEX account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/Update shipping policy by ID.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/Update shipping policy by ID.yml new file mode 100644 index 0000000000..0e77250db4 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/Update shipping policy by ID.yml @@ -0,0 +1,111 @@ +info: + name: Update shipping policy by ID + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/logistics/pvt/shipping-policies/:id" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: id + value: shippingpolicyid1 + type: path + body: + type: json + data: |- + { + "name": "Correios PAC", + "shippingMethod": "Normal", + "deliveryOnWeekends": false, + "maxDimension": { + "largestMeasure": 0, + "maxMeasureSum": 0 + }, + "cubicWeightSettings": { + "volumetricFactor": 0.2, + "minimunAcceptableVolumetricWeight": 0 + }, + "modalSettings": { + "modals": [ + "LIQUID" + ], + "useOnlyItemsWithDefinedModal": false + }, + "isActive": true, + "deliveryScheduleSettings": { + "useDeliverySchedule": true, + "maxRangeDelivery": 0, + "dayOfWeekForDelivery": [ + { + "dayOfWeek": 2, + "deliveryRanges": [ + { + "startTime": "11:00:00", + "endTime": "12:30:00", + "listPrice": 0, + "deliveryCapacity": [ + { + "capacityType": "ORDERS_QUANTITY", + "maxValue": 0 + } + ] + } + ] + } + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/logistics/pvt/shipping-policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information about a [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) of your store, searching by shipping policy ID. + + >⚠️ While most endpoints return time fields in UTC format, this endpoint returns **Scheduled Delivery** related time fields adjusted to the time zone configured for the VTEX account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics shipping full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics shipping full access | + | OMS - Full access | Logistics shipping full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Shipping policy ID. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Shipping policies/folder.yml b/BrunoCollections/VTEX - Logistics API/Shipping policies/folder.yml new file mode 100644 index 0000000000..e0d4e4b215 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Shipping policies/folder.yml @@ -0,0 +1,4 @@ +info: + name: Shipping policies + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/Activate warehouse.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/Activate warehouse.yml new file mode 100644 index 0000000000..918a10350f --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/Activate warehouse.yml @@ -0,0 +1,61 @@ +info: + name: Activate warehouse + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses/:warehouseId/activation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: warehouseId + value: warehouse_68d7 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/warehouses/:warehouseId/activation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Activates a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb), searching by warehouse ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/Create or update warehouse.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/Create or update warehouse.yml new file mode 100644 index 0000000000..08691af4c7 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/Create or update warehouse.yml @@ -0,0 +1,75 @@ +info: + name: Create or update warehouse + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "id": "15bfc76", + "name": "Main warehouse", + "warehouseDocks": [ + { + "dockId": "1a8bce3", + "name": "Central dock", + "time": "3.00:00:00", + "cost": "5.00", + "translateDays": "days", + "costToDisplay": "5,00" + } + ], + "priority": 0, + "isActive": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/warehouses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/Deactivate warehouse.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/Deactivate warehouse.yml new file mode 100644 index 0000000000..02c4b7e8e3 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/Deactivate warehouse.yml @@ -0,0 +1,61 @@ +info: + name: Deactivate warehouse + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses/:warehouseId/deactivation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: warehouseId + value: warehouse_68d7 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/logistics/pvt/configuration/warehouses/:warehouseId/deactivation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deactivates a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb), searching by warehouse ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/List all warehouses.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/List all warehouses.yml new file mode 100644 index 0000000000..a3393af724 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/List all warehouses.yml @@ -0,0 +1,124 @@ +info: + name: List all warehouses + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/warehouses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Each object contains details about a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb).","properties":{"id":{"type":"string","description":"Warehouse ID."},"name":{"type":"string","description":"Warehouse name."},"warehouseDocks":{"type":"array","description":"List of [loading docks](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) related to the warehouse.","items":{"type":"object","description":"Loading dock information.","properties":{"dockId":{"type":"string","description":"Loading dock ID."},"time":{"type":"string","description":"Loading dock processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`."},"cost":{"type":"number","description":"Extra charges added to the shipping rate when **Additional shipping costs** are configured."}}}},"pickupPointIds":{"type":"array","description":"List of [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) associated with the warehouse.","items":{"type":"string","description":"Pickup point ID."}},"priority":{"type":"integer","description":"Warehouse priority. When no priority was set, it corresponds to `0`."},"isActive":{"type":"boolean","description":"Shows if the warehouse is active (`true`) or inactive (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all [warehouses](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) set up in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "1937054", + "name": "Main warehouse", + "warehouseDocks": [ + { + "dockId": "1_1_1", + "time": "1.00:00:00", + "cost": 0 + } + ], + "pickupPointIds": [ + "345", + "136", + "189" + ], + "priority": 0, + "isActive": true + }, + { + "id": "140ac66", + "name": "Warehouse B", + "warehouseDocks": [ + { + "dockId": "139270d", + "time": "00:00:00", + "cost": 0 + } + ], + "pickupPointIds": [ + "145", + "412", + "221" + ], + "priority": 0, + "isActive": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/List warehouse by ID.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/List warehouse by ID.yml new file mode 100644 index 0000000000..3076fa40f8 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/List warehouse by ID.yml @@ -0,0 +1,109 @@ +info: + name: List warehouse by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses/:warehouseId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: warehouseId + value: warehouse_68d7 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/logistics/pvt/configuration/warehouses/:warehouseId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses/:warehouseId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses/:warehouseId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/logistics/pvt/configuration/warehouses/:warehouseId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"name":{"type":"string","description":"Warehouse name."},"warehouseDocks":{"type":"array","description":"List of [loading docks](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) related to the warehouse.","items":{"type":"object","description":"Loading dock information.","properties":{"dockId":{"type":"string","description":"Loading dock ID."},"time":{"type":"string","description":"Loading dock processing time in the format `D.HH:MM:SS`. When it was not configured, it returns `00:00:00`."},"cost":{"type":"number","description":"Extra charges added to the shipping rate when **Additional shipping costs** are configured."}}}},"pickupPointIds":{"type":"array","description":"List of [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) associated with the warehouse.","items":{"type":"string","description":"Pickup point ID."}},"priority":{"type":"integer","description":"Warehouse priority. When no priority was set, it corresponds to `0`."},"isActive":{"type":"boolean","description":"Shows if the warehouse is active (`true`) or inactive (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb), searching by warehouse ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + | Logistics | Logistics access | **Logistics viewer** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + | Logistics - Full access | Logistics viewer | + | Logistics - Read only | Logistics viewer | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "15bfc76", + "name": "Main warehouse", + "warehouseDocks": [ + { + "dockId": "1a8bce3", + "time": "3.00:00:00", + "cost": 5 + } + ], + "pickupPointIds": [ + "345", + "136", + "189" + ], + "priority": 0, + "isActive": true + } + ``` diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/Remove warehouse.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/Remove warehouse.yml new file mode 100644 index 0000000000..9c48a8d85e --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/Remove warehouse.yml @@ -0,0 +1,61 @@ +info: + name: Remove warehouse + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/logistics/pvt/configuration/warehouses/:warehouseId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: warehouseId + value: warehouse_68d7 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/logistics/pvt/configuration/warehouses/:warehouseId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a [warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb), searching by warehouse ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Logistics - Full access | Logistics full access | + | OMS - Full access | Logistics full access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `warehouseId` | path | (Required) [Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Logistics API/Warehouses/folder.yml b/BrunoCollections/VTEX - Logistics API/Warehouses/folder.yml new file mode 100644 index 0000000000..af8368ba88 --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/Warehouses/folder.yml @@ -0,0 +1,4 @@ +info: + name: Warehouses + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Logistics API/environments/VTEX.yml b/BrunoCollections/VTEX - Logistics API/environments/VTEX.yml new file mode 100644 index 0000000000..f9d194bccf --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/environments/VTEX.yml @@ -0,0 +1,20 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - name: capacityType + value: orders_quantity + - name: shippingPolicyId + value: "168e017" + - name: windowDay + value: 2024-07-19 + - name: windowStartTime + value: "1030" + - name: windowEndTime + value: "1159" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Logistics API/opencollection.yml b/BrunoCollections/VTEX - Logistics API/opencollection.yml new file mode 100644 index 0000000000..f824e0a3df --- /dev/null +++ b/BrunoCollections/VTEX - Logistics API/opencollection.yml @@ -0,0 +1,32 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Logistics API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [Logistics or fulfillment](https://help.vtex.com/en/tutorial/logistics--53udnvI5eBy8DKo8FOjMoP) is the process of planning and executing the transportation, storage of merchandise, and shipping orders to customers. You can accomplish all of this with the VTEX platform, which allows you to manage your inventory, shipping rates, pickup points and more. + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Activate Feed.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Activate Feed.yml new file mode 100644 index 0000000000..387132f73d --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Activate Feed.yml @@ -0,0 +1,98 @@ +info: + name: Activate Feed + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/sent-offers/feeds?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "id": "{{feedId}}", + "affiliateId": "MKP", + "salesChannels": "5" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/sent-offers/feeds - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sent-offers/feeds - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/sent-offers/feeds - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/sent-offers/feeds - Schema is valid", function () { + const schema = {"type":"object","title":"CreateFeed","example":{"account":"grocery1","id":"vtex.meli-classic","affiliateId":"MDC","salesChannel":"4"},"properties":{"account":{"type":"string","description":"Seller's account name."},"id":{"type":"string","description":"Channel's ID."},"affiliateId":{"type":"string","description":"Corresponds to the 3-digit [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code created by the seller.","default":"MKP"},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/como-funciona-uma-politica-comercial--6Xef8PZiFm40kg2STrMkMV)) associated to the seller account created."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/docs/guides/sent-offers-integration-guide-connectors), after [creating the channel](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/channels), the next step is to create a feed, which is a list updated nearly in real time with information about the seller's offers sent to the marketplace. + + This endpoint allows the creation of a feed so that the seller's sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) is connected to the marketplace. Feeds are nearly real time updated with content provided by the marketplace and VTEX modules. + + This endpoint should only be used once, to activate the channel and establish the connection. However, after a [feed is deactivated](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#delete-/api/sent-offers/feeds/-feedId-), in order to activate it again it will be necessary another call to this endpoint.The integration starts with the creation of the Feed. This endpoint is used to establish the connection between connector and seller through the Sent Offers. + + The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when calling this endpoint. It follows the pattern `vendor.channel`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "account": "grocery1", + "id": "vtex.meli-classic", + "affiliateId": "MDC", + "salesChannel": "4" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Close Interaction.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Close Interaction.yml new file mode 100644 index 0000000000..4f54167de5 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Close Interaction.yml @@ -0,0 +1,70 @@ +info: + name: Close Interaction + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/close?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: skuId + value: "1234" + type: path + - name: interactionId + value: d3rdjjf094ma0do + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/close - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/close - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), VTEX platform and marketplaces interact with offers through a medium called [interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions). + + Once an interaction has fulfilled its initial goal and there are no more actions (or [logs](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions/-interactionId-/logs)) taking place within it, this endpoint closes an interaction. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `skuId` | path | (Required) This attribute is the SKU ID in the seller's perspective, registered in their VTEX Catalog. | + | `interactionId` | path | (Required) This attribute is the code used to identify an existing interaction. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Channel.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Channel.yml new file mode 100644 index 0000000000..7fa66e8b89 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Channel.yml @@ -0,0 +1,99 @@ +info: + name: Create Channel + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/sent-offers/channels?an=accountName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: accountName + type: query + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "vendor": "vtex", + "name": "Amazon", + "logo": "https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/madeiramadeira.png" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/sent-offers/channels - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sent-offers/channels - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/sent-offers/channels - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/sent-offers/channels - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"The `feedId` attribute created by the connector that will identify sellers’ feeds with a channel. The `feedId` is always the same for the relation between sellers and channels, but connectors can create more than one `feedId` with a single marketplace, depending on their business rules. The `feedId` follows the standardized pattern `vendor.channel`.","default":"vtex.amazon"},"vendor":{"type":"string","description":"Name of the connector making the integration.","default":"vtex"},"name":{"type":"string","description":"Name of the channel with which the integration is being established.","default":"Amazon"},"logo":{"type":"string","description":"URL redirecting to the image file of the graphic symbol that identifies the marketplace. The file must in PNG format, and the image's dimension should be 300x300 pixels.","default":"https://marketplace.com/logos/logo.png"}},"title":"CreateChannel","example":{"id":"vtex.amazon","vendor":"vtex","name":"Amazon","logo":"https://marketplace.com/logos/logo.png"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + The first step for connectors to integrate with [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors) is to create a channel, that represents the marketplace to where sellers will send their offers. + + This endpoint creates a channel and the integration developers should call it once for each marketplace. The information about the marketplace sent in the request will be shown to sellers in their [Offer Management UI](https://help.vtex.com/en/tutorial/offers-listing--7MRb9S78aBdZjFGpbuffpE). + + The `feedId` created by this call will apply to all sellers connected to the given channel, and will be necessary for the next step of the integration flow, which is to [activate feed](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds). + + >ℹ + > Offer Management is available for integrations with [Mercado Livre (Classic and Premium)](https://help.vtex.com/pt/tracks/configurar-integracao-do-mercado-livre--2YfvI3Jxe0CGIKoWIGQEIq), [Netshoes](https://help.vtex.com/pt/tracks/configurar-integracao-da-netshoes--5Ua87lhFg4m0kEcuyqmcCm), and VTEX marketplaces. For more information, see [Offer Management Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the seller's VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "vtex.amazon", + "vendor": "vtex", + "name": "Amazon", + "logo": "https://marketplace.com/logos/logo.png" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Log.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Log.yml new file mode 100644 index 0000000000..c4dde211ab --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Create Log.yml @@ -0,0 +1,134 @@ +info: + name: Create Log + type: http + seq: 10 + +http: + method: POST + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: skuId + value: "1234" + type: path + - name: interactionId + value: d3rdjjf094ma0do + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "description": "Another log message with some information that is going to be relevant to our users", + "date": "2020-03-22", + "type": "information", + "agent": "broadcaster", + "evidence": { + "request": "Explanation 1", + "response": "Explanation 2" + }, + "data": { + "externalOfferId": "123456", + "inventory": "33", + "salesPrice": "79.99", + "currency": "BRL", + "status": "disabled" + }, + "errors": { + "code": "CTLG-001", + "externalCode": "284692", + "title": "Description includes HTML", + "description": "Netshoes does not allow HTML tags in an offer's description. Access the product in your Catalog to remove the HTML tag.", + "closableOrigins": [ + "catalog", + "price" + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs - Schema is valid", function () { + const schema = {"title":"CreateLog","type":"object","example":{"id":"438B39EF43A24425B6BF35343095DE04","description":"Log description","date":"2022-05-16T09:16:00Z","agent":"MARKETPLACE","evidence":{},"type":"info"},"properties":{"id":{"type":"string","description":"Connectors must extend the Sent Offers' codes by adding their own code IDs for mapping specific scenarios that apply to their own system. They can send those codes through a suffix ID added in an existing code."},"description":{"type":"string","description":"Log's description."},"date":{"type":"string","description":"Date when the log was created."},"agent":{"type":"string","description":"Entity responsible for creating the entry."},"evidence":{"type":"object","description":"cURL with the call that the connector has made for a VTEX system.","properties":{"request":{"type":"string","description":"cURL with the request call that the connector has made for a VTEX system. It will provide the evidence needed to contextualize the entry, if the user needs to fully understand the process ocurred, or solve any errors."},"response":{"type":"string","description":"cURL with the response of the call that the connector has made for a VTEX system. It will provide the evidence needed to contextualize the entry, if the user needs to fully understand the process occurred, or solve any errors."}}},"type":{"type":"string","description":"Type of log."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), logs are the granular details of actions that happen within an [interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions), and they are organized in a timeline. All of the micro-steps of an interaction are represented through logs; they are how interactions become visible in Offer Management UI. + + This endpoint adds logs that take place within an interaction, which can be done after [creating an interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions) so that there will be an `interactionId`. + + `Errors`: When Offer Management, or the connectors, find an error that prevents sending or updating an offer to a channel, they should open a type failure log, and fill in its details through the `errors` attribute. The information provided should enable sellers to identify and fix errors on their offers. + + The connectors should go through every possible validation, identify all errors, and only after that create the failure log, with the information in a single request. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `skuId` | path | (Required) This attribute is the SKU ID in the seller's perspective, registered in their VTEX Catalog. | + | `interactionId` | path | (Required) This attribute is the code used to identify an existing interaction. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "438B39EF43A24425B6BF35343095DE04", + "description": "Log description", + "date": "2022-05-16T09:16:00Z", + "agent": "MARKETPLACE", + "evidence": {}, + "type": "info" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Deactivate Feed.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Deactivate Feed.yml new file mode 100644 index 0000000000..f49acba5f7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Deactivate Feed.yml @@ -0,0 +1,64 @@ +info: + name: Deactivate Feed + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/sent-offers/feeds/:feedId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/sent-offers/feeds/:feedId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), a feed is a list of information about seller's offers sent to a marketplace. After [creating a feed](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds), it will be activated; and through this endpoint the seller can deactivate the feed. + + When a feed is deactivated, all data related to the marketplace is removed from Offer Management UI. That includes the channels, offers, interactions, and errors. + + Deactivating a feed does not mean deleting information, and the seller can restore the data by [activating the feed](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds) again. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Error Code data by errorCodeId.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Error Code data by errorCodeId.yml new file mode 100644 index 0000000000..56b20f0f7b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Error Code data by errorCodeId.yml @@ -0,0 +1,79 @@ +info: + name: Get Error Code data by errorCodeId + type: http + seq: 14 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/error-codes/:errorCodeId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: errorCodeId + value: errorId + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sent-offers/error-codes/:errorCodeId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sent-offers/error-codes/:errorCodeId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sent-offers/error-codes/:errorCodeId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sent-offers/error-codes/:errorCodeId - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Listallerrorcode","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"},"solutionText":{"type":"string"},"solutionLink":{"type":"string"}}},"description":"Error description.","example":[{"id":"AUTH-001","type":"Authorization","description":"Authorization errors where the user can solve by himself just fixing something on the settings. For example, when the user/password is invalid, or a register field is missing...","solutionText":"Check connector settings","solutionLink":"http://{accountName}.myvtex.com/admin/bridge/#/settings"},{"id":"AUTH-002","type":"Authorization","description":"Authorization errors where the user can't solve by himself and depends on someone else to solve. For example, when the user has no access to a specific resource"},{"id":"CTLG-001","type":"Generic mapping","description":"Catalog mapping errors different from variation, attribute or category errors. For example, brand mapping or a specific field of that channel.","solutionText":"Check mapping spreadsheet","solutionLink":"http://{accountName}.myvtex.com/admin/bridge/#/settings"},{"id":"CTLG-002","type":"Variation mapping","description":"Errors of variation mapping (SKU specifications). For example, when a color field/value is not mapped correctly.","solutionText":"Check mapping spreadsheet","solutionLink":"http://{accountName}.myvtex.com/admin/bridge/#/settings"},{"id":"CTLG-003","type":"Attribute mapping","description":"Errors of attribute mapping (product specifications). For example, when product specifications are not mapped correctly.","solutionText":"Check mapping spreadsheet","solutionLink":"http://{accountName}.myvtex.com/admin/bridge/#/settings"},{"id":"CTLG-004","type":"Category mapping","description":"Errors of category mapping. For example, when a category ID is not correct; when the user has mapped the parent-category instead of the child-category.","solutionText":"Check mapping spreadsheet","solutionLink":"http://{accountName}.myvtex.com/admin/bridge/#/settings"},{"id":"CTLG-005","type":"Product info","description":"Generic errors of product information sending. For any case different that the other product information error codes don't support","solutionText":"Check item on catalog","solutionLink":"http://{accountName}.myvtex.com/admin/Site/ProdutoForm.aspx"},{"id":"CTLG-006","type":"Description","description":"Description is not according as expected by the channel. For example, when the description is too long; when has HTML; when there is no description and is a mandatory field...","solutionText":"Fix description","solutionLink":"http://{accountName}.myvtex.com/admin/Site/ProdutoForm.aspx?id={productId}"},{"id":"CTLG-007","type":"Images","description":"Images are not according as expected by the channel. For example, when the image must have white background; when has no images and is mandatory to have at least one...","solutionText":"Fix images","solutionLink":"http://{accountName}.myvtex.com/admin/Site/SkuForm.aspx?idSku={skuId}"},{"id":"CTLG-008","type":"Dimensions","description":"Dimensions are not according as expected by the channel. For example, when the weight is below the minimum required; when the dimensions are not filled and is a mandatory field...","solutionText":"Check dimensions","solutionLink":"http://{accountName}.myvtex.com/admin/Site/SkuForm.aspx?idSku={skuId}"},{"id":"CTLG-009","type":"Title","description":"Title is not according as expected by the channel. For example, when the title is too long; when the title doesn't meet the channel taxonomy...","solutionText":"Check title","solutionLink":"http://{accountName}.myvtex.com/admin/Site/ProdutoForm.aspx?id={productId}"},{"id":"CTLG-010","type":"Identifiers","description":"Identifier is not according as expected by the channel. For example, when a EAN, ISBN or UPC is invalid; when a identifier is required but is not filled...","solutionText":"Fix item's identifier","solutionLink":"http://{accountName}.myvtex.com/admin/Site/SkuForm.aspx?idSku={skuId}"},{"id":"CTLG-011","type":"Channels' rules","description":"Errors due channel's business rules that cannot be solved by the user. For example, when the product category is not supported by the channel; when a currency is not supported by the channel..."},{"id":"CTLG-012","type":"Moderation","description":"Ad moderated, it does not comply with Mercado Livre policies","solutionText":"Apply the actions in the moderation section"},{"id":"CTLG-XXX","type":"Variation mapping","description":"Errors of variation mapping (SKU specifications)","solutionText":"Download mapping spreadsheet","solutionLink":"http://{accountName}.myvtex.com/admin/dummy-invalid-link/catalog/skus/{skuId}"},{"id":"CTLG-YYY","type":"Variation mapping YYY","description":"Errors of variation mapping (SKU specifications) YYY","solutionText":"Download mapping spreadsheet YYY","solutionLink":"http://{accountName}.myvtex.com/admin/dummyyy-invalid-link/catalog/skus/{skuId}"},{"id":"INVNT-001","type":"Inventory","description":"Errors directly related to all inventory scenarios. This scenarios are for every issue that blocks an inventory from being updated. For example, when the channel has a rule of minimum quantity of inventory for all SKUs of a product.","solutionText":"Check inventory levels","solutionLink":"http://{accountName}.myvtex.com/admin/inventory/?skuId={skuId}"},{"id":"NTMAP-001","type":"Not mapped","description":"Errors not mapped by the connector. Commonly, it occurs when the channel's API starts to validate new things without communicating to the connector."},{"id":"PRICE-001","type":"Price","description":"Errors directly related to all price scenarios. This scenarios are for every issue that blocks a price from being updated. For example, when a price changes on rate that is not allowed by the marketplace.","solutionText":"Fix price","solutionLink":"http://{accountName}.myvtex.com/admin/pricing/#/prices/?page=1&qtd=10&productId={productId}&productName=%22%22"}]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + This endpoint retrieves specific information about an error code in [Offer Management's](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors) configuration. It provides the single source of truth of updated information about an error code through the `errorCodeId`. + + The connector will retrieve all the error codes available directly on this API and use the codes that apply the most to their error scenarios. Then, the connector will implement these codes into every validation error inside their system. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `errorCodeId` | path | (Required) Id for the error code chosen. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Feed by feedId.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Feed by feedId.yml new file mode 100644 index 0000000000..e40716ba17 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Feed by feedId.yml @@ -0,0 +1,92 @@ +info: + name: Get Feed by feedId + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sent-offers/feeds/:feedId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sent-offers/feeds/:feedId - Schema is valid", function () { + const schema = {"title":"RetrieveFeed","type":"object","example":{"account":"grocery1","id":"vtex.meli-classic","affiliateId":"vtex.meli-classic","salesChannel":"5","channelName":"Mercadolivre Classic","channelLogo":"https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/mercadolivre.png"},"properties":{"account":{"type":"string","description":"Seller's account name."},"id":{"type":"string","description":"Channel's ID."},"affiliateId":{"type":"string","description":"This attribute is created by the seller, in their VTEX store configuration."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/como-funciona-uma-politica-comercial--6Xef8PZiFm40kg2STrMkMV#master-data)) associated to the seller account created."},"channelName":{"type":"string","description":"Name of the channel where the offer was sent."},"channelLogo":{"type":"string","description":"Logo of the channel where the offer was sent."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), after you have [created the channel](https://developers.vtex.com/vtex-rest-api/reference/createchannel), the next step is to create a feed, which is a list of information about the seller's offers sent to the marketplace. + + This endpoint retrieves information about a specific feed by searching through its `feedId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "account": "grocery1", + "id": "vtex.meli-classic", + "affiliateId": "vtex.meli-classic", + "salesChannel": "5", + "channelName": "Mercadolivre Classic", + "channelLogo": "https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/mercadolivre.png" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Interaction Data by interactionId.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Interaction Data by interactionId.yml new file mode 100644 index 0000000000..3a23cef543 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Interaction Data by interactionId.yml @@ -0,0 +1,107 @@ +info: + name: Get Interaction Data by interactionId + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: skuId + value: "1234" + type: path + - name: interactionId + value: d3rdjjf094ma0do + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId - Schema is valid", function () { + const schema = {"title":"RetrieveInteraction","type":"object","example":{"account":"grocery1","feedId":"vtex.madeiramadeira","skuId":"1","id":"7FC112C52F8F43E6A096E29B04AC63F6","startDate":"2022-03-07T09:15:00Z","result":"processing","state":"open","source":"seller","origin":"inventory","context":"setup","logs":[]},"properties":{"account":{"type":"string","description":"Seller's account name."},"feedId":{"type":"string","description":"Attribute that identifies a feed between a seller and a channel. It follows a standardized pattern that will be used by connectors when establishing the connection between the two."},"skuId":{"type":"string","description":"SKU's unique identifier number."},"id":{"type":"string","description":"Connectors must extend the Sent Offers' codes by adding their own code IDs for mapping specific scenarios that apply to their own system. They can send those codes through a suffix ID added in an existing code."},"startDate":{"type":"string","description":"The day the interaction was created."},"result":{"type":"string","description":"Search interactions, filtering by result. Results can have the following values: \n\nSuccess: When events close their lifecycle successfully, and generate updates on an offer in terms of price, inventory, or catalog. \n\nFailure: When the connector has detected processes that have failed to be made due to an error. \n\nNotification: When there are processes with the connector that are worth mentioning, but there are no actual updates. Ex: discarded updates or sendings of an offer. \n\nProcessing: When an open interaction has not been concluded, and should still receive more steps."},"state":{"type":"string","description":"State, from the seller's address."},"source":{"type":"string","description":"This attribute defines the entity responsible for the interaction."},"origin":{"type":"string","description":"where the interaction originated from. Possible values include `catalog`, `price` or `inventory`."},"context":{"type":"string","description":"This field informs Sent Offers about an offer's lifecycle."},"logs":{"type":"array","description":"History of events related to interactions.","items":{"type":"string"},"properties":{"type":{"type":"string","title":"type","description":"Type of logs."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), VTEX platform and marketplaces interact with offers through a medium called [interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions). + + A unique code called `interactionId` is used to identify each interaction. This endpoint retrieves information about an interaction, searching by its `interactionId`. + + It also retrieves existing logs through the `log` field. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `skuId` | path | (Required) This attribute is the SKU ID in the seller's perspective, registered in their VTEX Catalog. | + | `interactionId` | path | (Required) This attribute is the code used to identify an existing interaction. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "account": "grocery1", + "feedId": "vtex.madeiramadeira", + "skuId": "1", + "id": "7FC112C52F8F43E6A096E29B04AC63F6", + "startDate": "2022-03-07T09:15:00Z", + "result": "processing", + "state": "open", + "source": "seller", + "origin": "inventory", + "context": "setup", + "logs": [] + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Log Data by logId.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Log Data by logId.yml new file mode 100644 index 0000000000..e389420ec4 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Get Log Data by logId.yml @@ -0,0 +1,115 @@ +info: + name: Get Log Data by logId + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs/:logId?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: skuId + value: "1234" + type: path + - name: interactionId + value: d3rdjjf094ma0do + type: path + - name: logId + value: "123456" + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs/:logId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs/:logId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs/:logId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions/:interactionId/logs/:logId - Schema is valid", function () { + const schema = {"title":"GetLog","type":"object","example":{"id":"91957CA041E343D8B921CECFBF9D8443","description":"Log description","date":"2022-05-16T09:16:00Z","agent":"MARKETPLACE","evidence":{},"errors":[{"code":"AUTH-001","externalCode":"MYCODE-01","title":"Error ao autenticar no marketplace","description":"Token inválido","closableOrigins":["inventory"]}],"type":"failure"},"properties":{"id":{"type":"string","description":"Connectors must extend the Sent Offers' codes by adding their own code IDs for mapping specific scenarios that apply to their own system. They can send those codes through a suffix ID added in an existing code."},"description":{"type":"string","description":"Log description"},"date":{"type":"string","description":"Date when the log was created."},"agent":{"type":"string","description":"Entity responsible for creating the entry."},"evidence":{"type":"object","description":"cURL with the call that the connector has made for a VTEX system."},"errors":{"type":"array","items":{"title":"Error","type":"object","properties":{"code":{"type":"string"},"externalCode":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"closableOrigins":{"type":"array","items":{"type":"string"}}},"description":"A description about errors."}},"type":{"type":"string","description":"Type of log."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), logs are the granular details of actions that happen within an [interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions), organized in a timeline. All interaction's micro-steps will be represented through logs; they are how interactions become visible in Offer Management UI. + + A unique code called `logId` is used to identify every log created. This endpoint enables the retrieval of information about a log by searching through its `logId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `skuId` | path | (Required) This attribute is the SKU ID in the seller's perspective, registered in their VTEX Catalog. | + | `interactionId` | path | (Required) This attribute is the code used to identify an existing interaction. | + | `logId` | path | (Required) A log's identifying code. This attribute is obtained from the Open Log API, or from the response of a Search Interactions API. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "91957CA041E343D8B921CECFBF9D8443", + "description": "Log description", + "date": "2022-05-16T09:16:00Z", + "agent": "MARKETPLACE", + "evidence": {}, + "errors": [ + { + "code": "AUTH-001", + "externalCode": "MYCODE-01", + "title": "Error ao autenticar no marketplace", + "description": "Token inválido", + "closableOrigins": [ + "inventory" + ] + } + ], + "type": "failure" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/List Feeds.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/List Feeds.yml new file mode 100644 index 0000000000..2b2962dc7d --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/List Feeds.yml @@ -0,0 +1,106 @@ +info: + name: List Feeds + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/feeds?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sent-offers/feeds - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sent-offers/feeds - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sent-offers/feeds - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sent-offers/feeds - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","example":{"account":"grocery1","id":"digibee.shopee","affiliateId":"SHP","salesChannel":"1","channelName":"shopee","channelLogo":"https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/shopee.png"},"properties":{"account":{"type":"string","description":"Seller's account name."},"id":{"type":"string","description":"The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when calling this endpoint. It follows the pattern `vendor.channel`."},"affiliateId":{"type":"string","description":"Corresponds to the 3-digit [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code created by the seller."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMVa)) used in the integration."},"channelName":{"type":"string","description":"Name of the marketplace, or channel, present in the feed."},"channelLogo":{"type":"string","description":"URL redirecting to the image file of the graphic symbol that identifies the marketplace."}}},"example":[{"account":"grocery1","id":"digibee.shopee","affiliateId":"SHP","salesChannel":"1","channelName":"shopee","channelLogo":"https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/shopee.png"},{"account":"grocery1","id":"v2v.saggin","affiliateId":"SGN","salesChannel":"1","channelName":"Saggin","channelLogo":"https://saggin.myvtex.com/api/license-manager/site/pub/accounts/a44ab387-ab95-439e-81aa-7c1a56b45374/logos/show"},{"account":"grocery1","id":"vtex.amazon","affiliateId":"MSM","salesChannel":"1","channelName":"Amazon","channelLogo":"https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/amazon.png"}]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), a feed is a list of information about seller's offers sent to a marketplace, and it is updated in real-time with content provided by the marketplace and VTEX modules. + + Since a seller can have integrations with multiple marketplaces, numerous feeds can be associated with an account. This endpoint retrieves a list with all the feeds related to an account. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the Seller's VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "account": "grocery1", + "id": "digibee.shopee", + "affiliateId": "SHP", + "salesChannel": "1", + "channelName": "shopee", + "channelLogo": "https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/shopee.png" + }, + { + "account": "grocery1", + "id": "v2v.saggin", + "affiliateId": "SGN", + "salesChannel": "1", + "channelName": "Saggin", + "channelLogo": "https://saggin.myvtex.com/api/license-manager/site/pub/accounts/a44ab387-ab95-439e-81aa-7c1a56b45374/logos/show" + }, + { + "account": "grocery1", + "id": "vtex.amazon", + "affiliateId": "MSM", + "salesChannel": "1", + "channelName": "Amazon", + "channelLogo": "https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/amazon.png" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Open Interaction.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Open Interaction.yml new file mode 100644 index 0000000000..98e88700e1 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Open Interaction.yml @@ -0,0 +1,112 @@ +info: + name: Open Interaction + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId/skus/:skuId/interactions?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: skuId + value: "1234" + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "startDate": "2020-10-29", + "source": "seller", + "origin": "catalog", + "context": "setup" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/sent-offers/feeds/:feedId/skus/:skuId/interactions - Schema is valid", function () { + const schema = {"title":"CreateInteraction","type":"object","example":{"account":"grocery1","feedId":"vtex.madeiramadeira","skuId":"1","id":"3D585672B15A418EBDFC4BC0E85120A5","startDate":"2022-03-07T09:15:00Z","result":"processing","state":"open","source":"seller","origin":"inventory","context":"setup","logs":[]},"properties":{"account":{"type":"string","description":"Seller's account name."},"feedId":{"type":"string","description":"Attribute that identifies a feed between a seller and a channel. It follows a standardized pattern that will be used by connectors when establishing the connection between the two."},"skuId":{"type":"string","description":"SKU's unique identifier number."},"id":{"type":"string","description":"Connectors must extend the Sent Offers' codes by adding their own code IDs for mapping specific scenarios that apply to their own system. They can send those codes through a suffix ID added in an existing code."},"startDate":{"type":"string","description":"The day the interaction was created."},"result":{"type":"string","description":"Search interactions, filtering by result. Results can have the following values: \n\nSuccess: When events close their lifecycle successfully, and generate updates on an offer in terms of price, inventory, or catalog. \n\nFailure: When the connector has detected processes that have failed to be made due to an error. \n\nNotification: When there are processes with the connector that are worth mentioning, but there are no actual updates. Ex: discarded updates or sendings of an offer. \n\nProcessing: When an open interaction has not been concluded, and should still receive more steps."},"state":{"type":"string","description":"State, from the seller's address."},"source":{"type":"string","description":"This attribute defines the entity responsible for the interaction."},"origin":{"type":"string","description":"where the interaction originated from. Possible values include `catalog`, `price` or `inventory`."},"context":{"type":"string","description":"This field informs Sent Offers about an offer's lifecycle."},"logs":{"type":"array","description":"History of events related to interactions.","items":{"type":"string"},"properties":{"type":{"type":"string","title":"type","description":"Type of logs."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), VTEX platform and marketplaces interact with offers through a medium called Interaction. For every action that happens to an offer, whether it is a status notification or a price update, the connector creates an Interaction about it. + + This endpoint creates a new interaction for an SKU so that changes can be applied to an offer. The changes informed by interactions are related to: price, inventory, catalog and status. + + Usually, interactions process a single type of change at a time, but it is possible to add data about catalog, price, and inventory simultaneously in the same interaction. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `skuId` | path | (Required) This attribute is the SKU ID in the seller's perspective, registered in their VTEX Catalog. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "account": "grocery1", + "feedId": "vtex.madeiramadeira", + "skuId": "1", + "id": "3D585672B15A418EBDFC4BC0E85120A5", + "startDate": "2022-03-07T09:15:00Z", + "result": "processing", + "state": "open", + "source": "seller", + "origin": "inventory", + "context": "setup", + "logs": [] + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Errors.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Errors.yml new file mode 100644 index 0000000000..3b289219b5 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Errors.yml @@ -0,0 +1,87 @@ +info: + name: Search Errors + type: http + seq: 13 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/search/errors?an={{accountName}}&q={{query}}&channels={{channels}}&brand={{brand}}&category={{category}}&errorCategory={{errorCategory}}&sort={{sort}}&from={{from}}&to={{to}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: q + value: "{{query}}" + type: query + - name: channels + value: "{{channels}}" + type: query + - name: brand + value: "{{brand}}" + type: query + - name: category + value: "{{category}}" + type: query + - name: errorCategory + value: "{{errorCategory}}" + type: query + - name: sort + value: "{{sort}}" + type: query + - name: from + value: "{{from}}" + type: query + - name: to + value: "{{to}}" + type: query + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/sent-offers/search/errors - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + This endpoint provides the single source of truth of updated error codes in [Offer Management's](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors) configuration. It retrieves a list of all the error codes available at that moment. + + The connector will retrieve all the error codes available directly on this API and use the codes that apply the most to their error scenarios. Then, the connector will implement these codes into every validation error inside their system. + + This endpoint allows filtering errors by using the following query params: `channel`, `brand`, `category`, `errorCategory`. It also counts with the following pagination query params: `sort`, `from`, `to`, `q`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `q` | query | (Required) Customizable field for searching error codes. | + | `channels` | query | (Required) Search errors filtering by channels. | + | `brand` | query | (Required) Search errors filtering by brand. | + | `category` | query | (Required) Search errors filtering by category. | + | `errorCategory` | query | (Required) Search errors filtering by error category. | + | `sort` | query | (Required) Pagination that returns a range of ordered error codes. | + | `from` | query | (Required) Pagination that returns error codes from a given point. | + | `to` | query | (Required) Pagination that returns error codes until a given point. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Interactions and their Logs.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Interactions and their Logs.yml new file mode 100644 index 0000000000..17d3891daf --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Search Interactions and their Logs.yml @@ -0,0 +1,95 @@ +info: + name: Search Interactions and their Logs + type: http + seq: 12 + +http: + method: GET + url: "{{baseUrl}}/api/sent-offers/search/interactions?an={{accountName}}&q={{query}}&sort={{sort}}&from={{from}}&to={{to}}&fromDate={{fromDate}}&toDate={{toDate}}" + params: + - name: an + value: "{{accountName}}" + type: query + - name: q + value: "{{query}}" + type: query + - name: channels + value: "{{channelName}}" + type: query + disabled: true + - name: brand + value: "{{brand}}" + type: query + disabled: true + - name: category + value: "{{category}}" + type: query + disabled: true + - name: scope + value: "{{scope}}" + type: query + disabled: true + - name: result + value: "{{result}}" + type: query + disabled: true + - name: sort + value: "{{sort}}" + type: query + - name: from + value: "{{from}}" + type: query + - name: to + value: "{{to}}" + type: query + - name: fromDate + value: "{{fromDate}}" + type: query + - name: toDate + value: "{{toDate}}" + type: query + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/sent-offers/search/interactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), VTEX platform and marketplaces interact with offers through a medium called [interaction](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions). The granular details of actions and micro-steps that happen within an interaction's are called [logs](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/feeds/-feedId-/skus/-skuId-/interactions/-interactionId-/logs). + + This endpoint retrieves information about interactions and all logs within it. It allows filtering interactions by using the following query params: `channel`, `brand`, `category`, `scope`, `result`, `fromDate`, `toDate`. This endpoint also counts with the following pagination query params: `sort`, `from`, `to`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as a query param. | + | `q` | query | (Required) Customizable field for searching interactions. | + | `channels` | query | Search interactions, filtering by channel. | + | `brand` | query | Search interactions, filtering by brand. | + | `category` | query | Search interactions, filtering by category. | + | `scope` | query | Search interactions, filtering by scope. | + | `result` | query | Search interactions, filtering by result. Results can have the following values: Success: When events close their lifecycle successfully, and generate updates on an offer in terms of price, inventory, or catalog. Failure: When the connector has detected processes that have failed to be made due to an error. Notification: When there are processes with the connector that are worth mentioning, but there are no actual updates. Ex: discarded updates or sendings of an offer. Processing: When an open interaction has not been concluded, and should still receive more steps. This is a transitory state, considering that when an interaction is closed, it can only end with `success`, `failure` or `notification` as its result. | + | `sort` | query | (Required) Search interactions filtering by sort. | + | `from` | query | (Required) Search interactions from a given point. | + | `to` | query | (Required) Search interactions until a given point. | + | `fromDate` | query | (Required) Search interactions from a specific date. | + | `toDate` | query | (Required) Search interactions until a given date. | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Update Feed.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Update Feed.yml new file mode 100644 index 0000000000..a49f290460 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/Update Feed.yml @@ -0,0 +1,69 @@ +info: + name: Update Feed + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/sent-offers/feeds/:feedId?an={{accountName}}" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: feedId + value: vtex.amazon + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "affiliateId": "MKP", + "salesChannels": "5" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/sent-offers/feeds/:feedId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/sent-offers/feeds/:feedId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗The Offer Management module has been discontinued and is no longer supported. The module has been replaced by Offer Status. + To learn more, visit the [announcement](https://help.vtex.com/pt/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3). + + In [Offer Management](https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors), a feed is a list of information about seller's offers sent to a marketplace. + + Once you have [created a feed](https://developers.vtex.com/docs/api-reference/marketplace-apis-offer-management#post-/api/sent-offers/channels), this endpoint allows the seller to update the sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) and [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) ID used in the integration with the marketplace. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `feedId` | path | (Required) The `feedId` attribute that identifies a feed between a seller and a channel, follows a standardized pattern that will be used by connectors when establishing the connection between the two. It follows the pattern `vendor.channel`. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Name of the VTEX account. Used as query param. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/folder.yml new file mode 100644 index 0000000000..56d824988b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/Offer Management/folder.yml @@ -0,0 +1,4 @@ +info: + name: Offer Management + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/environments/VTEX.yml new file mode 100644 index 0000000000..e61fee675b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/environments/VTEX.yml @@ -0,0 +1,32 @@ +name: VTEX +variables: + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://portal.{{environment}}.com.br + - name: accountName + value: "" + - name: brand + value: "" + - name: category + value: "" + - name: channels + value: "" + - name: errorCategory + value: "" + - name: feedId + value: "" + - name: from + value: "" + - name: fromDate + value: "" + - name: query + value: "" + - name: sort + value: "" + - name: to + value: "" + - name: toDate + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/opencollection.yml b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/opencollection.yml new file mode 100644 index 0000000000..bacdaf23b4 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Sent Offers/opencollection.yml @@ -0,0 +1,102 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace APIs - Sent Offers + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The **Marketplace API** enables marketplaces and sellers hosted on VTEX to perform their collaborative operations. + + >⚠️ The marketplace must [create an appKey and appToken](https://developers.vtex.com/docs/guides/getting-started-authentication) for each non-VTEX seller that will use this API. + + ## Index + + ### Notification + + Endpoints used by sellers to notify marketplaces that the price or inventory language has changed for one of their SKUs. + + `POST` [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) + + `POST` [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory) + + + ### Suggestions + + #### Get Suggestions + + Search and filter all suggestions using specific criteria. + + `GET` [Get all SKU Suggestions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions) + + `GET` [Get SKU Suggestion by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Manage Suggestions + + Send or delete SKU suggestions from the seller to marketplace. + + `PUT` [Send SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerSkuId-) + + `DELETE` [Delete SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#delete-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Get Versions + + Search and filter all versions of suggestions, using specific criteria. + + `GET` [Get all versions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions) + + `GET` [Get version by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions/-version-) + + + #### Match Received SKUs + + Match SKU suggestions received in the marketplace. + + `PUT` [Match Received SKUs individually](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerskuid-/versions/-version-/matches/-matchid-) + + `PUT` [Match Multiple Received SKUs](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/matches/action/-actionName-) + + + #### SKU Approval Settings + + Allows marketplaces to configure rules for automatically and manually approving SKUs received from sellers. + + `GET`[Get autoApprove Status in Account Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/autoapproval/toggle) + + `PUT`[Activate autoApprove in Marketplace's Account](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle) + + `GET`[Get Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration) + + `PUT`[Save Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration) + + `GET`[Get Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Save Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Activate autoApprove Setting for a Seller](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle/seller/-sellerId-) + + + ### Matched Offers + + Offers are seller products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + `GET`[Get Matched Offers List](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/offers) + + `GET`[Get Matched Offer's Data by SKU ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-/sku/-skuId-) + + `GET`[Get Matched Offer's Data by Product ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get SKU suggestion by ID.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get SKU suggestion by ID.yml new file mode 100644 index 0000000000..3a1afa94c8 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get SKU suggestion by ID.yml @@ -0,0 +1,80 @@ +info: + name: Get SKU suggestion by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/suggestions/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerSkuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/suggestions/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves the data of a specific SKU sent by the seller, to the marketplace. Marketplaces or external matchers can call this endpoint when they want to check the information about a single SKU. + + Note that all the information sent by the seller will be in the [content] object. All remaining information in this endpoint's response is given by the Matcher. + + Matcher rates received SKUs by correlating the data sent by sellers, to existing fields in the marketplace. The calculation of these scores determines whether the product has been: + + `Approved`: score equal to or greater than 80 points. + + `Pending`: from 31 to 79 points. + + `Denied`: from 0 to 30 points. + + Note that if the autoApprove setting is enabled, the SKUs will be approved, regardless of the Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Send marketplace suggestion** | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerSkuId` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get all SKU suggestions.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get all SKU suggestions.yml new file mode 100644 index 0000000000..0b578cccfc --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/Get all SKU suggestions.yml @@ -0,0 +1,110 @@ +info: + name: Get all SKU suggestions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/suggestions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: q + value: "" + type: query + disabled: true + - name: type + value: new + type: query + disabled: true + - name: seller + value: "" + type: query + disabled: true + - name: status + value: accepted + type: query + disabled: true + - name: hasmapping + value: "true" + type: query + disabled: true + - name: matcherid + value: vtex-matcher + type: query + disabled: true + - name: _from + value: "1" + type: query + disabled: true + - name: _to + value: "50" + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/suggestions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a list of all SKUs sent by the seller for the marketplace's approval. Marketplace operators should use this endpoint whenever they want to check the full list of received SKUs and their information. + + Note that all the information sent by the seller will be in the [content] object. All remaining information in this endpoint's response is given by the Matcher. + + Matcher rates received SKUs by correlating the data sent by sellers, to existing fields in the marketplace. The calculation of these scores determines whether the product has been: + + `Approved`: Score equal to or greater than 80 points. + + `Pending`: From 31 to 79 points. + + `Denied`: From 0 to 30 points. + + Note that if the autoApprove setting is enabled, the SKUs will be approved, regardless of the Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `q` | query | This field allows you to customize your search. You can fill in this query param if you want to narrow down your search using the available filters on Received SKU modules. | + | `type` | query | This field allows users to filter SKU suggestions, by searching only the new suggestions that were just sent, and suggestions that have already been sent, but were updated. Possible values for this field include `new` and `update`. | + | `seller` | query | A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller so it can call this endpoint. | + | `status` | query | Narrow down you search, filtering by status. Values allowed on this field include: `accepted`, `pending` and `denied.` | + | `hasmapping` | query | This field allows you to filter SKUs that have mapping or not. Insert `true` to filter SKUs that have mapping, or `false` to retrieve SKUs that aren't mapped. | + | `matcherid` | query | Identifies the matching entity. It can be either VTEX's matcher, or an external matcher developed by partners, for example. The `matcherId`'s value can be obtained through the [Get SKU Suggestion by ID](https://developers.vtex.com/vtex-rest-api/reference/getsuggestion) endpoint. | + | `_from` | query | Define your pagination range, by adding the pagination starting value. Values should be bigger than 0, with a maximum of 50 records per page. | + | `_to` | query | Define your pagination range, by adding the pagination ending value. Values should be bigger than 0, with a maximum of 50 records per page. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/folder.yml new file mode 100644 index 0000000000..5ef5bcf989 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get suggestions/folder.yml @@ -0,0 +1,8 @@ +info: + name: Get suggestions + type: folder + seq: 1 + +docs: + content: Search and filter all suggestions using specific criteria. + type: text/markdown diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get all versions.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get all versions.yml new file mode 100644 index 0000000000..b5463ffcb1 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get all versions.yml @@ -0,0 +1,71 @@ +info: + name: Get all versions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/suggestions/:sellerId/:sellerskuid/versions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerskuid + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/suggestions/:sellerId/:sellerskuid/versions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Whenever a SKU suggestion is updated or changed, a new version of the original one is created. All versions are logged, so you can search for previous our current states of SKU suggestions. + + This endpoint retrieves the data of *all* previous and latest versions of a specific SKU suggestion, sent by the seller. Whenever a SKU is updated, it is important to map previous versions, to compare and identify changes. + + The response's object [latestversion] provides the information of the most recent version of that SKU suggestion. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerskuid` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get version by ID.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get version by ID.yml new file mode 100644 index 0000000000..63467cbda8 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/Get version by ID.yml @@ -0,0 +1,73 @@ +info: + name: Get version by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/suggestions/:sellerId/:sellerskuid/versions/:version" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerskuid + value: "1234" + type: path + - name: version + value: "09072021142808277" + type: path + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/suggestions/:sellerId/:sellerskuid/versions/:version - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Whenever a SKU suggestion is updated or changed, a new version of the original one is created. All versions are logged, so you can search for previous our current states of SKU suggestions. + + This endpoint retrieves a specific *version* of a chosen SKU sent by the seller. Add the Seller's ID, Seller's SKU ID, and version ID in the path to detail your search. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerskuid` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `version` | path | (Required) Whenever an SKU Suggestion is updated or changed, a new version of the original one is created. All versions are logged, so you can search for previous our current states of SKU suggestions. This field is the `versionId` associated to the version you choose to search for. You can get this field's value through the [Get SKU Suggestion by ID](https://developers.vtex.com/vtex-rest-api/reference/getsuggestion). through the `latestVersionId` field. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/folder.yml new file mode 100644 index 0000000000..94ed37dde5 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Get versions/folder.yml @@ -0,0 +1,8 @@ +info: + name: Get versions + type: folder + seq: 3 + +docs: + content: Search and filter all versions of suggestions, using specific criteria. + type: text/markdown diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Delete SKU suggestion.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Delete SKU suggestion.yml new file mode 100644 index 0000000000..9d74fb2f52 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Delete SKU suggestion.yml @@ -0,0 +1,67 @@ +info: + name: Delete SKU suggestion + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/suggestions/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerSkuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/suggestions/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint deletes a chosen SKU suggestion. Only one SKU should be deleted per request. This action cannot be undone. A workaround to revert a deletion is to send the suggestion again, through the Send Suggestion API. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerSkuId` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Send SKU suggestion.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Send SKU suggestion.yml new file mode 100644 index 0000000000..f84a06c950 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/Send SKU suggestion.yml @@ -0,0 +1,122 @@ +info: + name: Send SKU suggestion + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerSkuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "ProductId": "321", + "ProductName": "Product sample", + "NameComplete": "Complete product name", + "ProductDescription": "sample", + "BrandName": "Brand 1", + "SkuName": "Sku sample", + "SellerId": "string", + "Height": 1, + "Width": 1, + "Length": 1, + "Weight": 1, + "Updated": null, + "RefId": "REFID123", + "SellerStockKeepingUnitId": 567, + "CategoryFullPath": "Category 1", + "Images": [ + { + "imageName": "Principal", + "imageUrl": "https://i.pinimg.com/originals/2d/96/4a/2d964a6bf37d9224d0615dc85fccdd62.jpg" + } + ], + "ProductSpecifications": [ + { + "fieldName": "Fabric", + "fieldValues": [ + "Cotton", + "Velvet" + ] + } + ], + "SkuSpecifications": [ + { + "fieldName": "Color", + "fieldValues": [ + "Red", + "Blue" + ] + } + ], + "EAN": "EAN123", + "MeasurementUnit": "un", + "UnitMultiplier": 1, + "AvailableQuantity": 111, + "Pricing": { + "Currency": "BRL", + "SalePrice": 399, + "CurrencySymbol": "R$" + } + } + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/suggestions/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is used by the seller when it wants to suggest that one of their SKUs is sold in the marketplace. + + Before using this request, the seller should always use the [Change Notification](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-seller-sku-notification) request in order to check if the SKU already exists in the marketplace. If it doesn't, then this is the next call in the SKU integration flow. + + In the Send Suggestion request, the seller must send information about the SKU, such as the product and SKU name, the seller ID, and the image URL. All parameters are explained below. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Send marketplace suggestion** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerSkuId` | path | (Required) A string that identifies the SKU in the seller. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account to which the seller wants to suggest a new SKU. It is used as part of the request URL. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/folder.yml new file mode 100644 index 0000000000..7b4fceec2f --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Manage suggestions/folder.yml @@ -0,0 +1,8 @@ +info: + name: Manage suggestions + type: folder + seq: 2 + +docs: + content: Send or delete SKU suggestions from the seller to marketplace. + type: text/markdown diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match multiple received SKUs.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match multiple received SKUs.yml new file mode 100644 index 0000000000..181d6f6521 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match multiple received SKUs.yml @@ -0,0 +1,162 @@ +info: + name: Match multiple received SKUs + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/matches/action/:actionName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: actionName + value: newproduct + type: path + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + [ + [ + { + "itemId": "1234567", + "versionId": "v.2", + "matchId": "vtex-matcher", + "matcherId": "vtex-matcher", + "categoryId": 12, + "sellerId": "seller123", + "brandId": 1234567, + "skuRef": "123 sku ref", + "productRef": "123 product ref" + }, + { + "itemId": "1234567", + "versionId": "v.2", + "matchId": "vtex-matcher", + "matcherId": "vtex-matcher", + "categoryId": 12, + "sellerId": "seller123", + "brandId": 1234567, + "skuRef": "123 sku ref", + "productRef": "123 product ref" + } + ], + [ + { + "itemId": "1234567", + "versionId": "v.2", + "matchId": "vtex-matcher", + "matcherId": "vtex-matcher", + "categoryId": 12, + "sellerId": "seller123", + "brandId": 1234567, + "skuRef": "123 sku ref", + "productRef": "123 product ref" + }, + { + "itemId": "1234567", + "versionId": "v.2", + "matchId": "vtex-matcher", + "matcherId": "vtex-matcher", + "categoryId": 12, + "sellerId": "seller123", + "brandId": 1234567, + "skuRef": "123 sku ref", + "productRef": "123 product ref" + } + ] + ] + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/suggestions/matches/action/:actionName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/suggestions/matches/action/:actionName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/suggestions/matches/action/:actionName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/suggestions/matches/action/:actionName - Schema is valid", function () { + const schema = {"type":"array","description":"An array containing the results of multiple match operations. Each object in the array represents the outcome of a single match attempt.","items":{"type":"object","description":"Represents the result of a single match operation, including details such as match ID, matcher ID, seller ID, item ID, and whether the operation was successful.","properties":{"matchId":{"type":"string","description":"Unique identifier for the match operation, which can be used for tracking and auditing purposes."},"matcherId":{"type":"string","description":"Identifier for the matcher entity that performed the match. It can represent VTEX's internal matcher or an external matcher service."},"sellerId":{"type":"string","description":"Unique identifier of the seller who owns the SKU being matched."},"itemId":{"type":"string","description":"Unique identifier of the item (SKU) that was processed during the match operation."},"isSuccess":{"type":"boolean","description":"Indicates whether the match operation was successful. A value of `true` means the operation succeeded, while `false` indicates a failure."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows a marketplace to bulk approve, deny, or associate up to 25 received SKUs from sellers. + + Through the `actionName` attribute, you can select the operation you want to apply to the received SKU. Actions include: + + * `newproduct`: Match the SKU as a new product. + + * `skuassociation`: Associate the received SKU to an existing SKU. + + * `productassociation`: Associate the received SKU to an existing product. + + * `deny`: Deny the received SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `actionName` | path | (Required) Operation to apply to received SKUs. Possible values include: * `newproduct`: match the SKU as a new product. * `skuassociation`: associate the received SKU to an existing SKU. * `productassociation`: associate the received SKU to an existing product. * `deny`: deny the received SKU. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + [ + { + "matchId": "06272023010821403", + "matcherId": "vtex-matcher", + "sellerId": "test858", + "itemID": "81", + "isSuccess": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match received SKUs individually.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match received SKUs individually.yml new file mode 100644 index 0000000000..668594b0c5 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/Match received SKUs individually.yml @@ -0,0 +1,164 @@ +info: + name: Match received SKUs individually + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/:sellerId/:sellerskuid/versions/:version/matches/:matchid" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: sellerskuid + value: "1234" + type: path + - name: version + value: "09072021142808277" + type: path + - name: matchid + value: et ex cupid + type: path + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "matcherId": "{{matcherid}}", + "matchType": "itemMatch", + "score": "{{score}} (must be decimal)", + "skuRef": "{{skuid}}(should be specifed when match is a sku match)", + "productRef": "{{productRef}}(should be specified when match is a product match)", + "product": { + "name": "Book A", + "description": "Book description", + "categoryId": 12, + "brandId": 1234567, + "matchType": "itemMatch", + "specifications": null + }, + "sku": { + "name": "Sku exemplo", + "eans": [ + "12345678901213" + ], + "refId": null, + "height": 1, + "width": 1, + "length": 1, + "weight": 1, + "images": { + "imagem1.jpg": "https://imageurl.example" + }, + "unitMultiplier": 1, + "measurementUnit": "un", + "specifications": { + "Packaging": "3kg" + } + } + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/suggestions/:sellerId/:sellerskuid/versions/:version/matches/:matchid - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/suggestions/:sellerId/:sellerskuid/versions/:version/matches/:matchid - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/suggestions/:sellerId/:sellerskuid/versions/:version/matches/:matchid - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/suggestions/:sellerId/:sellerskuid/versions/:version/matches/:matchid - Schema is valid", function () { + const schema = {"type":"array","description":"An array containing the results of multiple match operations. Each object in the array represents the outcome of a single match attempt.","items":{"type":"object","description":"Represents the result of a single match operation, including details such as match ID, matcher ID, seller ID, item ID, and whether the operation was successful.","properties":{"matchId":{"type":"string","description":"Unique identifier for the match operation, which can be used for tracking and auditing purposes."},"matcherId":{"type":"string","description":"Identifier for the matcher entity that performed the match. It can represent VTEX's internal matcher or an external matcher service."},"sellerId":{"type":"string","description":"Unique identifier of the seller who owns the SKU being matched."},"itemId":{"type":"string","description":"Unique identifier of the item (SKU) that was processed during the match operation."},"isSuccess":{"type":"boolean","description":"Indicates whether the match operation was successful. A value of `true` means the operation succeeded, while `false` indicates a failure."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + All SKUs sent from a seller to a marketplace must be reviewed and matched. Actions in the matching process are added in the request body through the [matchType] object. Match type actions include: + + 1. `newproduct`: Match the SKU as a new product. + + 2. `itemMatch`: Associate the received SKU to an existing SKU. + + 3. `productMatch`: Associate the received SKU to an existing product. + + 4. `deny`: Deny the received SKU. + + 5. `pending`: The received SKU requires attention. + + 6. `incomplete`: The received SKU is lacking information to be matched. + + 7. `insufficientScore`: The Score given by the Matcher to this received SKU doesn't qualify it to be matched. + + Note that if the autoApprove setting is enabled, the SKUs will be approved, regardless of the Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion | Suggestion resources | **Main** | + + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `sellerskuid` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications. | + | `version` | path | (Required) Whenever an SKU Suggestion is updated or changed, a new version of the original one is created. All versions are logged, so you can search for previous our current states of SKU suggestions. This field is the versionId associated to the version you choose to search for. You can get this field's value through the[Get SKU Suggestion by ID](https://developers.vtex.com/vtex-rest-api/reference/getsuggestion). through the `latestVersionId` field. | + | `matchid` | path | (Required) Whenever an SKU suggestion is matched, it is associated to a unique ID. Fill in this field with the matchId you wish to filter by. The `matchId`'s value can be obtained through the *[Get SKU Suggestion by ID](https://developers.vtex.com/vtex-rest-api/reference/getsuggestion) endpoint. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + [ + { + "matchId": "06272023010821403", + "matcherId": "vtex-matcher", + "sellerId": "test858", + "itemID": "81", + "isSuccess": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/folder.yml new file mode 100644 index 0000000000..825f44fa01 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Match received SKUs/folder.yml @@ -0,0 +1,8 @@ +info: + name: Match received SKUs + type: folder + seq: 5 + +docs: + content: Match SKU suggestions received in the marketplace. + type: text/markdown diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/Map seller specifications to marketplace catalog.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/Map seller specifications to marketplace catalog.yml new file mode 100644 index 0000000000..c5b0f7101a --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/Map seller specifications to marketplace catalog.yml @@ -0,0 +1,76 @@ +info: + name: Map seller specifications to marketplace catalog + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/configuration/:sellerID/specifications" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerID + value: seller123 + type: path + - name: accountName + value: marketplaceexample + type: path + body: + type: json + data: |- + { + "43": "41", + "Tamanho": "TAM", + "Cor": "Color", + "BROWN": "Marrom", + "Brand": "Marca" + } + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/suggestions/configuration/:sellerID/specifications - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows the seller to perform a bulk mapping of product specifications to the marketplace catalog. + + Specifications are additional properties that can be registered on products. To ensure this information is correctly interpreted, the marketplace must map the seller’s specifications to the corresponding fields in its own catalog. + + This process ensures that products sent by the seller contain data that matches the marketplace's catalog. Sending a new item without prior mapping does not override existing values. Adding new specifications must follow the instructions in the Mapping categories, brands, and specifications for the marketplace guide. + The mapping must be done based on specifications that already exist in the marketplace's catalog. + + 🔹 All differing specifications must be mapped, even if the only difference is the capitalization of the word. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Content | **Product and SKU Management** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerID` | path | (Required) Marketplace seller ID whose specifications will be mapped | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/folder.yml new file mode 100644 index 0000000000..c912fd4df2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/Multiple product specification mapping/folder.yml @@ -0,0 +1,4 @@ +info: + name: Multiple product specification mapping + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove in marketplace's account.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove in marketplace's account.yml new file mode 100644 index 0000000000..57070b992a --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove in marketplace's account.yml @@ -0,0 +1,96 @@ +info: + name: Activate autoApprove in marketplace's account + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/configuration/autoapproval/toggle" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "Enabled": true + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/suggestions/configuration/autoapproval/toggle - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/suggestions/configuration/autoapproval/toggle - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/suggestions/configuration/autoapproval/toggle - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/suggestions/configuration/autoapproval/toggle - Schema is valid", function () { + const schema = {"type":"object","properties":{"Enabled":{"type":"boolean","description":"If the autoapprove setting is active (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint enables the autoapprove rule to a marketplace's whole Received SKUs module. Once enabling the rule, received SKUs will be automatically approved on your store, regardless of the seller. + + For the autoapprove rule to work as expected, the approval [Matcher score](https://help.vtex.com/en/tutorial/entendendo-a-pontuacao-do-vtex-matcher--tutorials_424) should be set up as 80 (default value), but you can configure a different number through the field `Score` in [Save Account's Approval Settings](https://developers.vtex.com/vtex-rest-api/reference/saveaccountconfig). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "Enabled": false + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove setting for a seller.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove setting for a seller.yml new file mode 100644 index 0000000000..6b537fe813 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Activate autoApprove setting for a seller.yml @@ -0,0 +1,68 @@ +info: + name: Activate autoApprove setting for a seller + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/configuration/autoapproval/toggle/seller/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "Enabled": true + } + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/suggestions/configuration/autoapproval/toggle/seller/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint enables the auto approve setting to received SKUs from a specific seller. Be aware that once enabling the rule through this request, all received SKUs from that seller will be automatically approved on your store, regardless of the Matcher Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's approval settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's approval settings.yml new file mode 100644 index 0000000000..90969a5220 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's approval settings.yml @@ -0,0 +1,122 @@ +info: + name: Get account's approval settings + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/suggestions/configuration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/suggestions/configuration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/suggestions/configuration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/suggestions/configuration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/suggestions/configuration - Schema is valid", function () { + const schema = {"type":"object","properties":{"Score":{"type":"object","description":"Matcher scores for approving and rejecting SKUs received from sellers."},"Matchers":{"type":"array","description":"All Matchers configured on the marketplace, and their respective details.","items":{"type":"object","description":"Details of a single matcher configured in the marketplace.","properties":{"MatcherId":{"type":"string","description":"Identifies the matching entity, either VTEX's matcher or an external matcher."},"hook-base-address":{"type":"string","description":"The base address for the Matcher's API endpoint."},"IsActive":{"type":"boolean","description":"Indicates whether the matcher is active (`true`) or inactive (`false`)."},"UpdatesNotificationEndpoint":{"type":"string","description":"Endpoint for receiving notifications about updates from the matcher."},"Description":{"type":"string","description":"Description or notes about the matcher."}}}},"Rules":{"type":"object","description":"Items and products."},"SpecificationsMapping":{"type":"array","description":"Mapping of product and SKU specifications between the marketplace and the seller.","items":{"type":"object","description":"Mapping details for a single specification.","properties":{"fieldName":{"type":"string","description":"Name of the specification field in the seller's catalog."},"marketplaceField":{"type":"string","description":"Corresponding name of the specification field in the marketplace's catalog."}}}},"MatchFlux":{"type":"string","description":"This field determines the type of approval configuration applied to SKUs received from a seller."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves the current approval settings of a marketplace's Received SKUs module. Its response includes: + + - `Score`: Matcher scores for approving and rejecting SKUs received from sellers. + + - `Matchers`: All Matchers configured on the marketplace, and their respective details. + + - `SpecificationsMapping`: Mapping of product and SKU specifications, per seller. + + - `MatchFlux`: This field determines the type of approval configuration applied to SKUs received from a seller. + + The possible values include: + + -`default`, where the Matcher reviews the SKU, and approves it based on its score. + + -`manual`, for manual approvals through the Received SKU UI, or Match API. + + -`autoApprove`, for every SKU received from a given seller to be approved automatically, regardless of their Matcher Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "Score": { + "Approve": 80, + "Reject": 30 + }, + "Matchers": [ + { + "MatcherId": "vtex-matcher", + "hook-base-address": "http://portal.vtexinternal.com/api/ssm/hooks", + "IsActive": true, + "UpdatesNotificationEndpoint": "https://example.com/updates/notifications", + "Description": "This matcher is configured to handle specific product categories and has been optimized for high accuracy." + } + ], + "Rules": { + "Item": [], + "Product": [] + }, + "SpecificationsMapping": [], + "MatchFlux": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's matcher settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's matcher settings.yml new file mode 100644 index 0000000000..8321f7b3a1 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get account's matcher settings.yml @@ -0,0 +1,111 @@ +info: + name: Get account's matcher settings + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/suggestions/configuration/account/config" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/suggestions/configuration/account/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/suggestions/configuration/account/config - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/suggestions/configuration/account/config - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/suggestions/configuration/account/config - Schema is valid", function () { + const schema = {"description":"Response from Get Account's Matcher Settings endpoint with information about current matcher score setting, rules, spec mapping, and matchFlux.","type":"object","properties":{"score":{"description":"[Matcher](https://help.vtex.com/pt/tutorial/entendendo-a-pontuacao-do-vtex-matcher--tutorials_424) rates received SKUs by comparing the data sent by sellers to existing fields in the marketplace. The calculation of these scores determines whether the product has been: `Approved`, `Pending` or `Denied`.","type":"object","properties":{"approve":{"type":"integer","description":"Minimum approval score set by the marketplace.","default":80},"pending":{"type":"integer","description":"Minimum value for the ad to be pending.","default":31},"reject":{"type":"integer","description":"Bounce score set by marketplace.","default":30}}},"matchers":{"description":"Array of objects that presents a list of matchers configured in the marketplace. If the marketplace has more than one matcher configured in the account, an array will be displayed for each matcher.\n\n By default, the VTEX Matcher is set up automatically in VTEX account.","type":"array","items":{"type":"object","description":"An object representing a single matcher configuration.","properties":{"matcherId":{"type":"string","description":"The Matcher Id."},"hook-base-address":{"type":"string","description":"The base address of the Matcher hook."},"isActive":{"type":"boolean","description":"Indicates if Matcher is active or not. `TRUE` = Matcher is active or `FALSE` = Matcher is inactive."}}}},"rules":{"description":"Arrays object that contains the rules defined for product approval.","type":"object","properties":{"item":{"type":"array","description":"A list of rules for items.","items":{"type":"object","description":"A rule for items."}},"product":{"type":"array","description":"A list of rules for products.","items":{"type":"object","description":"A rule for products."}}}},"SpecificationsMapping":{"type":"array","description":"List of product specifications and SKU attributes configured for mapping.","items":{"type":"object","description":"A specification mapping entry."}},"matchFlux":{"type":"string","description":"This field shows what type of approval setting is being applied to SKUs received from a seller. \n\nPossible values include: \n\n-`default`: where Matcher reviews the SKU and approves it based on its score. \n\n-`manual`: for manual approvals via incoming SKU UI or mailing API. \n\n-`autoApprove`: so that every SKU received from a given seller is automatically approved, regardless of its Matcher Score."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint will be used by the marketplace to query the matcher's current approval settings on their incoming SKUs module. If the account has no matcher configured, the response will be `404 Not Found`. + + For account approval configuration information, with response including specification information, see [Get Account Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration) terminal. + + The [VTEX matcher](https://help.vtex.com/pt/tutorial/entendendo-a-punctuacao-do-vtex-matcher--tutorials_424) is a tool used by marketplaces to evaluate SKUs corresponding to information from an advertisement of the seller, with those of items already present in the marketplace catalog. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "score": { + "approve": 85, + "pending": 31, + "reject": 30 + }, + "matchers": [ + { + "matcherId": "example-matcher", + "hook-base-address": "http://portal.vtexinternal.com.br/api/u90/hooks", + "isActive": true, + "updatesNotificationEndpoint": null, + "description": null + } + ], + "rules": { + "item": [], + "product": [] + }, + "specificationsMapping": [], + "matchFlux": "Default" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get autoApprove status in account settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get autoApprove status in account settings.yml new file mode 100644 index 0000000000..d733b757fd --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get autoApprove status in account settings.yml @@ -0,0 +1,94 @@ +info: + name: Get autoApprove status in account settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/suggestions/configuration/autoapproval/toggle?sellerId=seller123" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: query + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/suggestions/configuration/autoapproval/toggle - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/suggestions/configuration/autoapproval/toggle - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/suggestions/configuration/autoapproval/toggle - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/suggestions/configuration/autoapproval/toggle - Schema is valid", function () { + const schema = {"type":"object","properties":{"Enabled":{"type":"boolean","description":"If the autoapprove setting is active for a given seller (`true`) or not (`false`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint can be used to check whether the autoapprove setting is active or not, for a specific seller. + + If the response is `true`, the autoapprove setting is active. If the response is `false`, it is inactive. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `sellerId` | query | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "Enabled": false + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get seller's approval settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get seller's approval settings.yml new file mode 100644 index 0000000000..e024fb3a81 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Get seller's approval settings.yml @@ -0,0 +1,122 @@ +info: + name: Get seller's approval settings + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/suggestions/configuration/seller/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/suggestions/configuration/seller/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/suggestions/configuration/seller/:sellerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/suggestions/configuration/seller/:sellerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/suggestions/configuration/seller/:sellerId - Schema is valid", function () { + const schema = {"type":"object","description":"Represents the approval settings configured for a specific seller within the marketplace. This object includes details about the seller, their account, and how SKUs are mapped and approved.","properties":{"sellerId":{"type":"string","description":"A string that identifies the seller in the marketplace."},"accountId":{"type":"string","description":"Marketplace’s account ID."},"accountName":{"type":"string","description":"Marketplace’s account name."},"mapping":{"type":"object","default":{},"description":"SKU mapping information and product [specifications](https://developers.vtex.com/docs/guides/catalog-overview#configuring-initial-settings-mandatory).\n\n The properties included within `mapping` can change according to the product type, the `color` specification and its variations described in this example are just one of the possibilities. The values received in this call's payload for those properties depend on the seller's catalog architecture, and are not default. \n\nSee some examples of specifications: \n\n- Voltage \n\n- Power \n\n- Size \n\n- Height \n\n- Width.","properties":{"defaultColor":{"type":"string","description":"The field will indicate the default color predefined by the seller in cases where specific product colors are not defined. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."},"searchColor":{"type":"string","description":"Field that provides the available colors to filter searches. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."},"color1":{"type":"string","description":"`color1` available for search filter. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."},"color2":{"type":"string","description":"`color2` available for search filter. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."},"color":{"type":"string","description":"Indicates the predominant or main color of the product. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."},"size":{"type":"string","description":"Indicates the size of the product. This field is neither mandatory nor default, it will depend on the architecture of the seller's catalog."}}},"matchFlux":{"type":"string","description":"This field determines the type of [approval configuration applied to SKUs received from a seller](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/seller/-sellerId-). \n\nThe possible values include: \n\n-`default`, where the Matcher reviews the SKU, and approves it based on its score. \n\n-`manual`, for manual approvals through the Received SKU UI and Match API. \n\n-`autoApprove`, for every SKU received from a given seller to be approved automatically, regardless of the Matcher Score."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves the current Received SKUs approval settings applied to a specific seller. Its response includes: + + - `sellerId`: A string that identifies the seller in the marketplace. + + - `accountId`: Marketplace’s account ID. + + - `accountName`: Marketplace’s account name. + + - `mapping`: Mapping of SKU and product Specifications. + + - `matchFlux`: This field determines the type of approval configuration applied to SKUs received from a seller. + + The possible values include: + + -`default`, where the Matcher reviews the SKU, and approves it based on its score. + + -`manual`, for manual approvals through the Received SKU UI and Match API. + + -`autoApprove`, for every SKU received from a given seller to be approved automatically, regardless of the Matcher Score. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + |Mapper| Suggestion resources| **Mapper**| + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "sellerId": "sellerexample", + "accountId": "d74dau71f-325a-4463-bd53-ae8b0453186ca", + "accountName": "marketplaceexample", + "mapping": { + "defaultColor": "white /black", + "searchColor": "color1, color2", + "color1": "black", + "color2": "white", + "color": "black", + "size": "EUR44" + }, + "matchFlux": "autoApprove" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save account's approval settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save account's approval settings.yml new file mode 100644 index 0000000000..2c4f264adf --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save account's approval settings.yml @@ -0,0 +1,142 @@ +info: + name: Save account's approval settings + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/configuration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "Score": { + "Approve": 80, + "Reject": 30 + }, + "Matchers": [ + { + "MatcherId": "vtex-matcher", + "hook-base-address": "http://simple-suggestion-matcher.vtex.com.br", + "IsActive": true, + "UpdatesNotificationEndpoint": null, + "Description": null + } + ], + "SpecificationsMapping": [ + "color=red", + "size=L" + ], + "MatchFlux": "autoApprove" + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/suggestions/configuration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/suggestions/configuration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/suggestions/configuration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/suggestions/configuration - Schema is valid", function () { + const schema = {"type":"object","description":"Response object for the Save Accounts Approval Settings endpoint.","properties":{"Score":{"type":"object","description":"[Matcher's rates](https://help.vtex.com/en/tutorial/understanding-vtex-matcher-scoring) to approve or reject [received SKUs](https://help.vtex.com/en/tutorial/cataloging-received-skus--tutorials_396) sent by sellers.","properties":{"Approve":{"type":"integer","description":"Score to approve SKUs sent by sellers."},"Reject":{"type":"integer","description":"Score to reject SKUs sent by sellers."}}},"Matchers":{"type":"array","description":"[Matchers](https://help.vtex.com/en/tutorial/understanding-vtex-matcher-scoring) configurations for approving and rejecting [received SKUs](https://help.vtex.com/en/tutorial/cataloging-received-skus--tutorials_396) sent by sellers.","items":{"type":"object","description":"Details of a matcher used for scoring and managing SKUs approvals and rejections.","properties":{"MatcherId":{"type":"string","description":"Identifies the matching entity. It can be either [VTEX's matcher](https://help.vtex.com/en/tutorial/understanding-vtex-matcher-scoring), or an external matcher."},"hook-base-address":{"type":"string","description":"The given matcher's URL."},"IsActive":{"type":"boolean","description":"Whether the matcher is active in the account (`true`), or not (`false`)."},"UpdatesNotificationEndpoint":{"type":"string","description":"The [received SKUs](https://help.vtex.com/en/tutorial/cataloging-received-skus--tutorials_396) module calls this endpoint for matcher's suggestions updates."},"Description":{"type":"string","description":"The note inserted on the request body."}}}},"Rules":{"type":"object","description":"Items and products that belong to sellers.","properties":{"Item":{"type":"array","description":"SKUs' ID.","items":{"type":"integer","description":"SKU ID."}},"Product":{"type":"array","description":"Product's name.","items":{"type":"string","description":"Product name."}}}},"SpecificationsMapping":{"type":"array","description":"This attribute maps product and SKU's specifications between the marketplace and the seller.","items":{"type":"object","description":"Object representing a single specification mapping between the marketplace and the seller.","properties":{"SellerId":{"type":"string","description":"The seller ID."},"Mapping":{"type":"object","description":"The attributes and values mapped between the marketplace and the seller."}}}},"MatchFlux":{"type":"string","description":"Type of approval configuration that apply to received SKUs sent by sellers. The possible values are: \n\n`default`: The matcher approves the SKU. \n\n`manual`: Manual SKU's approvals. \n\n`AutoApprove`: Automatic SKU's approvals."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Marketplaces use this endpoint to create or update approval settings on their Received SKUs module. + + The request includes all the details necessary to implement the chosen approval settings. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "Score": { + "Approve": 80, + "Reject": 30 + }, + "Matchers": [ + { + "MatcherId": "vtex-matcher", + "hook-base-address": "http://simple-suggestion-matcher.vtex.com.br", + "IsActive": true, + "UpdatesNotificationEndpoint": "notification.endpoint", + "Description": "Note" + } + ], + "Rules": { + "Item": [ + 1 + ], + "Product": [ + "Shirt" + ] + }, + "SpecificationsMapping": [ + { + "SellerId": "Store1", + "Mapping": { + "Yellow": "Light yellow" + } + } + ], + "MatchFlux": "autoApprove" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save seller's approval settings.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save seller's approval settings.yml new file mode 100644 index 0000000000..dcd8ecd1a7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/Save seller's approval settings.yml @@ -0,0 +1,72 @@ +info: + name: Save seller's approval settings + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/suggestions/configuration/seller/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "sellerId": "1a", + "mapping": null, + "matchFlux": "Default" + } + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/suggestions/configuration/seller/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Marketplaces use this endpoint to create or update approval settings to a specific seller, on the Received SKUs module. + + The request includes all the details necessary to implement the chosen approval settings. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | ---------- | ------------ | ------------ | + | Channels | UI resources | **Save suggestion rules** | + | Suggestion| Suggestion resources | **Main access** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/folder.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/folder.yml new file mode 100644 index 0000000000..ebb3b9cc89 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/SKU approval settings/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU approval settings + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/environments/VTEX.yml new file mode 100644 index 0000000000..b3ec478f51 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/environments/VTEX.yml @@ -0,0 +1,14 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://api.vtex.com/{{accountName}} + - name: matcherid + value: "" + - name: productRef + value: "" + - name: score + value: "" + - name: skuid + value: "" diff --git a/BrunoCollections/VTEX - Marketplace APIs - Suggestions/opencollection.yml b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/opencollection.yml new file mode 100644 index 0000000000..fcf6942fd5 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs - Suggestions/opencollection.yml @@ -0,0 +1,95 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace APIs - Suggestions + +docs: + content: |- + The **Marketplace API** enables marketplaces and sellers hosted on VTEX to perform their collaborative operations. + + >⚠️ The marketplace must [create an appKey and appToken](https://developers.vtex.com/docs/guides/getting-started-authentication) for each non-VTEX seller that will use this API. + + ## Index + + ### Notification + + Endpoints used by sellers to notify marketplaces that the price or inventory language has changed for one of their SKUs. + + `POST` [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) + + `POST` [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory) + + + ### Suggestions + + #### Get Suggestions + + Search and filter all suggestions using specific criteria. + + `GET` [Get all SKU Suggestions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions) + + `GET` [Get SKU Suggestion by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Manage Suggestions + + Send or delete SKU suggestions from the seller to marketplace. + + `PUT` [Send SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerSkuId-) + + `DELETE` [Delete SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#delete-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Get Versions + + Search and filter all versions of suggestions, using specific criteria. + + `GET` [Get all versions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions) + + `GET` [Get version by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions/-version-) + + + #### Match Received SKUs + + Match SKU suggestions received in the marketplace. + + `PUT` [Match Received SKUs individually](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerskuid-/versions/-version-/matches/-matchid-) + + `PUT` [Match Multiple Received SKUs](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/matches/action/-actionName-) + + + #### SKU Approval Settings + + Allows marketplaces to configure rules for automatically and manually approving SKUs received from sellers. + + `GET`[Get autoApprove Status in Account Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/autoapproval/toggle) + + `PUT`[Activate autoApprove in Marketplace's Account](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle) + + `GET`[Get Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration) + + `PUT`[Save Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration) + + `GET`[Get Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Save Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Activate autoApprove Setting for a Seller](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle/seller/-sellerId-) + + + ### Matched Offers + + Offers are seller products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + `GET`[Get Matched Offers List](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/offers) + + `GET`[Get Matched Offer's Data by SKU ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-/sku/-skuId-) + + `GET`[Get Matched Offer's Data by Product ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Delete affiliate by ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Delete affiliate by ID.yml new file mode 100644 index 0000000000..00c9a7961e --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Delete affiliate by ID.yml @@ -0,0 +1,70 @@ +info: + name: Delete affiliate by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/fulfillment/pvt/affiliates/:affiliateId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: affiliateId + value: LNG + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/fulfillment/pvt/affiliates/:affiliateId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/fulfillment/pvt/affiliates/:affiliateId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the specified [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) configuration by ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save Order Configuration** | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `affiliateId` | path | (Required) Three-letter identifier defined during the affiliate configuration creation. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Get affiliate by ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Get affiliate by ID.yml new file mode 100644 index 0000000000..87802b692c --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Get affiliate by ID.yml @@ -0,0 +1,105 @@ +info: + name: Get affiliate by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/fulfillment/pvt/affiliates/:affiliateId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: affiliateId + value: LNG + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/fulfillment/pvt/affiliates/:affiliateId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/fulfillment/pvt/affiliates/:affiliateId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/fulfillment/pvt/affiliates/:affiliateId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/fulfillment/pvt/affiliates/:affiliateId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"description":"Three-letter identifier defined during the affiliate configuration creation. Vowels are not allowed.","type":"string"},"followUpEmail":{"description":"Email address in which the user will receive notifications about the integration.","type":"string"},"useSellerPaymentMethod":{"description":"Indicates if the store uses the payment split, seller payment method, (`true`) or not (`false`). Recommended for use only in VTEX-with-VTEX integrations because of compatibility of payment methods.","type":"boolean"},"name":{"description":"Affiliate name.","type":"string"},"salesChannel":{"description":"Number of the sales channel that will define the catalog assortment, prices, and the shipping strategy of items sent to the marketplace.","type":"string"},"searchURIEndpoint":{"description":"URL of the application that will receive products, price, and inventory notifications, among others. The Search Endpoint should be filled with the value: `http://productnotification.vtexcommerce.com.br/api/notification/{NameOfMarketplace}/{SellerID}`. For [external marketplaces](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-an-external-marketplace), fill in the value: `https://{endpointDoAfiliado}/api/notification/`. Learn more in our article [How to confugure the affiliate endpoint](https://developers.vtex.com/docs/guides/external-marketplace-integration-price-update#how-to-configure-the-affiliate-endpoint).","type":["string","null"]},"searchURIEndpointVersion":{"description":"Search URI endpoint version. The default option is the only one available.","type":"string","default":"1.x.x."},"searchURIEndpointAvailableVersions":{"description":"Search URI endpoint available versions.","type":"array","items":{"description":"Search URI endpoint available version. The default option is the only one available.","type":"string","default":"1.x.x."}},"minimumValueAccumulated":{"description":"Minimum value accumulated in the cart to checkout the order.","type":["integer","null"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the specified [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) configuration by affiliate ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save Order Configuration** | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `affiliateId` | path | (Required) Three-letter identifier defined during the affiliate configuration creation. Vowels are not allowed. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "LNG", + "followUpEmail": "your@email.com", + "useSellerPaymentMethod": false, + "name": "Lengow", + "salesChannel": "1", + "searchURIEndpoint": null, + "searchURIEndpointVersion": "1.x.x", + "searchURIEndpointAvailableVersions": [ + "1.x.x" + ], + "minimumValueAccumulated": 5000 + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Affiliates/List affiliates.yml b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/List affiliates.yml new file mode 100644 index 0000000000..710326b60e --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/List affiliates.yml @@ -0,0 +1,129 @@ +info: + name: List affiliates + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/fulfillment/pvt/affiliates" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/fulfillment/pvt/affiliates - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/fulfillment/pvt/affiliates - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/fulfillment/pvt/affiliates - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/fulfillment/pvt/affiliates - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"[Affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) information.","type":"object","properties":{"id":{"description":"Three-letter identifier defined during the affiliate configuration creation. Vowels are not allowed.","type":"string"},"followUpEmail":{"description":"Email address in which the user will receive notifications about the integration.","type":"string"},"useSellerPaymentMethod":{"description":"Indicates if the store uses the payment split, seller payment method, (`true`) or not (`false`). Recommended for use only in VTEX-with-VTEX integrations because of compatibility of payment methods.","type":"boolean"},"name":{"description":"Affiliate name.","type":"string"},"salesChannel":{"description":"Number of the sales channel that will define the catalog assortment, prices, and the shipping strategy of items sent to the marketplace.","type":"string"},"searchURIEndpoint":{"description":"URL of the application that will receive products, price, and inventory notifications, among others. The Search Endpoint should be filled with the value: `http://productnotification.vtexcommerce.com.br/api/notification/{NameOfMarketplace}/{SellerID}`. For [external marketplaces](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-an-external-marketplace), fill in the value: `https://{endpointDoAfiliado}/api/notification/`. Learn more in our article [How to confugure the affiliate endpoint](https://developers.vtex.com/docs/guides/external-marketplace-integration-price-update#how-to-configure-the-affiliate-endpoint).","type":["string","null"]},"searchURIEndpointVersion":{"description":"Search URI endpoint version. The default option is the only one available.","type":"string","default":"1.x.x."},"searchURIEndpointAvailableVersions":{"description":"Search URI endpoint available versions.","type":"array","items":{"description":"Search URI endpoint available version. The default option is the only one available.","type":"string","default":"1.x.x."}},"minimumValueAccumulated":{"description":"Minimum value accumulated in the cart to checkout the order.","type":["integer","null"]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) configurations in a store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save Order Configuration** | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "id": "LNG", + "followUpEmail": "your@email.com", + "useSellerPaymentMethod": false, + "name": "Lengow", + "salesChannel": "1", + "searchURIEndpoint": null, + "searchURIEndpointVersion": "1.x.x", + "searchURIEndpointAvailableVersions": [ + "1.x.x" + ], + "minimumValueAccumulated": 5000 + }, + { + "id": "CNT", + "followUpEmail": "email@email.com", + "useSellerPaymentMethod": false, + "name": "Centauro - lojadobreno", + "salesChannel": "2", + "searchURIEndpoint": "http://centaurointegration.vtexinternal.com.br/api/centaurointegration/indexedstockkeepingunit?an=lojadobreno", + "searchURIEndpointVersion": "1.x.x", + "searchURIEndpointAvailableVersions": [ + "1.x.x" + ], + "minimumValueAccumulated": 1000 + }, + { + "id": "MLC", + "followUpEmail": null, + "useSellerPaymentMethod": false, + "name": "Mercado Livre - lojadobreno - gold_special", + "salesChannel": "2", + "searchURIEndpoint": "http://meliintegration.vtexinternal.com/api/meliintegration/commercialcondition?an=lojadobreno<=gold_special", + "searchURIEndpointVersion": "1.x.x", + "searchURIEndpointAvailableVersions": [ + "1.x.x" + ], + "minimumValueAccumulated": 2000 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Update affiliate by ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Update affiliate by ID.yml new file mode 100644 index 0000000000..f198fe8bd8 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/Update affiliate by ID.yml @@ -0,0 +1,84 @@ +info: + name: Update affiliate by ID + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/fulfillment/pvt/affiliates/:affiliateId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: affiliateId + value: LNG + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "followUpEmail": "example@email.com", + "name": "Affiliate name", + "salesChannel": "1", + "searchURIEndpoint": "", + "searchURIEndpointVersion": "1.x.x", + "searchURIEndpointAvailableVersions": [ + "1.x.x" + ], + "minimumValueAccumulated": 5000 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/fulfillment/pvt/affiliates/:affiliateId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/fulfillment/pvt/affiliates/:affiliateId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) configuration by ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Save Order Configuration** | + | Checkout | CheckoutResources | **Save OrderForm Configuration** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `affiliateId` | path | (Required) Three-letter identifier defined during the affiliate configuration creation. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Affiliates/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/folder.yml new file mode 100644 index 0000000000..46c73f7238 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Affiliates/folder.yml @@ -0,0 +1,4 @@ +info: + name: Affiliates + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers list.yml b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers list.yml new file mode 100644 index 0000000000..5eaf303c0a --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers list.yml @@ -0,0 +1,172 @@ +info: + name: Get matched offers list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/offer-manager/pvt/offers" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sort + value: availability,desc + type: query + disabled: true + - name: rows + value: "20" + type: query + disabled: true + - name: start + value: "0" + type: query + disabled: true + - name: fq + value: skuId:172 + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/offer-manager/pvt/offers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/offer-manager/pvt/offers - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/offer-manager/pvt/offers - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/offer-manager/pvt/offers - Schema is valid", function () { + const schema = {"type":"array","description":"Response with the list of offers available on the Marketplace.","items":{"type":"object","description":"Array of SKUs in the offer.","properties":{"LastModified":{"type":"string","description":"Last date when the offer was modified."},"ProductId":{"type":"string","description":"Unique identifier of the seller's product. This is the ID that the marketplace will use for all references to this product."},"CategoryId":{"type":"integer","description":"Offer's Category ID that the product belongs to, configured in the Catalog. It should be the marketplace's category chosen for the offer to be matched with."},"BrandId":{"type":"integer","description":"Offer's brand ID that the product belongs to, configured in the Catalog. It should be the marketplace's brand chosen for the offer to be matched with."},"ProductName":{"type":"string","description":"Name of the offer's product."},"Skus":{"type":"array","description":"A list of SKUs (Stock Keeping Units) associated with the product. Each SKU contains detailed information about specific variants of the product, such as color, size, and other specifications.","items":{"description":"Details of the SKU (Stock Keeping Unit) associated with the product. This includes the SKU ID, EAN ID, reference ID, complete name, short name, active status, main image, and offers.","required":["SkuId","EanId","RefId","NameComplete","Name","IsActive","MainImage","Offers"],"type":"object","properties":{"SkuId":{"type":"string","description":"SKU's unique identifier number."},"EanId":{"type":["string","null"],"description":"EAN's unique identifier number."},"RefId":{"type":["string","null"],"description":"SKU's Reference ID."},"NameComplete":{"type":"string","description":"Complete name of the SKU."},"Name":{"type":"string","description":"Summarized name of the SKU."},"IsActive":{"type":"boolean","description":"Whether the SKU is active in the trade policy (true), or not (false).","default":true},"MainImage":{"type":"object","description":"Main image's information.","items":{"description":"Details of the main image associated with the product. This includes the image's ID, label, tag, path, and other attributes indicating its main and zoom size status, as well as additional text and last modification date.","required":["ImageId","ImageLabel","ImageTag","ImagePath","IsMain","IsZoomSize","ImageText","LastModified"],"type":"object","properties":{"ImageId":{"type":"string","description":"Code identifying the image's file."},"ImageLabel":{"type":["string","null"],"description":"Image's label."},"ImageTag":{"type":"string","description":"HTML tag for the selected image."},"ImagePath":{"type":"string","description":"Path for the image's file."},"IsMain":{"type":"boolean","description":"Whether the image is the main one or not.","default":true},"IsZoomSize":{"type":"boolean","description":"If zoom can be applied to the image.","default":true},"ImageText":{"type":"string","description":"Alt text for the image."},"LastModified":{"type":"string","description":"Date of the last change made to the image."}}}},"Offers":{"type":"array","items":{"description":"Details of an offer provided by a seller. This includes the seller's identification, SKU, offers per sales channel, and available trade policies.","required":["SellerId","SellerSkuId","OffersPerSalesChannel","AvailableSalesChannels"],"type":"object","properties":{"SellerId":{"type":"string","description":"ID of the seller in the marketplace. This ID must be created by the marketplace."},"SellerSkuId":{"type":"string","description":"Unique identifier of the SKU in the seller. This is the ID that the marketplace will use for future references to this SKU, such as price and inventory notifications."},"OffersPerSalesChannel":{"type":"array","description":"Each element in the array corresponds to an offer in a specific trade policy.","items":{"title":"OffersPerSalesChannel","description":"Details of offers available per trade policy. This includes pricing information and available quantity specific to each trade policy.","required":["SaleChannel","Price","ListPrice","PriceWithoutDiscount","AvailableQuantity"],"type":"object","properties":{"SaleChannel":{"type":"integer","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) of the SKU."},"Price":{"type":"integer","description":"SKU's price."},"ListPrice":{"type":"integer","description":"SKU's suggested selling price."},"PriceWithoutDiscount":{"type":"integer","description":"SKU's price without discount applied."},"AvailableQuantity":{"type":"integer","description":"Available SKU stock quantity."}}}},"AvailableSalesChannels":{"type":["string","null"],"description":"The sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID in which the SKU is available."}}},"description":"Array with offers."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Offers are seller's products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + This endpoint retrieves the available offers in a marketplace. It differs from the Get Suggestions endpoints, since it retrieves products that were already matched by the marketplace, and are currently in its catalog. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sort` | query | Criteria used to sort the list of offers. For sorting values in ascending order, use `asc`, while for descending order, use `desc`. To fill in the field, insert the sorting criteria, followed by 'asc', or 'desc', separated by a comma. You can sort by the following criteria: - **price:** sorts offers by price. *Ascending* goes from lowest to highest price, while *Descending* goes from highest to lowest price. - **name:** sorts offers by *productName*, in alphabetical order. *Ascending* goes from *A* to *Z*, while *Descending* goes from *Z* to *A*. - **availability:** availability in the sales channel (sc). The default value is 1. Ex. sort=availability,desc Ex. sort=name,asc Ex. price,desc | + | `rows` | query | Number of rows included in the response. Each row corresponds to a single offer. The default amount of rows in the response is 1, and the maximum amount is 50. To have more than one offer listed in the response, please add the `rows` parameter with a number greater than 1. | + | `start` | query | Number corresponding to the row from which the offer list will begin, used for pagination. Filters the list of offers by retrieving the offers starting from the row defined. The default value is 0, if the param is not included in the call. | + | `fq` | query | This filter query can be used to filter offers by the criteria described below. It should be filled in by following the format: `fq={{criteriaName}}:{{criteriaValue}}`. - **productId:** integer of the product ID - **productName:** string of the product's name - **skuId:** integer of the SKU ID - **eanId:** string of the EAN ID - **refId:** string of the Ref ID - **categoryId:** integer of the category ID - **brandId:** integer of the brand ID - **sellerId:** string of the seller ID - **sc:** integer of the sales channel's ID (trade policy in VTEX) Ex: skuId:172 Ex: categoryId:13 Ex. productName:Product example-123 | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "LastModified": "2021-05-06T21:37:24.262529", + "ProductId": "941947", + "CategoryId": 1563, + "BrandId": 2004291, + "ProductName": "Product Test 04 - Black - 40", + "Skus": [ + { + "SkuId": "1070268", + "EanId": "768655", + "RefId": "1234", + "NameComplete": "Product Test 04 - Black - 40 Color:Black", + "Name": "Color:Black", + "IsActive": true, + "MainImage": { + "ImageId": "53878805", + "ImageLabel": null, + "ImageTag": "\"image-8b4364782e664d76a6ebc8702008e478\"", + "ImagePath": "~/arquivos/ids/53878805-#width#-#height#/image-8b4364782e664d76a6ebc8702008e478.jpg", + "IsMain": true, + "IsZoomSize": true, + "ImageText": "image-8b4364782e664d76a6ebc8702008e478", + "LastModified": "2021-04-06T03:01:30.747" + }, + "Offers": [ + { + "SellerId": "1", + "SellerSkuId": "1070268", + "OffersPerSalesChannel": [ + { + "SaleChannel": 1, + "Price": 0, + "ListPrice": 0, + "PriceWithoutDiscount": 0, + "AvailableQuantity": 0 + } + ], + "AvailableSalesChannels": null + }, + { + "SellerId": "madesacms", + "SellerSkuId": "3298", + "OffersPerSalesChannel": [ + { + "SaleChannel": 0, + "Price": 1200, + "ListPrice": 1200, + "PriceWithoutDiscount": 1200, + "AvailableQuantity": 10000000 + } + ], + "AvailableSalesChannels": null + } + ] + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by SKU ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by SKU ID.yml new file mode 100644 index 0000000000..b4d542612b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by SKU ID.yml @@ -0,0 +1,147 @@ +info: + name: Get matched offers' data by SKU ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/offer-manager/pvt/product/:productId/sku/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "123456" + type: path + - name: skuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/offer-manager/pvt/product/:productId/sku/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/offer-manager/pvt/product/:productId/sku/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/offer-manager/pvt/product/:productId/sku/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/offer-manager/pvt/product/:productId/sku/:skuId - Schema is valid", function () { + const schema = {"description":"Array of matched offers data by SKU.","type":"array","items":{"type":"object","description":"Schema for individual offer data.","properties":{"productId":{"type":"string","description":"Unique identifier for the product."},"skuId":{"type":"string","description":"Unique identifier for the product SKU."},"nameComplete":{"type":"string","description":"Complete name of the product."},"mainImage":{"type":"object","description":"Schema for the main product image.","required":["imagePath"],"properties":{"imagePath":{"type":"string","description":"File path of the main product image."}}},"sellersOffers":{"type":"array","description":"Array of offers from different sellers.","items":{"type":"object","description":"Schema for individual seller offer data.","properties":{"sellerId":{"type":"string","description":"Unique identifier for the seller."},"sellerSkuId":{"type":"string","description":"Unique identifier for the seller's SKU."},"salesChannelOffer":{"type":"array","description":"Array of offers on different trade policies from the same seller.","items":{"type":"object","description":"Schema for individual trade policy offer data.","properties":{"salesChannelId":{"type":"string","description":"Unique identifier for the trade policy."},"salesChannelName":{"type":"string","description":"Name of the trade policy."},"price":{"type":"number","description":"Offer price."},"listPrice":{"type":"number","description":"List price of the product."},"priceWithoutDiscount":{"type":"number","description":"Offer price without any discount."},"availableQuantity":{"type":"integer","description":"Available quantity of the product."}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Offers are seller products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + This endpoint retrieves the available offers for a speciic SKU ID in the marketplace's catalog. It differs from the [Get Suggestions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions/#get-/suggestions) endpoints, since it retrieves products that were already matched by the marketplace operator, and are currently active in its catalog. + + The call returns a list of offers for that ID, that contain the following data: + + - Seller that sells the SKU + + - Correspondent SKU ID + + - SKU's price value + + - Inventory level + + - Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/como-funciona-uma-politica-comercial--6Xef8PZiFm40kg2STrMkMV#master-data)) that it is available at. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) A string that identifies the seller's product. This is the ID that the marketplace will use for all references to this product, such as price and inventory notifications. | + | `skuId` | path | (Required) A string that identifies the seller's SKU that suffered the change. This is the ID that the marketplace will use for all references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "productId": "1561208", + "skuId": "1559161", + "nameComplete": "Long sleeve cardigan - Women - Grey - L", + "mainImage": { + "imagePath": "~/arquivos/ids/8567753-#width#-#height#/image-05b40d3167b5b7ed42285124f6862f12.jpg" + }, + "sellersOffers": [ + { + "sellerId": "1", + "sellerSkuId": "1559161", + "salesChannelOffer": [ + { + "salesChannelId": "1", + "salesChannelName": "Principal", + "price": 49.99, + "listPrice": 59.99, + "priceWithoutDiscount": 49.99, + "availableQuantity": 8 + }, + { + "salesChannelId": "2", + "salesChannelName": "Online Store", + "price": 47.99, + "listPrice": 59.99, + "priceWithoutDiscount": 47.99, + "availableQuantity": 12 + } + ] + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by product ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by product ID.yml new file mode 100644 index 0000000000..f69f00b68b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/Get matched offers' data by product ID.yml @@ -0,0 +1,155 @@ +info: + name: Get matched offers' data by product ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/offer-manager/pvt/product/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "123456" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/offer-manager/pvt/product/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/offer-manager/pvt/product/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/offer-manager/pvt/product/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/offer-manager/pvt/product/:productId - Schema is valid", function () { + const schema = {"type":"array","description":"Array of matched offers data by product ID.","items":{"type":"object","description":"Schema for individual offer data.","properties":{"productId":{"type":"string","description":"Unique identifier for the product."},"skuId":{"type":"string","description":"Unique identifier for the product SKU."},"nameComplete":{"type":"string","description":"Complete name of the product."},"mainImage":{"type":"object","description":"Schema for the main product image.","required":["imagePath"],"properties":{"imagePath":{"type":"string","description":"File path of the main product image."}}},"sellersOffers":{"type":"array","description":"Array of offers from different sellers.","items":{"type":"object","description":"Schema for individual seller offer data.","properties":{"sellerId":{"type":"string","description":"Unique identifier for the seller."},"sellerSkuId":{"type":"string","description":"Unique identifier for the seller's SKU."},"salesChannelOffer":{"type":"object","description":"Schema for the offer data on a specific sales channel (trade policy).","properties":{"salesChannelId":{"type":"string","description":"Unique identifier for the sales channel (trade policy)."},"salesChannelName":{"type":"string","description":"Name of the trade policy."},"price":{"type":"number","description":"Offer price."},"listPrice":{"type":"number","description":"List price of the product."},"priceWithoutDiscount":{"type":"number","description":"Offer price without any discount."},"availableQuantity":{"type":"integer","description":"Available quantity of the product."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Offers are seller products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + This endpoint retrieves the available offers for a speciic Product ID in the marketplace's catalog. It differs from the Get Suggestions endpoints, since it retrieves products that were already matched by the marketplace operator, and are currently active in its catalog. + + The call returns a list of offers for that ID, that contain the following data: + + - Seller that sells the SKU + + - Correspondent SKU ID + + - SKU's price value + + - Inventory level + + - Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/como-funciona-uma-politica-comercial--6Xef8PZiFm40kg2STrMkMV#master-data)) that it is available at. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) A string that identifies the seller's product. This is the ID that the marketplace will use for all references to this product, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "productId": "1561208", + "skuId": "1559161", + "nameComplete": "Long sleeve cardigan - Women - Grey - L", + "mainImage": { + "imagePath": "~/arquivos/ids/8567753-#width#-#height#/image-05b40d3167b5b7ed42285124f6862f12.jpg" + }, + "sellersOffers": [ + { + "sellerId": "1", + "sellerSkuId": "1559161", + "salesChannelOffer": { + "salesChannelId": "1", + "salesChannelName": "Principal", + "price": 0, + "listPrice": 0, + "priceWithoutDiscount": 0, + "availableQuantity": 0 + } + } + ] + }, + { + "productId": "1561208", + "skuId": "1559163", + "nameComplete": "Long sleeve cardigan - Women - Grey - XS", + "mainImage": { + "imagePath": "~/arquivos/ids/8567753-#width#-#height#/image-05b40d3167b5b7ed42285124f6862f12.jpg" + }, + "sellersOffers": [ + { + "sellerId": "1", + "sellerSkuId": "1559161", + "salesChannelOffer": { + "salesChannelId": "1", + "salesChannelName": "Principal", + "price": 0, + "listPrice": 0, + "priceWithoutDiscount": 0, + "availableQuantity": 0 + } + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/folder.yml new file mode 100644 index 0000000000..a690bb2ea6 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Matched Offers/folder.yml @@ -0,0 +1,4 @@ +info: + name: Matched Offers + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of inventory update.yml b/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of inventory update.yml new file mode 100644 index 0000000000..d54d3a9c68 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of inventory update.yml @@ -0,0 +1,76 @@ +info: + name: Notify marketplace of inventory update + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/notificator/:sellerId/changenotification/:skuId/inventory" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: skuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/notificator/:sellerId/changenotification/:skuId/inventory - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used by *sellers* to notify marketplaces that the inventory level has changed for one of their SKUs. + + There is no request body in this call, indicating the new inventory level, for instance. It only notifies a specific marketplace (`accountName`) that a seller (`sellerId`) has changed the inventory level of an SKU (`skuId`). + + *Marketplaces* will then call the [fulfillment endpoint](https://developers.vtex.com/vtex-rest-api/reference/fulfillment-simulation) provided in the seller registration form to get the updated inventory information. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `skuId` | path | (Required) A string that identifies the seller's SKU that suffered the change. This is the ID that the marketplace will use for all references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of price update.yml b/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of price update.yml new file mode 100644 index 0000000000..843336d452 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Notification/Notify marketplace of price update.yml @@ -0,0 +1,76 @@ +info: + name: Notify marketplace of price update + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/notificator/:sellerId/changenotification/:skuId/price" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: skuId + value: "1234" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/notificator/:sellerId/changenotification/:skuId/price - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used by *sellers* to notify marketplaces that the price has changed for one of their SKUs. + + There is no request body in this call, indicating the new price value, for instance. It only notifies a specific marketplace (`accountName`) that a seller (`sellerId`) has changed the price of an SKU (`skuId`). + + *Marketplaces* will then call the [fulfillment endpoint](https://developers.vtex.com/vtex-rest-api/reference/fulfillment-simulation) provided in the seller registration form to get the updated price information. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `skuId` | path | (Required) A string that identifies the seller's SKU that suffered the change. This is the ID that the marketplace will use for all references to this SKU, such as price and inventory notifications. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Notification/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Notification/folder.yml new file mode 100644 index 0000000000..ae8077690b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Notification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Notification + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Get sales channel mapping data.yml b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Get sales channel mapping data.yml new file mode 100644 index 0000000000..f8811b8244 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Get sales channel mapping data.yml @@ -0,0 +1,105 @@ +info: + name: Get sales channel mapping data + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/sales-channel/mapping?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"Object representing the mapping between the marketplace's trade policy and the seller's affiliate channel. This allows for the association and management of trade policy between the marketplace and the seller's affiliate.","type":"object","properties":{"marketplaceSalesChannel":{"type":"string","description":"Marketplace's sales channel that will be associated to the seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187).","default":"1"},"sellerChannel":{"type":"string","description":"Seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) that will be associated with the marketplace's sales channel. Through the affiliate, the seller determines which of his sales channel will be used for the mapping.","default":"GCB"}}},"title":"UpsertMapping","properties":{"marketplaceSalesChannel":{"type":"integer","description":"Marketplace's sales channel that will be associated to the seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187).","default":1},"sellerChannel":{"type":"string","description":"Seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) that will be associated with the marketplace's sales channel. Through the affiliate, the seller determines which of his sales channel will be used for the mapping.","default":"GCB"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the mapping between marketplace's sales channels and a specific seller. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Marketplace's account name, the same one inputted on the endpoint's path. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "marketplaceSalesChannel": "1", + "sellerChannel": "GCC" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Upsert sales channel mapping.yml b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Upsert sales channel mapping.yml new file mode 100644 index 0000000000..4882193117 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/Upsert sales channel mapping.yml @@ -0,0 +1,118 @@ +info: + name: Upsert sales channel mapping + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/sales-channel/mapping?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + [ + { + "marketplaceSalesChannel": 1, + "sellerChannel": "GCB" + }, + { + "marketplaceSalesChannel": 2, + "sellerChannel": "DFT" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/seller-register/pvt/sellers/:sellerId/sales-channel/mapping - Schema is valid", function () { + const schema = {"type":"array","items":{"description":"Object that represents the mapping configuration between the marketplace [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) and the seller's affiliate channel. This configuration allows you to associate a marketplace trade policy with a seller's affiliate channel for proper management of trade policies.","type":"object","properties":{"marketplaceSalesChannel":{"type":"string","description":"Marketplace's trade policy that will be associated to the seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187)."},"sellerChannel":{"type":"string","description":"Seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) that will be associated with the marketplace's trade policy. Through the affiliate, the seller determines which of his trade policy will be used for the mapping."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows the marketplace to map its [trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) with a seller's [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187). A seller can have multiple [trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) associated with the same marketplace, creating different affiliates. The mapping allows the seller to segment catalog, pricing, inventory, logistics, and payments in the marketplace. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager capabilities](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) in order to successfully execute this request. Otherwise, they will receive a `403` status code error. These are the applicable capabilities for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with this resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller Manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys typically grants permission to several [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not required, consider creating a custom role. For more information about security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `an` | query | (Required) Marketplace's account name, the same one inputted on the endpoint's path. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "marketplaceSalesChannel": "1", + "sellerChannel": "GCC" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/folder.yml new file mode 100644 index 0000000000..27c4ea7253 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sales Channel Mapping/folder.yml @@ -0,0 +1,4 @@ +info: + name: Sales Channel Mapping + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Get seller commissions by category ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Get seller commissions by category ID.yml new file mode 100644 index 0000000000..08c47f0ee9 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Get seller commissions by category ID.yml @@ -0,0 +1,111 @@ +info: + name: Get seller commissions by category ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/commissions/:categoryId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: categoryId + value: "6" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with the category properties and the commission percentage applied to it.","properties":{"categoryId":{"type":"string","description":"Marketplace's category ID that the product belongs to, configured in the Catalog."},"categoryName":{"type":"string","description":"Category name with applied commission."},"categoryFullPath":{"type":"array","description":"Full path to the SKU's category.","items":{"description":"Category level name.","type":"string"}},"productCommissionPercentage":{"type":"number","description":"Percentage of the comission applied to the product in decimals."},"freightCommissionPercentage":{"type":"number","description":"Percentage of the comission applied to the freight in decimals."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves seller comissions applied to the selected category. It is not necessary to send a request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + |---|---|---| + | Seller Register | Seller administration | View Seller | + | Seller Register | Seller administration | Save Seller | + + | **Role** | **Resource** | + | --------------- | ----------------- | + |Seller manager | View Seller | + |Seller manager | Save Seller | + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with this feature or use one of the predefined roles from the list above. + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace. | + | `categoryId` | path | (Required) ID of the category in which the comission was applied | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. All data extracted, and changes added will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "categoryId": "51", + "categoryName": "Clothes", + "categoryFullPath": [ + "2.0", + "Boys", + "Clothes" + ], + "productCommissionPercentage": 7.75, + "freightCommissionPercentage": 2.33 + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/List seller commissions by seller ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/List seller commissions by seller ID.yml new file mode 100644 index 0000000000..c3a0e67ead --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/List seller commissions by seller ID.yml @@ -0,0 +1,109 @@ +info: + name: List seller commissions by seller ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/commissions" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/seller-register/pvt/sellers/:sellerId/commissions - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects containing information about the category, seller and percentage of commission applied.","items":{"type":"object","description":"Object with the category properties and the commission percentage applied to it.","properties":{"categoryId":{"type":"string","description":"Marketplace's category ID that the product belongs to, configured in the Catalog."},"categoryName":{"type":"string","description":"Category name with applied commission."},"categoryFullPath":{"type":"array","description":"Full path to the SKU's category.","items":{"description":"Category level name.","type":"string"}},"productCommissionPercentage":{"type":"number","description":"Percentage of the comission applied to the product in decimals."},"freightCommissionPercentage":{"type":"number","description":"Percentage of the comission applied to the freight in decimals."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves all comissions configured for a specific seller. It is not necessary to send a request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + |---|---|---| + | Seller Register | Seller adminstration | View Seller | + | Seller Register | Seller administration | Save Seller | + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + |Seller manager | Save Seller | + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with this feature or use one of the predefined roles from the list above. + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "categoryId": "51", + "categoryName": "Clothes", + "categoryFullPath": [ + "2.0", + "Boys", + "Clothes" + ], + "productCommissionPercentage": 7.75, + "freightCommissionPercentage": 2.33 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Remove seller commissions by category ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Remove seller commissions by category ID.yml new file mode 100644 index 0000000000..ebc6726a1b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Remove seller commissions by category ID.yml @@ -0,0 +1,78 @@ +info: + name: Remove seller commissions by category ID + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/commissions/:categoryId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: categoryId + value: "6" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/seller-register/pvt/sellers/:sellerId/commissions/:categoryId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint removes a seller comission on the selected category. + + >❗This action cannot be undone, to reconfigure the commission it is necessary to use the [Upsert Seller Commissions in Bulk endpoint](https://developers.vtex.com/docs/api-reference/marketplace-apis#put-/seller-register/pvt/sellers/-sellerId-/commissions/categories?endpoint=put-/seller-register/pvt/sellers/-sellerId-/commissions/categories). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + |---|---|---| + | Seller Register | Seller administration | Save Seller | + + | **Role** | **Resource** | + | --------------- | ----------------- | + |Seller manager | Save Seller | + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with this feature or use one of the predefined roles from the list above. + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `categoryId` | path | (Required) ID of the category in which the comission was applied | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Upsert seller commissions in bulk.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Upsert seller commissions in bulk.yml new file mode 100644 index 0000000000..d6caeb15e0 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/Upsert seller commissions in bulk.yml @@ -0,0 +1,89 @@ +info: + name: Upsert seller commissions in bulk + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId/commissions" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + [ + { + "categoryId": "6", + "categoryFullPath": null, + "productCommissionPercentage": 9.85, + "freightCommissionPercentage": 2.43 + }, + { + "categoryId": "6", + "categoryFullPath": null, + "productCommissionPercentage": 9.85, + "freightCommissionPercentage": 2.43 + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/seller-register/pvt/sellers/:sellerId/commissions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/seller-register/pvt/sellers/:sellerId/commissions - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used by marketplace operators to define comissions for multiple categories, sending an array with multiple objects in the same call. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + |---|---|---| + | Seller Register | Seller administration | Save Seller | + + | **Role** | **Resource** | + | --------------- | ----------------- | + |Seller manager | Save Seller | + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with this feature or use one of the predefined roles from the list above. + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/folder.yml new file mode 100644 index 0000000000..9c4f8ec254 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Commissions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Seller Commissions + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Accept seller lead.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Accept seller lead.yml new file mode 100644 index 0000000000..dfec4ec99f --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Accept seller lead.yml @@ -0,0 +1,102 @@ +info: + name: Accept seller lead + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/seller-register/pvt/seller-leads/:sellerLeadId" + headers: + - name: Content-Type + value: application/json + params: + - name: sellerLeadId + value: "" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + - name: sellerId + value: seller123 + type: path + body: + type: json + data: |- + { + "sellerEmail": "selleremail@email.com", + "sellerName": "Seller Name", + "sellerAccountName": "seller123", + "salesChannel": "1", + "email": "seller@email.com", + "sellerType": 1, + "accountId": "5fb38ace-d95e-45ad-970d-ee97cce9fbcd", + "document": "12345671000", + "hasAcceptedLegalTerms": true, + "address": { + "postalcode": "12345678", + "complement": "Appartment 1234", + "street": "Park Avenue", + "number": "25", + "neighborhood": "Manhattan", + "state": "RJ", + "city": "Rio de Janeiro" + }, + "accountable": { + "name": "Jane Smith", + "email": "email@email.com", + "phone": "1234567890" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/seller-register/pvt/seller-leads/:sellerLeadId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is triggered by the seller onboarding wizard, once the seller confirms their invitation. It can be used by marketplace operators to manually accept seller leads, and carry on with their onboarding process. + + Note that there's no specific API call that allows status changes. The operations only allow the seller lead to move forward: + + From `invite` > to `Accept` > closing on `[Create seller](https://developers.vtex.com/docs/api-reference/marketplace-apis/#put-/seller-register/pvt/seller-leads/-sellerLeadId-/seller)`. + + If you want to change the status, you can start the process again, by deleting that lead through the *[Delete seller lead](https://developers.vtex.com/docs/api-reference/marketplace-apis/#delete-/seller-register/pvt/seller-leads/-sellerLeadId-)* endpoint, and resending the invite through the *[Resend seller lead's Invite](https://developers.vtex.com/docs/api-reference/marketplace-apis/#put-/seller-register/pvt/seller-leads/-sellerLeadId-/status)* endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Create seller from lead.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Create seller from lead.yml new file mode 100644 index 0000000000..194399b9f6 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Create seller from lead.yml @@ -0,0 +1,84 @@ +info: + name: Create seller from lead + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/seller-register/pvt/seller-leads/:sellerLeadId/seller" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: isActive + value: "false" + type: query + disabled: true + - name: sellerLeadId + value: "" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + - name: sellerId + value: seller123 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/seller-register/pvt/seller-leads/:sellerLeadId/seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used by marketplace operators to create seller accounts. The request will only accept seller leads whose status is `accepted`. If they are already `connected` or `invited`, the call will not be fulfilled. + + >❗ The creation of the account at VTEX is done by an internal Billing service. There is no seller account and marketplace affiliation if you do not go through this step. + + Note that there's no specific API call that allows status changes. The operations only allow the seller lead to move forward: + + From `invite` > to `Accepted` > closing on `Create Seller`. + + If you want to change the status, you can start the process again, by deleting that lead through the *[Delete seller lead](https://developers.vtex.com/docs/api-reference/marketplace-apis#delete-/seller-register/pvt/seller-leads/-sellerLeadId-)* endpoint, and resending the invite through the *[Resend seller lead's invite](https://developers.vtex.com/docs/api-reference/marketplace-apis/#put-/seller-register/pvt/seller-leads/-sellerLeadId-/status)* endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `isActive` | query | Enables to filter sellers that are active (`true`) or unactive (`false`) in the marketplace. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Delete seller lead.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Delete seller lead.yml new file mode 100644 index 0000000000..7c2c6dd6b7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Delete seller lead.yml @@ -0,0 +1,68 @@ +info: + name: Delete seller lead + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/seller-register/pvt/seller-leads/:sellerLeadId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerLeadId + value: id labore + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/seller-register/pvt/seller-leads/:sellerLeadId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint permanently deletes a seller previously invited to the marketplace, only if the seller has not yet accepted the invitation. For sellers who have already accepted the invitation, it is only possible to [pause the seller](https://help.vtex.com/en/tutorial/gerenciamento-de-sellers--6eEiOISwxuAWJ8w6MtK7iv) through the VTEX Admin. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller Manager| Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerLeadId` | path | (Required) ID of the Seller Lead invited to the marketplace. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Get seller lead's data by ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Get seller lead's data by ID.yml new file mode 100644 index 0000000000..934461ebb4 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Get seller lead's data by ID.yml @@ -0,0 +1,87 @@ +info: + name: Get seller lead's data by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/seller-leads/:sellerLeadId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerLeadId + value: "" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + - name: sellerId + value: seller123 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/seller-register/pvt/seller-leads/:sellerLeadId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Marketplace operators may call this endpoint to retrieve information about a specific seller invited to the Seller Portal, by searching through their seller lead ID. To retrieve the chosen seller's `sellerLeadId`, marketplace operators can use the [List Sellers](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/seller-register/pvt/sellers?endpoint=get-/seller-register/pvt/sellers) endpoint's response. Each seller listed includes the following information: + + - `id` + + - `createdAt` + + - `status` + + - `isConnected` + + - `sellerEmail` + + - `sellerName` + + - `salesChannel` + + - `email`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Invite seller lead.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Invite seller lead.yml new file mode 100644 index 0000000000..21399dfdde --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Invite seller lead.yml @@ -0,0 +1,126 @@ +info: + name: Invite seller lead + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/seller-register/pvt/seller-leads" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "sellerEmail": "selleremail@email.com", + "sellerName": "Seller Name", + "sellerAccountName": "seller123", + "salesChannel": "1", + "email": "email@email.com", + "sellerType": 1, + "accountId": "5fb38ace-d95e-45ad-970d-ee97cce9fbcd", + "document": "12345671000", + "hasAcceptedLegalTerms": true, + "address": { + "postalcode": "12345678", + "complement": "Appartment 1234", + "street": "VTEX street", + "number": "25", + "neighborhood": "VTEX quarter", + "state": "RJ", + "city": "Rio de Janeiro" + }, + "accountable": { + "name": "Jane Smith", + "email": "email@email.com", + "phone": "1234567890" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/seller-register/pvt/seller-leads - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/seller-register/pvt/seller-leads - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/seller-register/pvt/seller-leads - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/seller-register/pvt/seller-leads - Schema is valid", function () { + const schema = {"type":"object","description":"Response object for creating a seller lead. It includes details about the created seller, such as their ID, the creation date, and the date of the last update.","properties":{"sellerId":{"type":"string","description":"ID of the created seller."},"createdAt":{"type":"string","description":"Creation date of the seller."},"updatedAt":{"type":"string","description":"Date of the last update of the seller."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This API is used by marketplace operators to invite sellers to join their marketplace. The request sends an email to the seller, inviting sellers to activate their store. The invitation's link in the email is unique per user, and available for only seven days for the seller to click and begin activating their store. + + The email template is completely customizable. All email templates that VTEX sends to seller leads can be found and edited in the marketplace's VTEX Admin, on the Message Center section. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "sellerId": "7890123456", + "createdAt": "2023-01-01T12:34:56Z", + "updatedAt": "2023-01-01T12:34:56Z" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/List seller leads.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/List seller leads.yml new file mode 100644 index 0000000000..70840471fe --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/List seller leads.yml @@ -0,0 +1,104 @@ +info: + name: List seller leads + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/seller-leads?offset=0&limit=15&isConnected=&search=user email&status=invited&orderBy=id labore" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: offset + value: "0" + type: query + - name: limit + value: "15" + type: query + - name: isConnected + value: "" + type: query + - name: search + value: user email + type: query + - name: status + value: invited + type: query + - name: orderBy + value: id labore + type: query + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/seller-register/pvt/seller-leads - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This call's response includes a list of all sellers invited by the marketplace operator to join them. Retrieved results can be filtered by adding optional query fields to the request. Each seller listed includes the following information: + + - `id` + + - `createdAt` + + - `status` + + - `isConnected` + + - `sellerEmail` + + - `sellerName` + + - `salesChannel` + + - `email` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `offset` | query | (Required) This field determines the limit used to retrieve the list of sellers. The response includes objects starting `from` the value inputted here. | + | `limit` | query | (Required) This field determines the limit used to retrieve the list of sellers. The response includes objects until the value inputted here. | + | `isConnected` | query | (Required) Query param that enables results to be filter by whether the seller lead is already connected to the marketplace or not. | + | `search` | query | (Required) Custom search field, that filters sellers invited by specific marketplace operator's email. | + | `status` | query | (Required) Seller Lead's status. Includes `accepted`, `connected` or `invited`. | + | `orderBy` | query | (Required) Query param determining how data will be ordered in the response, ordering by name or ID in descending our ascending order. Includes the following values: `namesort` = desc/asc `idsort` = desc/asc | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Resend seller lead invite.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Resend seller lead invite.yml new file mode 100644 index 0000000000..88823acfd7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/Resend seller lead invite.yml @@ -0,0 +1,77 @@ +info: + name: Resend seller lead invite + type: http + seq: 7 + +http: + method: PUT + url: "{{baseUrl}}/seller-register/pvt/seller-leads/:sellerLeadId/status" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerLeadId + value: "" + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + - name: sellerId + value: seller123 + type: path + body: + type: json + data: |- + { + "status": "accepted" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/seller-register/pvt/seller-leads/:sellerLeadId/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows marketplace operators to resend an invitation to a seller lead who was previously invited to join their marketplace. The request will only accept seller leads whose status is `invited`. If they are already `connected` or `accepted`, the call will not be fulfilled. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/folder.yml new file mode 100644 index 0000000000..4053443a27 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Seller Invite/folder.yml @@ -0,0 +1,4 @@ +info: + name: Seller Invite + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sellers/Configure seller account.yml b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Configure seller account.yml new file mode 100644 index 0000000000..e3b41aa333 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Configure seller account.yml @@ -0,0 +1,130 @@ +info: + name: Configure seller account + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/seller-register/pvt/sellers" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "id": "seller123", + "name": "Seller Name", + "isActive": true, + "fulfillmentEndpoint": "http://{SellerName}.vtexcommercestable.com.br/api/fulfillment?&sc={TradePolicyID}", + "allowHybridPayments": false, + "taxCode": "34444", + "email": "seller@email.com", + "description": "Seller A, from the B industry.", + "sellerCommissionConfiguration": { + "productCommissionPercentage": 3, + "freightCommissionPercentage": 4 + }, + "isBetterScope": true, + "sellerType": 1, + "availableSalesChannels": [ + { + "isSelected": true, + "id": 1, + "name": "Principal store" + }, + { + "isSelected": true, + "id": 2, + "name": "Third" + }, + { + "isSelected": true, + "id": 3, + "name": "Marketplaces" + } + ], + "CSCIdentification": "cscidentification 123", + "account": "partner01", + "channel": "channel name", + "salesChannel": "1", + "isVtex": true, + "score": 0, + "exchangeReturnPolicy": "Describe exchange and returns policy", + "deliveryPolicy": "Describe delivery policy", + "securityPrivacyPolicy": "Our marketplace ensures that all transactions are encrypted with SSL technology, and we adhere to strict privacy standards to protect both sellers and buyers. Personal data is only shared with authorized parties to facilitate order processing and delivery, and we do not sell or disclose personal information to third parties without consent.", + "fulfillmentSellerId": "seller1", + "user": "integrationHubUserName", + "password": "integrationHubPassword", + "catalogSystemEndpoint": "https://apiexamples.vtexcommercestable.com.br/api/catalog_system/", + "trustPolicy": "AllowEmailSharing", + "groups": [ + { + "groups": [ + { + "name": "long tail" + }, + { + "name": "franchise accounts" + } + ] + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/seller-register/pvt/sellers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is used by marketplace operators to configure the accounts of sellers that have already accepted the invitation to join their marketplaces. + + For marketplaces to [add sellers](https://help.vtex.com/en/tutorial/adding-a-seller--tutorials_392) without the [Seller Invite](https://help.vtex.com/en/tutorial/marketplace-invited-sellers--6rb2FkcslmDueJ689Ulb9A) feature, call this endpoint directly. + + This call includes all the information a seller needs to activate their account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sellers/Get seller data by ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Get seller data by ID.yml new file mode 100644 index 0000000000..5150544fc2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Get seller data by ID.yml @@ -0,0 +1,73 @@ +info: + name: Get seller data by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/seller-register/pvt/sellers/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Marketplace operators may call this endpoint to retrieve information about a specific seller by filtering by ID. It is also possible to filter results by sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) through the `sc` query param. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `sc` | query | Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated to the seller account created. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sellers/List sellers.yml b/BrunoCollections/VTEX - Marketplace APIs/Sellers/List sellers.yml new file mode 100644 index 0000000000..4fee554f5c --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sellers/List sellers.yml @@ -0,0 +1,119 @@ +info: + name: List sellers + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/seller-register/pvt/sellers" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: from + value: "0" + type: query + disabled: true + - name: to + value: "100" + type: query + disabled: true + - name: keyword + value: keyword + type: query + disabled: true + - name: integration + value: vtex-seller + type: query + disabled: true + - name: group + value: Group + type: query + disabled: true + - name: isActive + value: "false" + type: query + disabled: true + - name: isBetterScope + value: "false" + type: query + disabled: true + - name: isVtex + value: "false" + type: query + disabled: true + - name: sc + value: "1" + type: query + disabled: true + - name: sellerType + value: "1" + type: query + disabled: true + - name: sort + value: availability,desc + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/seller-register/pvt/sellers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint lists all sellers. The results can be filtered by [trade policies](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) through the `sc` query param. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **View Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | View Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `from` | query | The start number of pagination, being `0` the default value. | + | `to` | query | The end number of pagination, being `100` the default value. | + | `keyword` | query | Search sellers by a keyword in `sellerId` or `sellerName`. | + | `integration` | query | Filters sellers by the name of who made the integration, if VTEX or an external hub. The possible values for VTEX integrations are: `vtex-sellerportal`, `vtex-seller` and `vtex-franchise`. | + | `group ` | query | Groups are defined by keywords that group sellers into categories defined by the marketplace. | + | `isActive` | query | Enables to filter sellers that are active (`true`) or unactive (`false`) in the marketplace. | + | `isBetterScope` | query | The flag `isBetterScope` is used by the VTEX Checkout to simulate shopping carts, products, and shipping only in sellers with the field set as `true`, avoiding performance issues. When used as a query param, `isBetterScope` filters sellers that have the flag set as `true` or `false`. | + | `isVtex` | query | When set as `true`, the list returned will be of sellers who have a VTEX store configured. When set as `false`, the list will be of sellers who do not have a VTEX store configured. | + | `sc` | query | Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated to the seller account created. | + | `sellerType` | query | Filters sellers by their type, which can be regular seller (`1`) or whitelabel seller (`2`). | + | `sort` | query | Criteria used to sort the list of offers. For sorting values in ascending order, use `asc`, while for descending order, use `desc`. To fill in the field, insert the sorting criteria, followed by 'asc', or 'desc', separated by a comma. You can sort by the following criteria: - **price:** sorts offers by price. *Ascending* goes from lowest to highest price, while *Descending* goes from highest to lowest price. - **name:** sorts offers by *productName*, in alphabetical order. *Ascending* goes from *A* to *Z*, while *Descending* goes from *Z* to *A*. - **availability:** availability in the sales channel (sc). The default value is 1. Ex. sort=availability,desc Ex. sort=name,asc Ex. price,desc | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sellers/Update seller by seller ID.yml b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Update seller by seller ID.yml new file mode 100644 index 0000000000..260675f464 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sellers/Update seller by seller ID.yml @@ -0,0 +1,83 @@ +info: + name: Update seller by seller ID + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/seller-register/pvt/sellers/:sellerId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerId + value: seller123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + [ + { + "operation": "replace", + "path": "/field", + "value": false + }, + { + "operation": "replace", + "path": "/field", + "value": false + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/seller-register/pvt/sellers/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows marketplace operators to update the information of sellers connected to their account. You can replace a path's value with another value in order to update that single information. There is no need to fill all the body params available, only the one you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Seller Register | Seller Administration | **Save Seller** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Seller manager | Save Seller | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) A string that identifies the seller in the marketplace. This ID must be created by the marketplace and informed to the seller before the integration is built. | + | `accountName` | path | (Required) Name of the VTEX account that belongs to the marketplace. The notification will be posted into this account. | + | `environment` | path | (Required) Environment to use. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace APIs/Sellers/folder.yml b/BrunoCollections/VTEX - Marketplace APIs/Sellers/folder.yml new file mode 100644 index 0000000000..5e2e2a72de --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/Sellers/folder.yml @@ -0,0 +1,4 @@ +info: + name: Sellers + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace APIs/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace APIs/environments/VTEX.yml new file mode 100644 index 0000000000..decfdf1670 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace APIs/opencollection.yml b/BrunoCollections/VTEX - Marketplace APIs/opencollection.yml new file mode 100644 index 0000000000..621bfead0f --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace APIs/opencollection.yml @@ -0,0 +1,115 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace APIs + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The **Marketplace API** enables marketplaces and sellers hosted on VTEX to perform their collaborative operations. + + >⚠️ The marketplace must [create an appKey and appToken](https://developers.vtex.com/docs/guides/getting-started-authentication) for each non-VTEX seller that will use this API. + + ## Index + + ### Notification + + Endpoints used by sellers to notify marketplaces that the price or inventory language has changed for one of their SKUs. + + `POST` [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) + + `POST` [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory) + + + ### Suggestions + + #### Get Suggestions + + Search and filter all suggestions using specific criteria. + + `GET` [Get all SKU Suggestions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions) + + `GET` [Get SKU Suggestion by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Manage Suggestions + + Send or delete SKU suggestions from the seller to marketplace. + + `PUT` [Send SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerSkuId-) + + `DELETE` [Delete SKU Suggestion](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#delete-/suggestions/-sellerId-/-sellerSkuId-) + + + #### Get Versions + + Search and filter all versions of suggestions, using specific criteria. + + `GET` [Get all versions](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions) + + `GET` [Get version by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/-sellerId-/-sellerskuid-/versions/-version-) + + + #### Match Received SKUs + + Match SKU suggestions received in the marketplace. + + `PUT` [Match Received SKUs individually](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/-sellerId-/-sellerskuid-/versions/-version-/matches/-matchid-) + + `PUT` [Match Multiple Received SKUs](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/matches/action/-actionName-) + + + #### SKU Approval Settings + + Allows marketplaces to configure rules for automatically and manually approving SKUs received from sellers. + + `GET`[Get autoApprove Status in Account Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/autoapproval/toggle) + + `PUT`[Activate autoApprove in Marketplace's Account](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle) + + `GET`[Get Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration) + + `PUT`[Save Account's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration) + + `GET`[Get Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#get-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Save Seller's Approval Settings](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/seller/-sellerId-) + + `PUT`[Activate autoApprove Setting for a Seller](https://developers.vtex.com/docs/api-reference/marketplace-apis-suggestions#put-/suggestions/configuration/autoapproval/toggle/seller/-sellerId-) + + + ### Matched Offers + + Offers are seller products and SKUs that were sent to the marketplace, and already have their price and inventory level configured. + + `GET`[Get Matched Offers List](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/offers) + + `GET`[Get Matched Offer's Data by SKU ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-/sku/-skuId-) + + `GET`[Get Matched Offer's Data by Product ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/offer-manager/pvt/product/-productId-) + + + ### Affiliates + + Every marketplace must correspond to a unique affiliate code for the seller. + + `GET`[List affiliates](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/fulfillment/pvt/affiliates) + + `GET`[Get affiliate by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#get-/fulfillment/pvt/affiliates/-affiliateId-) + + `PUT`[Update affiliate by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#put-/fulfillment/pvt/affiliates/-affiliateId-) + + `DELETE`[Delete affiliate by ID](https://developers.vtex.com/docs/api-reference/marketplace-apis#delete-/fulfillment/pvt/affiliates/-affiliateId-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Full update connector.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Full update connector.yml new file mode 100644 index 0000000000..1385c7888d --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Full update connector.yml @@ -0,0 +1,59 @@ +info: + name: Full update connector + type: http + seq: 10 + +http: + method: PUT + url: "{{baseUrl}}/api/channel-manager/connector/:connectorId?an=apiexemple" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + - name: connectorId + value: "46" + type: path + body: + type: json + data: |- + { + "name": "Mercado Livre Classic", + "website": "mercadolivre.com.br", + "logo": "https://g.foolcdn.com/art/companylogos/square/meli.png", + "description": "Mercado Libre operates online commerce platforms in Latin America. It operates Mercado Libre Marketplace, an automated online commerce platform that enables businesses, merchants, and individuals to list merchandise and conduct sales and purchases online.", + "segment": "OTHERS", + "availableCountries": [ + "BRA", + "ARG" + ], + "connectorVtexAdminPath": "/bridge/#/settings?openConfig=mercadolivre", + "connectorApiEndpoint": "portal.vtexcommercestable.com/api/meliintegration/notifications" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fully updates the connector's information. All required fields must be sent in the body of the request./n/nThis action can only be executed by the account name that owns the connector's registration. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `connectorId` | path | (Required) Connector's ID in Channel Manager, available through the list all connectors route, or in the response of the registration. | + | `an` | query | (Required) VTEX's account name owned by the connector or partner, ex. `apiexemple`. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all channels.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all channels.yml new file mode 100644 index 0000000000..5b860d57c2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all channels.yml @@ -0,0 +1,88 @@ +info: + name: List all channels + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/channel-manager/channel/all?an=accountName" + headers: + - name: Accept + value: application/json + - name: Content-type + value: application/json + params: + - name: an + value: accountName + type: query + - name: enviroment + value: portal.vtexcommercestable.com.br + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/channel-manager/channel/all - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/channel-manager/channel/all - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/channel-manager/channel/all - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/channel-manager/channel/all - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"title":"Id ","description":"The channel id.","type":"integer"},"name":{"title":"Name","description":"The channel name.","type":"string"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request returns a list of channels available channels with their respective IDs for partners external to VTEX. + + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `enviroment` | path | (Required) Environment used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) VTEX's account name owned by the connector/partner. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": 1, + "name": "Mercado Livre" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all connectors.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all connectors.yml new file mode 100644 index 0000000000..641fb42fca --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/List all connectors.yml @@ -0,0 +1,170 @@ +info: + name: List all connectors + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/channel-manager/connector/all?an=apiexemple&pageSize=15" + headers: + - name: accept + value: application/json + - name: content-type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: segment + value: department_stores + type: query + disabled: true + - name: orderByConnectorType + value: "true" + type: query + disabled: true + - name: active + value: "true" + type: query + disabled: true + - name: name + value: Dafiti + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "15" + type: query + - name: country + value: bra + type: query + disabled: true + - name: type + value: vtex + type: query + disabled: true + - name: account + value: cea + type: query + disabled: true + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/channel-manager/connector/all - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/channel-manager/connector/all - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/channel-manager/connector/all - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/channel-manager/connector/all - Schema is valid", function () { + const schema = {"description":"Expected success response from List all connector API.","type":"object","properties":{"metadata":{"title":"metadata","description":"Summary of data returned by the query.","type":"object","properties":{"totalCount":{"description":"Total data returned.","type":"number"},"currentPage":{"description":"Current result page.","type":"number"},"pageSize":{"description":"How many results will be displayed per page.","type":"number"},"totalPages":{"description":"Total pages the query returned.","type":"number"}}},"results":{"description":"Query result with information for each connector.","type":"array","items":{"description":"Connector information.","type":"object","properties":{"id":{"description":"Connector Id.","type":"number"},"name":{"description":"Connector name.","type":"string"},"website":{"description":"Connector website.","type":"string"},"logo":{"description":"URL of the logo used by the connector.","type":"string"},"description":{"description":"Connector presentation.","type":"string"},"helpUrl":{"description":"URL of connector integration documentation page.","type":"string"},"segment":{"description":"Market segment.","type":"string"},"availableCountries":{"description":"List of countries where connector is available for integration.","type":"array","items":{"description":"Country code.","type":"string"}},"availableStates":{"description":"States in which the connector operates, valid only for connectors that have area restriction.","type":"array","items":{"type":"string","description":"State code."}},"type":{"description":"What type of connector, if it is native, VTEX or partner.","type":"string"},"connectorPageUrl":{"description":"URL where the merchant will be redirected to start the onboarding process.","type":"string"},"connectorVtexAdminPath":{"description":"Admin VTEX URL, where the merchant will be redirected to manage and view his connections after integration.","type":"string"},"connectorApiEndpoint":{"description":"Partner Connector API base URL.","type":"string"},"channelId":{"description":"ID of the channel that a connector joins to.","type":"string"},"isGloballyAvailable":{"description":"In which version the connector is available.","type":"boolean"},"ownerVtexAccount":{"description":"Connector account name in VTEX.","type":"string"},"isActive":{"description":"Indicates whether the connector is active (`true`) or not (`false`).","type":"boolean"},"isCertified":{"description":"Indicates whether the connector is certified (`true`) or not (`false`).","type":"boolean"},"contactInfo":{"description":"Seller contact information.","type":"object","properties":{"name":{"description":"Name of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"email":{"description":"Email address of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"phone":{"description":"Phone of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"defaultMessage":{"description":"Introduction message and information of interest in the partnership with the merchant.","type":"string"}}},"isConnectionActive":{"description":"Indicates whether the connection is active (`true`) or not (`false`).","type":"boolean"},"affiliateId":{"description":"Affiliate ID corresponding to the connector.","type":"string"}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a paginated list of all connectors' registered in Channel Manager, taking into consideration the filters informed in the query string of the request. + + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Merchant's account name in VTEX, ex. `apiexemple`. | + | `segment` | query | Filter data by connector's segment. | + | `orderByConnectorType` | query | Order data using a custom logic by connector's' type, and not alphabetically. | + | `active` | query | Filter data by the connector's status. | + | `name` | query | Filter data by the connector's name. | + | `page` | query | Current page to load data from. | + | `pageSize` | query | (Required) Page size to define number of results returned. | + | `country` | query | Filter by connector's country. | + | `type` | query | Filter by connector's type. | + | `account` | query | Filter by connector's owner account. | + | `accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `content-type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "metadata": { + "totalCount": 513, + "currentPage": 1, + "pageSize": 15, + "totalPages": 35 + }, + "results": [ + { + "id": 59, + "name": "4R Comercial Sao Paulo", + "website": "www.comercialsaopaulo.com", + "logo": "https://comercialsaopaulo.vtexassets.com/assets/vtex.file-manager-graphql/logo/619f6f7f-bf67-4ed1-a15a-282b51f81e06___cd0426736f2550559c8688de3378681f.jpg", + "description": "Somos uma empresa sedeada em Barreiras - BA, decidimos entrar no mundo do E Commerce e marketplace há alguns anos, pois já estávamos estabelecidos e sólidos com a nossa loja física em nossa cidade.\nHoje trabalhamos com um portfólio bem diversificado de produtos, que são eles:\n- Linha à bateria\n- Lazer e esporte\n- Camping\n- Ferramentas elétricas\n- Maquinários leves e pesados\n- Ferramentas manuais\n- E muitos outros segmentos\nSua ", + "helpUrl": "help.vtex.com/helpurl", + "segment": "DEPARTMENT_STORES", + "availableCountries": [ + "BRA" + ], + "availableStates": [ + "SP", + "PR", + "BA", + "ES", + "AC" + ], + "type": "VTEX", + "connectorPageUrl": "connector.vtex.com/connectorPageUrl", + "connectorVtexAdminPath": "connector.vtex.com/connectorVtexAdminPath", + "connectorApiEndpoint": "connector.vtex.com/connectorApiEndpoint", + "channelId": "1234", + "isGloballyAvailable": false, + "ownerVtexAccount": "comercialsaopaulo", + "isActive": false, + "isCertified": true, + "contactInfo": { + "name": "Jhon Jones", + "email": "comercialsp@comercialsaopaulo.com", + "phone": "(77) 7777-7777", + "defaultMessage": "Olá, aqui é (...) da (...). Adoraríamos incluir sua loja em nossa vitrine, pois acreditamos que (...). Seguem algumas informações importantes para darmos seguimento à nossa parceria:\n\n1) Nosso marketplace conta as categorias\n- A\n- B\n- C\n\n2) Nossa política de cobrança inclui uma taxa de (...) para cada compra, mais assinatura fixa de (...) por mês. \n\n3) Saiba mais sobre nossa política de devoluções e envio neste link (...)." + }, + "isConnectionActive": false, + "affiliateId": "AFT" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Partial update connector.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Partial update connector.yml new file mode 100644 index 0000000000..f84b1dfe56 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Partial update connector.yml @@ -0,0 +1,51 @@ +info: + name: Partial update connector + type: http + seq: 11 + +http: + method: PATCH + url: "{{baseUrl}}/api/channel-manager/connector/:connectorId?an=apiexemple" + headers: + - name: Accept + value: application/json + - name: Content-type + value: application/json-patch+json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + - name: connectorId + value: "46" + type: path + body: + type: json + data: |- + { + "path": "/segment", + "op": "replace", + "value": "DEPARTMENT_STORES" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates the connector's information. The payload follows the format defined by RFC 6902, where a list of operations is informed, including the path of the field inside the object and its value./n/nThis action can only be executed by the account name that owns the connector's registration. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `connectorId` | path | (Required) Connector's ID in Channel Manager, available through the list all connectors route, or in the response of the registration. | + | `an` | query | (Required) VTEX's account name owned by the connector/partner, ex. `apiexemple`. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-type` | header | (Required) Required header to indicate the request is a PATCH. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Register connector.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Register connector.yml new file mode 100644 index 0000000000..21aeb53f20 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Register connector.yml @@ -0,0 +1,155 @@ +info: + name: Register connector + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/channel-manager/connector?an=apiexemple" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + [ + { + "name": "Mercado Livre Classic", + "website": "mercadolivre.com.br", + "logo": "https://g.foolcdn.com/art/companylogos/square/meli.png", + "description": "Mercado Libre operates online commerce platforms in Latin America. It operates Mercado Libre Marketplace, an automated online commerce platform that enables businesses, merchants, and individuals to list merchandise and conduct sales and purchases online.", + "segment": "OTHERS", + "availableCountries": [ + "BRA", + "ARG" + ], + "type": "EXTERNAL", + "isActive": true, + "helpUrl": "https://help.vtex.com/pt/tracks/configurar-integracao-do-mercado-livre--2YfvI3Jxe0CGIKoWIGQEIq", + "connectorVtexAdminPath": "/bridge/#/settings?openConfig=mercadolivre", + "connectorPageUrl": "https://apps.vtex.com/vtexbr-tiktok-tbp/p", + "connectorApiEndpoint": "portal.vtexcommercestable.com/api/meliintegration/notifications", + "channelId": 1 + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/channel-manager/connector - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/channel-manager/connector - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/channel-manager/connector - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/channel-manager/connector - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"integer","description":"Connector ID."},"name":{"type":"string","description":"Connector name."},"website":{"type":"string","description":"Connector website."},"logo":{"type":"string","description":"Connector logo URL."},"description":{"type":"string","description":"Connector description."},"helpUrl":{"type":"string","description":"URL of connector integration documentation page."},"segment":{"type":"string","description":"Market segment."},"availableCountries":{"description":"List of countries where connector is available for integration.","type":"array","items":{"description":"Country code.","type":"string"}},"availableStates":{"description":"States in which the connector operates, valid only for connectors that have area restriction.","type":"array","items":{"type":"string","description":"State code."}},"type":{"description":"What type of connector, if it is native, VTEX or partner.","type":"string"},"connectorPageUrl":{"description":"URL where the merchant will be redirected to start the onboarding process.","type":"string"},"connectorVtexAdminPath":{"description":"Admin VTEX URL, where the merchant will be redirected to manage and view his connections after integration.","type":"string"},"connectorApiEndpoint":{"description":"Partner connector API base URL.","type":"string"},"channelId":{"description":"ID of the channel that a connector joins to.","type":"string"},"isGloballyAvailable":{"description":"Indicates whether connector is globally available (`true`) or not (`false`).","type":"boolean"},"ownerVtexAccount":{"description":"Connector account name in VTEX.","type":"string"},"isActive":{"description":"Indicates whether connector is active (`true`) or not (`false`).","type":"boolean"},"isCertified":{"description":"Indicates whether the connector is certified (`true`) or not (`false`).","type":"boolean"},"contactInfo":{"description":"Seller contact information.","type":"object","properties":{"name":{"description":"Name of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"email":{"description":"Email address of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"phone":{"description":"Phone of the person responsible for the marketplace account interested in connecting to the merchant.","type":"string"},"defaultMessage":{"description":"Introduction message and information of interest in the partnership with the merchant.","type":"string"}}},"isConnectionActive":{"description":"Indicates whether connection is active (`true`) or not (`false`).","type":"boolean"},"affiliateId":{"description":"Affiliate ID corresponding to the connector.","type":"string"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers a new connector in our platform. The account name informed in the request should be the one owned by the partner since it is the only account that will have permission to update or delete the connector. + + Possible values for field `type`: + + - `APP`, if using our App Template. + - `EXTERNAL`, if not using App Template. + + Possible values for field `segment`: + + - `ADS` + - `APPAREL_ACCESSORIES` + - `BEAUTY_HEALTH` + - `BOOKS_EDUCATION` + - `CARS_AUTOPARTS` + - `DEPARTMENT_STORES` + - `ELETRONICS` + - `FINANCIAL_INSURANCES` + - `FOOD_BEVERAGES` + - `GROCERY` + - `HOME_APPLIANCES` + - `HOME_FURNITURE_DECOR` + - `JEWELRY` + - `PET_SHOP` + - `SPORTS_FITNESS` + - `TOURISM` + - `TOYS_HOBBIES` + - `OTHERS` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) VTEX's account name owned by the connector/partner, ex. `apiexemple` | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": 584, + "name": "Mercado Livre Classic", + "website": "mercadolivre.com.br", + "logo": "https://g.foolcdn.com/art/companylogos/square/meli.png", + "description": "Mercado Libre operates online commerce platforms in Latin America. It operates Mercado Libre Marketplace, an automated online commerce platform that enables businesses, merchants, and individuals to list merchandise and conduct sales and purchases online.", + "helpUrl": "https://help.vtex.com/pt/tracks/configurar-integracao-do-mercado-livre--2YfvI3Jxe0CGIKoWIGQEIq", + "segment": "OTHERS", + "availableCountries": [ + "BRA", + "ARG" + ], + "availableStates": [], + "type": "EXTERNAL", + "connectorPageUrl": "https://apps.vtex.com/vtexbr-tiktok-tbp/p", + "connectorVtexAdminPath": "/bridge/#/settings?openConfig=mercadolivre", + "connectorApiEndpoint": "portal.vtexcommercestable.com/api/meliintegration/notifications", + "channelId": "1", + "isGloballyAvailable": false, + "ownerVtexAccount": "vtex", + "isActive": true, + "isCertified": false, + "contactInfo": { + "name": "Jhon", + "email": "jhon@marketplace.com", + "phone": "(77) 7777-7777", + "defaultMessage": "" + }, + "isConnectionActive": false, + "affiliateId": "AFT" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Remove connector.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Remove connector.yml new file mode 100644 index 0000000000..b60fed96e0 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Remove connector.yml @@ -0,0 +1,43 @@ +info: + name: Remove connector + type: http + seq: 9 + +http: + method: DELETE + url: "{{baseUrl}}/api/channel-manager/connector/:connectorId?an=apiexemple" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + - name: connectorId + value: "46" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a connector from VTEX platform. This action can only be executed by the account name that owns the connector's registration. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `connectorId` | path | (Required) Connector's ID in Channel Manager, available through the List all connectors route, or in the response of the registration. | + | `an` | query | (Required) Merchant's account name in VTEX, ex. `apiexemple`. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve channel.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve channel.yml new file mode 100644 index 0000000000..7fd5c1b33f --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve channel.yml @@ -0,0 +1,61 @@ +info: + name: Retrieve channel + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/channel-manager/channel/:channelId?an=accountName" + headers: + - name: Accept + value: application/json + - name: Content-type + value: application/json + params: + - name: an + value: accountName + type: query + - name: enviroment + value: portal.vtexcommercestable.com.br + type: path + - name: channelId + value: "1" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific channel that already exists in Channel Manager. + + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `enviroment` | path | (Required) Environment used as part of the URL. | + | `channelId` | path | (Required) Channel's ID in Channel Manager, available through the List All Channels endpoint. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) VTEX's account name owned by the connector/partner. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": 1, + "name": "Mercado Livre" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve connector.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve connector.yml new file mode 100644 index 0000000000..d148c84121 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Retrieve connector.yml @@ -0,0 +1,82 @@ +info: + name: Retrieve connector + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/channel-manager/connector/:connectorId?an=apiexemple" + headers: + - name: accept + value: application/json + - name: content-type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + - name: connectorId + value: "46" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve a specific connector registered in VTEX platform. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `connectorId` | path | (Required) Connector's ID in Channel Manager, available through the List all connectors, or in the response of the registration. | + | `an` | query | (Required) VTEX's account name owned by the connector/partner. | + | `accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `content-type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": 46, + "name": "B2W", + "website": "https://venda.americanasmarketplace.com.br/cadastre-sua-loja/", + "logo": "https://s3.amazonaws.com/Marketplace-Integration/Bridge/logos/skyhub.png", + "description": "A B2W e as Lojas Americanas fizeram uma fusão, dando origem ao Americanas Marketplace. Através do conector nativo da VTEX, é possível integrar com a B2W e aumentar seus canais de venda.", + "helpUrl": "https://help.vtex.com/pt/tracks/configurar-integracao-da-b2w--6w07SJBVqE020KIOOS8ygk", + "segment": "DEPARTMENT_STORES", + "availableCountries": [ + "BRA" + ], + "availableStates": [ + "SP", + "PB", + "AM" + ], + "type": "NATIVE", + "connectorPageUrl": "https://example.com/start-integration", + "connectorVtexAdminPath": "/admin/marketplace-network/configuration/skyhub/", + "connectorApiEndpoint": "https://portal.vtexcommercestable.com.br/api/skyhubintegration", + "channelId": 7, + "isGloballyAvailable": false, + "ownerVtexAccount": "vtex", + "isActive": true, + "isCertified": false, + "contactInfo": { + "name": "Jhon", + "email": "jhon@marketplace.com", + "phone": "(77) 7777-7777", + "defaultMessage": "Olá, aqui é Jhon da B2W. Adoraríamos incluir sua loja em nossa vitrine, pois acreditamos que seria benéfico para ambos. Seguem algumas informações importantes para darmos seguimento à nossa parceria:\n\n1) Nosso marketplace conta com as categorias A, B, C\n\n2) Nossa política de cobrança inclui uma taxa de 10% para cada compra, mais assinatura fixa de R$ 100 por mês. \n\n3) Saiba mais sobre nossa política de devoluções e envio neste link." + }, + "isConnectionActive": true, + "affiliateId": "BTW" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Send category mapping to VTEX Mapper.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Send category mapping to VTEX Mapper.yml new file mode 100644 index 0000000000..99d296460d --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Send category mapping to VTEX Mapper.yml @@ -0,0 +1,445 @@ +info: + name: Send category mapping to VTEX Mapper + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/mkp-category-mapper/categories/marketplace/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: "123456789" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "categories": [ + { + "id": "1", + "name": "Appliances", + "children": [ + { + "id": "1a", + "name": "Kitchen", + "children": [ + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + }, + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + } + ], + "specifications": [ + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + }, + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + } + ] + }, + { + "id": "1a", + "name": "Kitchen", + "children": [ + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + }, + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + } + ], + "specifications": [ + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + }, + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + } + ] + } + ] + }, + { + "id": "1", + "name": "Appliances", + "children": [ + { + "id": "1a", + "name": "Kitchen", + "children": [ + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + }, + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + } + ], + "specifications": [ + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + }, + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + } + ] + }, + { + "id": "1a", + "name": "Kitchen", + "children": [ + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + }, + { + "id": "123421345sadf", + "name": "Silverware", + "specifications": [ + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + }, + { + "attributeName": "Size", + "required": true, + "attributeValues": [ + { + "value": "" + }, + { + "value": "" + } + ] + } + ] + } + ], + "specifications": [ + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + }, + { + "attributeName": "Color", + "required": false, + "attributeValues": [ + { + "valueName": "Red" + }, + { + "valueName": "Red" + } + ] + } + ] + } + ] + } + ], + "id": false, + "name": -92842328 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/mkp-category-mapper/categories/marketplace/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Mapping categories guarantees that the VTEX category tree has a correct association with the marketplace’s category tree. + + To perform this association, VTEX made VTEX Mapper available. It is a tool integrated into the VTEX platform that allows the user to relate categories created in VTEX to categories from the marketplace. + + This endpoint allows connectors to send the marketplace's category tree mapped in the integration. + + Connectors should send the payload compacted in `.gzip` format. + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Code identifying returned in the *VTEX Mapper Registration* endpoint. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Upsert merchant connection.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Upsert merchant connection.yml new file mode 100644 index 0000000000..6a504d3533 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/Upsert merchant connection.yml @@ -0,0 +1,50 @@ +info: + name: Upsert merchant connection + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/channel-manager/connector/:connectorId?an=apiexemple" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexemple + type: query + - name: environment + value: "{{environment}}" + type: path + - name: connectorId + value: "46" + type: path + body: + type: json + data: |- + { + "isActive": false, + "affiliateId": "AFT" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Receives an event describing a connection update between the connector with the specified ID and the merchant specified in the query string./n/rThis information is used in the list all connectors route: the account name will be used to return the `isConnectionActive` and `affiliateId` fields. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `connectorId` | path | (Required) Connector's ID in Channel Manager, available through the list all connectors route, or in the response of the registration. | + | `an` | query | (Required) Merchant's account name in VTEX, ex. `apiexemple`. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/VTEX mapper registration.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/VTEX mapper registration.yml new file mode 100644 index 0000000000..452db3eab8 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/VTEX mapper registration.yml @@ -0,0 +1,72 @@ +info: + name: VTEX mapper registration + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/mkp-category-mapper/connector/register?an=accountName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: accountName + type: query + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "displayName": "Marketplace A", + "categoryTreeEndPoint": "http://api.vtexinternal.com.br/api/{marketplaceName}/mapper/categories", + "mappingEndPoint": "http://api.vtexinternal.com.br/api/{marketplaceName}/mapper/mapping", + "properties": { + "allowsRemap": false + }, + "CategoryTreeProcessingNotificationEndpoint": "https://CategoryTreeProcessingNotificationEndpoint.com/api" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/mkp-category-mapper/connector/register - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Mapped categories guarantees that the VTEX category tree has a correct association with the marketplace’s category tree. + + To perform this association, VTEX made VTEX Mapper available. It is a tool integrated into the VTEX platform that allows the user to relate categories created in VTEX to categories from the marketplace. + + This endpoint allows connectors to register the external marketplace integration in VTEX Mapper. + + In case VTEX Mapper detects an error and the call fails, the connector should check if mandatory information was sent correctly. Ex. Are URLs correctly registered in the properties `categoryTreeEndPoint` and `mappingEndPoint`? + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Name of the VTEX account. Used as part of the URL. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/folder.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/folder.yml new file mode 100644 index 0000000000..8d705c6541 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/External Marketplace/folder.yml @@ -0,0 +1,4 @@ +info: + name: External Marketplace + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/environments/VTEX.yml new file mode 100644 index 0000000000..252557e1e2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://portal.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/opencollection.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/opencollection.yml new file mode 100644 index 0000000000..880ea2f6f7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Mapper/opencollection.yml @@ -0,0 +1,58 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace Protocol - External Marketplace Mapper + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The **Marketplace Protocol** is a set of API requests and definitions to help you integrate external sellers into a VTEX marketplace as well as external marketplaces into VTEX sellers. + + ## External Seller + + Here you will find the endpoints involved in the integration between a VTEX marketplace and an external seller. Note that some of these requests are typically sent by the seller while others are received. + + | **Request** | **From** | **To** | + |-|-|-| + | [Fulfillment simulation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orderForms/simulation) | Marketplace | Seller | + | [Order placement](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders) | Marketplace | Seller | + | [Authorize fulfillment](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-sellerOrderId-/fulfill) | Marketplace | Seller | + | [Marketplace order cancellation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-orderId-/cancel) | Marketplace | Seller | + | [Send invoice](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice) | Seller | Marketplace | + | [Send tracking information](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-) | Seller | Marketplace | + | [Update tracking status](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-/tracking) | Seller | Marketplace | + | [Cancel order in marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/cancel) | Seller | Marketplace | + + For a detailed explanation of the steps required to develop a custom connector to sell products from an external seller in your storefront, check out our complete [External Seller Integration Guide](https://developers.vtex.com/docs/guides/external-seller-integration-guide). + + + ## External Marketplace + + In this section, you will find the endpoints involved in the VTEX integration between an external marketplace and a VTEX seller. + + + | **Request** | **From** | **To** | + |-|-|-| + | [VTEX Mapper Registration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/connector/register) | External marketplace | VTEX system | + | [Send Category Mapping to VTEX Mapper](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/categories/marketplace/-id-) | External marketplace | VTEX system | + | [New Order Integration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/order-integration/orders) | External marketplace | VTEX system | + | [Update Order Status](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#put-/api/order-integration/orders/status) | External marketplace | VTEX system | + | [Fulfillment simulation - External Marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/checkout/pub/orderForms/simulation) | External marketplace | VTEX system | + | [Place fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders) | External marketplace | VTEX Seller | + | [Authorize dispatch for fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders/-orderId-/fulfill) | External marketplace | VTEX Seller | + + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Authorize dispatch for fulfillment order.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Authorize dispatch for fulfillment order.yml new file mode 100644 index 0000000000..9b0d24801b --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Authorize dispatch for fulfillment order.yml @@ -0,0 +1,109 @@ +info: + name: Authorize dispatch for fulfillment order + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/fulfillment/pvt/orders/:orderId/fulfill?affiliateId=MKP" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: affiliateId + value: MKP + type: query + - name: orderId + value: MKP-123 + type: path + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "123" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/fulfillment/pvt/orders/:orderId/fulfill - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/fulfillment/pvt/orders/:orderId/fulfill - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/fulfillment/pvt/orders/:orderId/fulfill - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/fulfillment/pvt/orders/:orderId/fulfill - Schema is valid", function () { + const schema = {"type":"object","description":"Response schema for a successful order creation.","properties":{"status":{"type":"string","description":"Indicates the success status of the response."},"message":{"type":"string","description":"A message providing additional information about the response."},"orderId":{"type":"string","description":"The unique identifier of the created order."},"details":{"type":"object","description":"Detailed information about the created order.","properties":{"createdAt":{"type":"string","description":"The timestamp when the order was created. Format: `YYYY/MM/DD HH:MM:SSZ`."},"marketplaceOrderId":{"type":"string","description":"The marketplace-specific order identifier."},"status":{"type":"string","description":"The current status of the order."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates fulfillment order, meaning that it is an order for the seller's side in a sale made through a marketplace. This order assumes the transaction itself has already happened on the marketplace's side and, therfore, cares only about the fulfillment side. + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) ID of the order that is to be authorized. It is composed of the `afilliateId` and the `marketplaceOrderId` joined with a `-`. For instance, an order with an ID `"123"` coming from the marketplace `"MKP"` has an `orderId` of `"MKP-123"`. | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL. | + | `environment` | path | (Required) Environment to be used. It is passed as part of the URL. | + | `sc` | query | Sales channel. | + | `affiliateId` | query | (Required) ID identifying the marketplace where the order originates. This ID is configured in the seller's VTEX account, and should be informed to the marketplace. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "status": "success", + "message": "Order created successfully", + "orderId": "123", + "details": { + "createdAt": "2024-07-04T12:34:56Z", + "marketplaceOrderId": "123", + "status": "pending" + } + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Fulfillment simulation - external marketplace.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Fulfillment simulation - external marketplace.yml new file mode 100644 index 0000000000..9984f4ee8c --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Fulfillment simulation - external marketplace.yml @@ -0,0 +1,141 @@ +info: + name: Fulfillment simulation - external marketplace + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pub/orderForms/simulation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: affiliateId + value: MNF + type: query + disabled: true + - name: sc + value: "1" + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "items": [ + { + "id": "1", + "quantity": 1, + "seller": "1" + }, + { + "id": "1", + "quantity": 1, + "seller": "1" + } + ], + "marketingData": { + "coupon": "free-shipping", + "utmSource": "Facebook", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmiPage": "utmi_page-example", + "utmiPart": "utmi_part-example", + "utmiCampaign": "utmi_campaign-example" + }, + "postalCode": "12345-000", + "country": "BRA", + "selectedSla": "Normal", + "clientProfileData": { + "email": "clark.kent@example.com", + "firstName": "Clark", + "lastName": "Kent", + "documentType": "cpf", + "document": "12345678900", + "phone": "+552199999999", + "corporateName": "companyName", + "tradeName": "tradeName", + "corporateDocument": "corporateDocument", + "stateInscription": "stateInscription", + "corporatePhone": "corporatePhone", + "isCorporate": true, + "profileCompleteOnLoading": false, + "profileErrorOnLoading": false, + "customerClass": "customerClass" + }, + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ], + "isCheckedIn": false, + "storeId": "quis id reprehend" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/checkout/pub/orderForms/simulation - Schema is valid", function () { + const schema = {"type":"object","properties":{"items":{"type":"array","description":"Information on each item in the cart.","items":{"type":"object","description":"Detailed information about a specific item in the cart, including its attributes such as ID, name, price, and quantity.","properties":{"id":{"type":"string","description":"ID of the item."},"requestIndex":{"type":"integer","description":"Request index information."},"quantity":{"type":"integer","description":"The quantity of the item the cart."},"seller":{"type":"string","description":"The seller responsible for the SKU."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"string","description":"Seller."}},"tax":{"type":"integer","description":"Tax value in cents."},"priceValidUntil":{"type":"string","description":"Price expiration date and time."},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead."},"offerings":{"type":"array","description":"Array containing offering information.","items":{"type":"object","description":"Details of offering information.","properties":{"id":{"type":"string","description":"Identifier of the offering."},"name":{"type":"string","description":"Name of the offering."},"price":{"type":"integer","description":"Price of the offering in cents."},"availability":{"type":"string","description":"Availability status of the offering."}}}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order.","items":{"type":"object","description":"Details of a price tag.","properties":{"name":{"type":"string","description":"Price tag name."},"value":{"type":"integer","description":"Price tag value."},"rawValue":{"type":"integer","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage."},"identifier":{"type":"string","description":"Price tag identifier."},"owner":{"type":"string","description":"Identification of the responsible for the price tag."}}}},"measurementUnit":{"type":"string","description":"Measurement unit."},"unitMultiplier":{"type":"integer","description":"Unit multiplier."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"availability":{"type":"string","description":"Availability."},"priceDefinition":{"type":"object","description":"Price information for all units of a specific item.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value for all units of the item in cents."},"sellingPrices":{"type":"array","description":"Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total.","items":{"type":"object","description":"Details of a selling price instance.","properties":{"value":{"type":"integer","description":"Value in cents for that specific rounding."},"quantity":{"type":"integer","description":"Rounding quantity, meaning how many items are rounded to this value."}}}}}}}}},"ratesAndBenefitsData":{"type":"object","description":"Information on rates and benefits that apply to the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List with rates and benefits identifiers.","items":{"type":"object","description":"Details of a rate and benefits identifier.","properties":{"id":{"type":"string","description":"Identifier of the rate or benefit."},"name":{"type":"string","description":"Name of the rate or benefit."}}}},"teaser":{"type":"array","description":"List with rates and benefits teasers.","items":{"type":"object","description":"Details of a teaser containing rates and benefits.","properties":{"name":{"type":"string","description":"Teaser name."},"description":{"type":"string","description":"Teaser description."}}}}}},"paymentData":{"type":"object","description":"Payment data information.","properties":{"installmentOptions":{"type":"array","description":"Installment options information.","items":{"type":"array","description":"Array containing installment options available for payment.","items":{"type":"object","description":"Details of payment options.","properties":{"paymentSystem":{"type":"integer","description":"Payment system identification."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Total value assigned to this payment."},"installments":{"type":"array","description":"Installments information.","items":{"type":"object","description":"Details of each installment payment.","properties":{"count":{"type":"integer","description":"Count information."},"hasInterestRate":{"type":"boolean","description":"Indicates whether the payment has interest."},"interestRate":{"type":"integer","description":"Interest rate value."},"value":{"type":"integer","description":"Value of the order without the interest rate. The value is shown without separating cents."},"total":{"type":"integer","description":"Total value of the order without separating cents. For example, $24.99 is represented `2499`."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments information.","items":{"type":"object","description":"Details of seller merchant installments.","properties":{"id":{"type":"integer","description":"Seller ID."},"count":{"type":"integer","description":"Installment count."},"value":{"type":"integer","description":"Installment value."}}}}}}}}}}},"paymentSystems":{"type":"array","description":"Information on payment systems.","items":{"type":"object","description":"Details of a payment system.","properties":{"id":{"type":"integer","description":"Payment system ID."},"name":{"type":"string","description":"Payment system name."},"groupName":{"type":"string","description":"Payment group name."},"validator":{"type":["object","null"],"description":"Payment system validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"selectableGifts":{"type":"array","description":"Array containing the data of the item selected as a gift.","items":{"type":"object","description":"Details of the item selected as a gift.","properties":{"giftItemId":{"type":"string","description":"Identifier of the gift item."},"giftItemName":{"type":"string","description":"Name of the gift item."},"giftItemDescription":{"type":"string","description":"Description of the gift item."},"giftItemPrice":{"type":"number","description":"Price of the gift item."}}}},"marketingData":{"type":["object","null"],"description":"Object containing promotion data such as coupon tracking information and internal or external UTMs."},"postalCode":{"type":["string","null"],"description":"Postal Code."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"logisticsInfo":{"type":"array","description":"Array with logistics information on each item of the `items` array in the `orderForm`.","items":{"description":"Logistics information for an item.","type":"object","properties":{"itemIndex":{"type":"integer","description":"Index of item in items array."},"addressId":{"type":["string","null"],"description":"Address ID."},"selectedSla":{"type":["string","null"],"description":"Selected SLA. For example, `\"normal\"` or `\"express\"`."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Delivery channel selected by the customer. For example, `\"delivery\"` or `\"pickup-in-point\"`."},"quantity":{"type":"integer","description":"Indicates the number of items in the order."},"shipsTo":{"type":"array","description":"List of countries that the item may be shipped to.","items":{"type":"string","description":"Country code indicating where the item may be shipped."}},"slas":{"type":"array","description":"Information on available SLAs.","items":{"type":"object","description":"Service Level Agreements (SLAs) available for the order.","properties":{"id":{"type":"string","description":"SLA ID."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"type":"object","description":"Details on each delivery ID.","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Warehouse ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date."},"lockTTL":{"type":"string","description":"Estimate date of delivery."},"availableDeliveryWindows":{"type":"object","description":"This object contains information about the delivery window available to the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"deliveryWindow":{"type":"object","description":"In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information."},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"deliveryChannels":{"type":"array","description":"List of available delivery channels.","items":{"type":"object","description":"Information about a specific delivery channel.","properties":{"id":{"type":"string","description":"Delivery channel ID."}}}},"messages":{"type":"array","description":"Array containing an object for each message generated by our servers while processing the request.","items":{"type":"object","description":"Details of a message generated during server processing.","properties":{"messageId":{"type":"string","description":"Identifier of the message."},"messageText":{"type":"string","description":"Content of the message."},"messageType":{"type":"string","description":"Type of the message (e.g., error, warning, info)."}}}},"purchaseConditions":{"type":"object","description":"Purchase conditions information.","properties":{"itemPurchaseConditions":{"type":"array","description":"List of objects containing purchase condition information on each item in the order.","items":{"type":"object","description":"Object containing purchase condition information on each item in the order.","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"sellerChain":{"type":"array","description":"Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order.","items":{"type":"object","description":"Details of each seller involved in the chain.","properties":{"sellerId":{"type":"string","description":"Identifier of the seller."},"sellerName":{"type":"string","description":"Name of the seller."},"sellerLocation":{"type":"string","description":"Location or address of the seller."}}}},"slas":{"type":"array","description":"Information on available SLAs.","items":{"type":"object","description":"Object containing details of a Service Level Agreement (SLA).","properties":{"id":{"type":"string","description":"SLA ID."},"deliveryChannel":{"type":"string","description":"Delivery channel."},"name":{"type":"string","description":"SLA name."},"deliveryIds":{"type":"array","description":"Information on each delivery ID.","items":{"type":"object","description":"Detailed information about each item in the order.","properties":{"courierId":{"type":"string","description":"Courier ID."},"warehouseId":{"type":"string","description":"Warehouse ID."},"dockId":{"type":"string","description":"Dock ID."},"courierName":{"type":"string","description":"Courier name."},"quantity":{"type":"integer","description":"Quantity."}}}},"shippingEstimate":{"type":"string","description":"Shipping estimate. For instance, \"three business days\" will be represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date."},"lockTTL":{"type":"string","description":"Estimate date of delivery."},"availableDeliveryWindows":{"type":"object","description":"This object contains information about the delivery window available to the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"deliveryWindow":{"type":"object","description":"In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting day and time in UTC."},"endDateUtc":{"type":"string","description":"Delivery window ending day and time in UTC."},"price":{"type":"integer","description":"Delivery window price."},"lisPrice":{"type":"integer","description":"Delivery window list price."},"tax":{"type":"integer","description":"Delivery window tax."}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"tax":{"type":"integer","description":"Tax in cents."},"pickupStoreInfo":{"type":"object","description":"Information on the pickup store.","properties":{"isPickupStore":{"type":"boolean","description":"Indicates whether it is the pickup store."},"friendlyName":{"type":["string","null"],"description":"Friendly name."},"address":{"type":["object","null"],"description":"Address information."},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"Corresponding dock ID."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID."},"pickupDistance":{"type":"integer","description":"Pickup point distance."},"polygonName":{"type":["string","null"],"description":"Polygon name."},"transitTime":{"type":"string","description":"Transit time. For instance, \"three business days\" is represented as `3bd`."}}}},"price":{"type":"integer","description":"Price in cents."},"listPrice":{"type":"integer","description":"List price in cents."}}}}}},"pickupPoints":{"type":"array","description":"Array containing pickup points information.","items":{"description":"Details of a pickup point.","type":"object","properties":{"pickupPointId":{"type":"string","description":"Pickup point ID."},"friendlyName":{"type":["string","null"],"description":"Friendly name of the pickup point."},"address":{"type":["object","null"],"description":"Address information of the pickup point.","properties":{"street":{"type":"string","description":"Street address."},"number":{"type":"string","description":"Street number."},"neighborhood":{"type":"string","description":"Neighborhood."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State."},"country":{"type":"string","description":"Country."},"postalCode":{"type":"string","description":"Postal code."}}},"additionalInfo":{"type":["string","null"],"description":"Additional information about the pickup point."},"dockId":{"type":["string","null"],"description":"Dock ID of the pickup point."}}}},"subscriptionData":{"type":["object","null"],"description":"Subscription information."},"totals":{"type":"array","description":"Information on order totals.","items":{"type":"object","description":"Object containing information about a specific total in the order.","properties":{"id":{"type":"string","description":"Total ID."},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value."}}}},"itemMetadata":{"type":"object","description":"Item metadata.","properties":{"items":{"type":"array","description":"List of objects containing metadata on each item in the order.","items":{"type":"object","description":"Detailed information about each item in the order.","properties":{"id":{"type":"string","description":"Item ID."},"seller":{"type":"string","description":"Seller."},"assemblyOptions":{"type":"array","description":"Assembly options information.","items":{"description":"Details of an assembly option.","type":"object","properties":{"id":{"type":"string","description":"Item ID."},"name":{"type":"string","description":"Item name."},"required":{"type":"boolean","description":"Indicates whether the item is required."},"inputValues":{"type":"object","description":"Input values information."},"composition":{"type":["string","null"],"description":"Composition information."}}}}}}}}}}}}}}}}}},"deprecated":false}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint can be triggered by marketplaces to simulate the fulfillment of an item in the cart. + + The fulfillment information is useful whenever you need to know the availability of fulfilling an order for a specific cart setting, since the API response will let you know the updated price, inventory and shipping data. + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL. | + | `environment` | path | (Required) Environment to be used. It is passed as part of the URL. | + | `affiliateId` | query | The affiliate ID code created by the seller. | + | `sc` | query | Trade Policy (Sales Channel) identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/New Order Integration.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/New Order Integration.yml new file mode 100644 index 0000000000..0526aae81e --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/New Order Integration.yml @@ -0,0 +1,201 @@ +info: + name: New Order Integration + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/order-integration/orders?affiliateId=MKP" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + disabled: true + - name: affiliateId + value: MKP + type: query + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "123", + "connectorName": "SkyHub", + "connectorEndpoint": "https://connector-endpoint.com/api/vtex", + "marketplaceOrderStatus": "new", + "marketplacePaymentValue": 3025, + "marketplaceInterestValue": 0, + "priceDivergenceAllowanceRate": 0.05, + "allowFranchises": false, + "pickupAccountName": "testAccount", + "items": [ + { + "id": "1", + "price": 975, + "quantity": 1 + } + ], + "clientProfileData": { + "email": "email@email.com.br", + "firstName": "John", + "lastName": "Doe", + "phone": "99999999999", + "document": "99999999999", + "corporateDocument": null, + "corporatePhone": null, + "corporateName": null, + "tradeName": null, + "stateInscription": null + }, + "shippingData": { + "logisticsInfo": [ + { + "price": 2050, + "selectedDeliveryChannel": "delivery", + "selectedSla": "Express", + "lockTTL": "1d", + "shippingEstimate": "2d", + "deliveryIds": [ + { + "warehouseId": "AR1" + } + ] + } + ], + "selectedAddresses": [ + { + "addressType": "Residential", + "addressId": "1", + "receiverName": "John Doe", + "postalCode": "81020-235", + "city": "Curitiba", + "state": "PR", + "country": "BRA", + "street": "Rua Eduardo Carlos Pereira", + "number": "4125", + "neighborhood": "Portão", + "complement": "101", + "geoCoordinates": { + "latitude": -29.5, + "longitude": -45.8 + } + } + ], + "isFob": true, + "isMarketplaceFulfillment": true, + "trackingHints": [ + { + "trackingId": "BR123456789", + "courierName": "Correios", + "trackingUrl": "https://tracking.example.com/BR123456789", + "trackingLabel": "Correios Express" + } + ] + }, + "invoiceData": { + "userPaymentInfo": { + "paymentMethods": [ + "creditCardPaymentGroup" + ] + } + }, + "customData": { + "customApps": [ + { + "id": "marketplace-integration", + "major": 1, + "fields": { + "marketplacePaymentMethod": "credit card" + } + } + ] + }, + "taxData": [ + { + "skuId": "1", + "value": 150 + } + ], + "openTextField": "Additional order information." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/order-integration/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/order-integration/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/order-integration/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/order-integration/orders - Schema is valid", function () { + const schema = {"required":["marketplaceOrderId","accountName","code","flow","success","operationId","errors","fields","message"],"type":"object","description":"Object for delivery by seller integration.","properties":{"marketplaceOrderId":{"type":["string","null"],"description":"String that indicates the order's ID in the marketplace."},"accountName":{"type":"string","description":"String that indicates which account made the request."},"code":{"type":"string","description":"String with a internal Channel Order API code that classifies the response. The possible values returned in this field are described in the [Response Codes]() section."},"flow":{"type":"string","description":"String containing the name of the flow responsible for the response. This field can contain the following values: \n\n`PlaceOrder`: when integrating new orders \n\n`ApproveOrder`: when approving existing orders \n\n`Unknown`: when we’re not able to identify the flow."},"success":{"type":"boolean","description":"Boolean that indicates if the response is successful or not."},"operationId":{"type":["string","null"],"description":"String GUID that identifies the operation in our service. This field can be used to help us analyze unexpected errors or behaviors."},"errors":{"type":["array","null"],"description":"List with errors related to the response, if there's any.","items":{"type":"object","description":"Information about an item.","required":["source","code","description"],"properties":{"source":{"type":"string","description":"Includes the following fields pointing out the context of the error: \n\n`Fulfillment` \n\n`Checkout` \n\n`Order Integration`."},"code":{"type":"string","description":"String containing the code returned by the source. Example value: If the source is `Fulfillment`, the code can be FMT005 to indicate that the item(s) in the order are not available.","enum":["FMT001","FMT002","FMT003","FMT004","FMT005"]},"description":{"type":"string","description":"String containing the error message and description returned by the source."}}}},"fields":{"type":["object","null"],"description":"Structure with important fields for the connector. This structure is only returned if the response is successful.","required":["mainOrderId"],"properties":{"mainOrderId":{"type":"string","description":"String with the order’s ID inside the main seller account in VTEX."},"franchiseOrderId":{"type":"string","description":"String with the order's ID inside the franchise seller account in VTEX. Only returned if the order was integrated using the [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) feature, that is: \n\n- `allowFranchises` field set to `true` when integrating the order \r\n- SLA chosen for the order is from a franchise account."}}},"message":{"type":"string","description":"String with a message explaining the code returned in the response."}},"example":{"marketplaceOrderId":null,"accountName":"grocery1","code":"SOI003","flow":"PlaceOrder","success":true,"operationId":null,"errors":null,"fields":{"mainOrderId":"MKP-123456789","franchiseOrderId":"432874921387409182347"},"message":"Order successfully enqueued"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + API to integrate an external channel's order into the VTEX plataform. + + This process is asynchronous and a notification with the order's integration results will be sent to the endpoint specified in the **connectorEndpoint** field in [App Template](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-app-template), if the connector uses our App template. The field **connectorName** is also optional for connectors that use our App Template and authenticate using the app's auth cookie. If the account is not informed in the URL host, it should also be defined as a query string parameter in the route: `an={account}`. + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Parameter should indicate the name of the VTEX account where the order is being integrated or updated, meaning the seller responsible for the order. | + | `an` | query | Parameter should indicate the name of the VTEX account where the order is being integrated or updated, meaning the seller responsible for the order. | + | `affiliateId` | query | (Required) ID identifying the marketplace where the order originates. This ID is configured in the seller's VTEX account, and should be informed to the marketplace. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "marketplaceOrderId": null, + "accountName": "grocery1", + "code": "SOI003", + "flow": "PlaceOrder", + "success": true, + "operationId": null, + "errors": null, + "fields": null, + "message": "Order successfully enqueued" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Place fulfillment order.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Place fulfillment order.yml new file mode 100644 index 0000000000..41f22fc6d6 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Place fulfillment order.yml @@ -0,0 +1,368 @@ +info: + name: Place fulfillment order + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/fulfillment/pvt/orders?affiliateId=MKP" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sc + value: "1" + type: query + disabled: true + - name: affiliateId + value: MKP + type: query + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "123456789", + "marketplaceServicesEndpoint": "https://exampleseller.marketplaceservices.com", + "marketplacePaymentValue": 100, + "items": [ + { + "id": "123", + "quantity": 1, + "seller": "1", + "commission": 10, + "freightCommission": 10, + "price": 2499, + "bundleItems": [ + { + "type": "type-example", + "id": 1034, + "name": "name-example", + "price": 199 + }, + { + "type": "type-example", + "id": 1034, + "name": "name-example", + "price": 199 + } + ], + "itemAttachment": { + "name": "name-example", + "content": "content-example" + }, + "attachments": [ + "in laborum", + "minim quis labore sed" + ], + "priceTags": [ + { + "identifier": "1234abc-5678b-1234c", + "isPercentual": false, + "name": "discount@name-1234abc-5678b-1234c", + "rawValue": -12, + "value": -1200 + }, + { + "identifier": "1234abc-5678b-1234c", + "isPercentual": false, + "name": "discount@name-1234abc-5678b-1234c", + "rawValue": -12, + "value": -1200 + } + ], + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false + }, + { + "id": "123", + "quantity": 1, + "seller": "1", + "commission": 10, + "freightCommission": 10, + "price": 2499, + "bundleItems": [ + { + "type": "type-example", + "id": 1034, + "name": "name-example", + "price": 199 + }, + { + "type": "type-example", + "id": 1034, + "name": "name-example", + "price": 199 + } + ], + "itemAttachment": { + "name": "name-example", + "content": "content-example" + }, + "attachments": [ + "esse dolore ", + "dolor labore" + ], + "priceTags": [ + { + "identifier": "1234abc-5678b-1234c", + "isPercentual": false, + "name": "discount@name-1234abc-5678b-1234c", + "rawValue": -12, + "value": -1200 + }, + { + "identifier": "1234abc-5678b-1234c", + "isPercentual": false, + "name": "discount@name-1234abc-5678b-1234c", + "rawValue": -12, + "value": -1200 + } + ], + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false + } + ], + "clientProfileData": { + "email": "customer@examplemail.com", + "firstName": "first-name", + "lastName": "last-name", + "documentType": "cpf", + "document": "123456789", + "phone": "+55110988887777", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "+551100988887777", + "isCorporate": false + }, + "shippingData": { + "address": { + "addressType": "Residential", + "receiverName": "receiver-name", + "postalCode": "12345000", + "city": "Rio de Janeiro", + "state": "Rio de Janeiro", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "addressId": "Home", + "neighborhood": "Botafogo", + "complement": "3rd floor", + "reference": "Grey building", + "geoCoordinates": [ + "00.00000", + "00.00000" + ] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Express", + "price": 1099, + "lockTTL": "8d", + "shippingEstimate": "7d", + "deliveryWindow": { + "startDateUtc": "nulla", + "endDateUtc": "nostrud in sint", + "price": 0, + "lisPrice": 0, + "tax": 0 + } + }, + { + "itemIndex": 0, + "selectedSla": "Express", + "price": 1099, + "lockTTL": "8d", + "shippingEstimate": "7d", + "deliveryWindow": { + "startDateUtc": "dolore ipsum", + "endDateUtc": "cillum voluptate veniam", + "price": 0, + "lisPrice": 0, + "tax": 0 + } + } + ], + "updateStatus": "qui amet" + }, + "isCreatedAsync": false, + "paymentData": null, + "marketingData": { + "utmSource": "Facebook", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmiPage": "utmi_page-example", + "utmiPart": "utmi_part-exmaple", + "utmiCampaign": "utmi_campaign-exmaple" + }, + "openTextField": "open-text-example" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/fulfillment/pvt/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/fulfillment/pvt/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/fulfillment/pvt/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/fulfillment/pvt/orders - Schema is valid", function () { + const schema = {"type":"object","description":"Response schema for placing a fulfillment order.","properties":{"orderId":{"type":"string","description":"ID of the created order."},"status":{"type":"string","description":"Status of the order creation."},"message":{"type":"string","description":"Response message providing additional information about the order creation."},"orderData":{"type":"object","description":"Data related to the created order.","properties":{"marketplaceOrderId":{"type":"string","description":"ID of the order in the marketplace."},"marketplaceServicesEndpoint":{"type":"string","description":"Endpoint provided by the marketplace for post purchase communication. Should be an URL, containing protocol, host, path and query string (in case it applies)."},"marketplacePaymentValue":{"type":"integer","description":"Value of the payment made to the marketplace."},"isCreatedAsync":{"type":"boolean","description":"Indicates whether an order is created. It must be `true` if an order is being placed with price divergence, otherwise the request will not work."},"items":{"type":"array","description":"List of items included in the order.","items":{"type":"object","description":"Information about a specific item in the order.","properties":{"id":{"type":"string","description":"The SKU ID."},"quantity":{"type":"integer","description":"The quantity of items of this specific SKU in the cart to be simulated."},"seller":{"type":"string","description":"The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin."},"commission":{"type":"integer","description":"Commission."},"freightCommission":{"type":"integer","description":"Freight commission."},"price":{"type":"integer","description":"Item price within the context of the order without separating cents. For example, $24.99 is represented `2499`."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"type":"object","description":"Information about a bundled item or service.","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price. The last two digits are the cents."}}}},"itemAttachment":{"type":"object","description":"Item attachment.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"string","description":"Content referring to the customization requested by the customer."}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"description":"A string representing a single attachment associated with the item, providing additional details or customizations.","type":"string"}},"priceTags":{"type":"array","description":"Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order.","items":{"description":"Array of price tags that modify the price, such as discounts or rates applicable to the item in the order context.","type":"object","properties":{"identifier":{"type":"string","description":"Price tag identifier."},"isPercentual":{"type":"boolean","description":"`true` if price tag value is applied through a percentage."},"name":{"type":"string","description":"Price tag name."},"rawValue":{"type":"integer","description":"Price tag value."},"value":{"type":"integer","description":"Price tag raw value."}}}},"measurementUnit":{"type":"string","description":"SKU measurement unit."},"unitMultiplier":{"type":"integer","description":"SKU unit multiplier."},"isGift":{"type":"boolean","description":"Indicates whether the order is a gift."}}}},"clientProfileData":{"type":"object","description":"Customer's profile information.","properties":{"email":{"type":"string","description":"Customer's email address."},"firstName":{"type":"string","description":"Customer's first name."},"lastName":{"type":"string","description":"Customer's last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document informed by the customer. Validation depends on the country."},"phone":{"type":"string","description":"Customer's phone number."},"corporateName":{"type":"string","description":"Company name, if the customer is a legal entity."},"tradeName":{"type":"string","description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":"string","description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":"string","description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":"string","description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":"boolean","description":"`true` if the customer is a legal entity."}}},"shippingData":{"type":"object","description":"Shipping information.","properties":{"address":{"type":"object","description":"Shipping address.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`, among others."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":"string","description":"Address ID."},"postalCode":{"type":"string","description":"Postal Code. Validation depends on the country."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":"string","description":"Complement to the shipping address in case it applies."},"reference":{"type":"string","description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Array with two strings with geocoordinates, first latitude, then longitude.","items":{"type":"string","description":"A string representing the longitude coordinate."}}}},"logisticsInfo":{"type":"array","description":"Array of objects containing logistics information of each item.","items":{"type":"object","description":"Logistics information for a specific item in the order.","properties":{"itemIndex":{"type":"integer","description":"Index of the item in the logistics chain."},"selectedSla":{"type":"string","description":"Selected service level agreement (SLA) for the item."},"lockTTL":{"type":"string","description":"Time to live (TTL) of the lock until it is confirmed."},"shippingEstimate":{"type":"string","description":"Estimated shipping time."},"price":{"type":"integer","description":"Price of the logistics chain."},"deliveryWindow":{"type":"object","description":"Delivery window object.","properties":{"startDateUtc":{"type":"string","description":"Start date of the delivery window in UTC."},"endDateUtc":{"type":"string","description":"End date of the delivery window in UTC."},"price":{"type":"integer","description":"Delivery price."},"lisPrice":{"type":"integer","description":"LIS price."},"tax":{"type":"integer","description":"Tax."}}}}}},"updateStatus":{"type":"string","description":"Update status of the shipping order."}}},"paymentData":{"type":"string","description":"Payment information."},"marketingData":{"type":"object","description":"Marketing data related to the order.","properties":{"utmSource":{"type":"string","description":"UTM source parameter for marketing analysis."},"utmMedium":{"type":"string","description":"UTM medium parameter for marketing analysis."},"utmCampaign":{"type":"string","description":"UTM campaign parameter for marketing analysis."},"utmiPage":{"type":"string","description":"UTMI page parameter for marketing analysis."},"utmiPart":{"type":"string","description":"UTMI part parameter for marketing analysis."},"utmiCampaign":{"type":"string","description":"UTMI campaign parameter for marketing analysis."}}},"openTextField":{"type":"string","description":"Additional information."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates fulfillment order, meaning that it is an order for the seller's side in a sale made through a marketplace. This order assumes the transaction itself has already happened on the marketplace's side and, therfore, cares only about the fulfillment side. + + + > If you plan to integrate external orders with possible [Price divergence](https://help.vtex.com/en/tutorial/price-divergence-rule--6RlFLhD1rIRRshl83KnCjW#) be mindful of the `isCreatedAsync` request body field. + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of the VTEX account. Used as part of the URL. | + | `environment` | path | (Required) Environment to be used. It is passed as part of the URL. | + | `sc` | query | Sales channel. | + | `affiliateId` | query | (Required) ID identifying the marketplace where the order originates. This ID is configured in the seller's VTEX account, and should be informed to the marketplace. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderId": "1234567890", + "status": "success", + "message": "Order placed successfully", + "orderData": { + "marketplaceOrderId": "123456789", + "marketplaceServicesEndpoint": "https://exampleseller.marketplaceservices.com", + "marketplacePaymentValue": 100, + "isCreatedAsync": false, + "items": [ + { + "id": "123456789", + "quantity": 1, + "seller": "1", + "commission": 10, + "freightCommission": 10, + "price": 2499, + "bundleItems": [], + "itemAttachment": { + "name": "name-example", + "content": "content-example" + }, + "attachments": [], + "priceTags": [], + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false + } + ], + "clientProfileData": { + "email": "customer@examplemail.com", + "firstName": "first-name", + "lastName": "last-name", + "documentType": "cpf", + "document": "123456789", + "phone": "+55110988887777", + "corporateName": "company-name", + "tradeName": "trade-name", + "corporateDocument": "12345678000100", + "stateInscription": "12345678", + "corporatePhone": "+551100988887777", + "isCorporate": false + }, + "shippingData": { + "address": { + "addressType": "residential", + "receiverName": "receiver-name", + "addressId": "Home", + "postalCode": "12345000", + "city": "Rio de Janeiro", + "state": "Rio de Janeiro", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "neighborhood": "Botafogo", + "complement": "3rd floor", + "reference": "Grey building", + "geoCoordinates": [ + "00.00000", + "00.00000" + ] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Express", + "lockTTL": "8d", + "shippingEstimate": "7d", + "price": 1099, + "deliveryWindow": { + "startDateUtc": "2023-01-01 00:00:00", + "endDateUtc": "2023-01-02 00:00:00", + "price": 0, + "lisPrice": 0, + "tax": 0 + } + } + ], + "updateStatus": "updated" + }, + "paymentData": "credit card", + "marketingData": { + "utmSource": "Facebook", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmiPage": "utmi_page-example", + "utmiPart": "utmi_part-example", + "utmiCampaign": "utmi_campaign-example" + }, + "openTextField": "open-text-example" + } + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Update Order Status.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Update Order Status.yml new file mode 100644 index 0000000000..1ce9b2910f --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/Update Order Status.yml @@ -0,0 +1,103 @@ +info: + name: Update Order Status + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/order-integration/orders/status" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + disabled: true + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "{{$guid}}", + "marketplaceOrderStatus": "approved", + "connectorName": "Skyhub", + "connectorEndpoint": "https://connector-endpoint.com/api/vtex" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/order-integration/orders/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/order-integration/orders/status - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/order-integration/orders/status - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/order-integration/orders/status - Schema is valid", function () { + const schema = {"description":"Object for approving an order. Contains information about the approval status, errors (if any), and additional fields related to the approval process.","required":["marketplaceOrderId","accountName","code","flow","success","operationId","errors","fields","message"],"type":"object","properties":{"marketplaceOrderId":{"type":["string","null"],"description":"String that indicates the order's ID in the marketplace."},"accountName":{"type":["string","null"],"description":"String that indicates which account made the request."},"code":{"type":"string","description":"String with a internal Channel Order API code that classifies the response. The possible values returned in this field are described in the Response Codes section of this API Reference."},"flow":{"type":"string","description":"String containing the name of the flow responsible for the response. This field can contain the following values: \n\n`PlaceOrder`: when integrating new orders. \n\n`ApproveOrder`: when approving existing orders. \n\n`Unknown`: when we’re not able to identify the flow."},"success":{"type":"boolean","description":"Boolean that indicates if the response is successful or not."},"operationId":{"type":["string","null"],"description":"String GUID that identifies the operation in our service. This field can be used to help us analyze unexpected errors or behaviors."},"errors":{"type":["array","null"],"description":"List with errors related to the response, if there is any.","items":{"type":"object","description":"Object representing an error in the response.","required":["source","code","description"],"properties":{"source":{"type":"string","description":"Includes the following fields pointing out the context of the error: \n\n`Fulfillment` \n\n`Checkout` \n\n`Order Integration`.","enum":["Fulfillment","Checkout","Order Integration"]},"code":{"type":"string","description":"String containing the code returned by the source. Example value: If the source is `Fulfillment`, the code can be FMT005 to indicate that the item(s) in the order are not available."},"description":{"type":"string","description":"String containing the error message and description returned by the source."}}}},"fields":{"type":["object","null"],"description":"Structure with important fields for the connector. This structure is only returned if the response is successful. Includes the following fields: \n\n`mainOrderId`: String with the order's ID inside the main seller account in VTEX. \n\n`franchiseOrderId`: - String with the order's ID inside the franchise seller account in VTEX. Only returned if the order was integrated using the [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) feature, that is: \n\n- `allowFranchises` field set to `true` when integrating the order \n\n- `SLA` chosen for the order is from a franchise account.","properties":{"mainOrderId":{"type":"string","description":"String with the order’s ID inside the main seller account in VTEX."},"franchiseOrderId":{"type":"string","description":"String with the order's ID inside the franchise seller account in VTEX. Only returned if the order was integrated using the [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) feature."}}},"message":{"type":"string","description":"String with a message explaining the code returned in the response."}},"example":{"marketplaceOrderId":"7e62fcd3-827b-400d-be8a-f050a79c4976","accountName":null,"code":"SOI003","flow":"ApproveOrder","success":true,"operationId":null,"errors":null,"fields":null,"message":"Order successfully enqueued"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + API request used to update an order status in VTEX. + + This process is asynchronous and a notification with the order's integration results will be sent to the endpoint specified in the **connectiorEndpoint** field or the **connectiorEndpoint** [App Template](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-app-template), if the connector uses our App template. The field **connectorName** is also optional for connectors that use our App Template and authenticate using the app's auth cookie. + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/vtex-rest-api/docs/external-marketplace-integration-guide). + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Parameter should indicate the name of the VTEX account where the order is being integrated or updated, meaning the seller responsible for the order. | + | `an` | query | Parameter should indicate the name of the VTEX account where the order is being integrated or updated, meaning the seller responsible for the order. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "marketplaceOrderId": "7e62fcd3-827b-400d-be8a-f050a79c4976", + "accountName": null, + "code": "SOI003", + "flow": "ApproveOrder", + "success": true, + "operationId": null, + "errors": null, + "fields": null, + "message": "Order successfully enqueued" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/folder.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/folder.yml new file mode 100644 index 0000000000..8d705c6541 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/External Marketplace/folder.yml @@ -0,0 +1,4 @@ +info: + name: External Marketplace + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/opencollection.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/opencollection.yml new file mode 100644 index 0000000000..2cdd85d794 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Marketplace Orders/opencollection.yml @@ -0,0 +1,58 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace Protocol - External Marketplace Orders + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The _Marketplace Protocol_ is a set of API requests and definitions to help you integrate external sellers into a VTEX marketplace as well as external marketplaces into VTEX sellers. + + ## External Seller + + Here you will find the endpoints involved in the integration between a VTEX marketplace and an external seller. Note that some of these requests are typically sent by the seller while others are received. + + | **Request** | **From** | **To** | + |-|-|-| + | [Fulfillment simulation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orderForms/simulation) | Marketplace | Seller | + | [Order placement](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders) | Marketplace | Seller | + | [Authorize fulfillment](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-sellerOrderId-/fulfill) | Marketplace | Seller | + | [Marketplace order cancellation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-orderId-/cancel) | Marketplace | Seller | + | [Send invoice](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice) | Seller | Marketplace | + | [Send tracking information](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-) | Seller | Marketplace | + | [Update tracking status](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-/tracking) | Seller | Marketplace | + | [Cancel order in marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/cancel) | Seller | Marketplace | + + For a detailed explanation of the steps required to develop a custom connector to sell products from an external seller in your storefront, check out our complete [External Seller Integration Guide](https://developers.vtex.com/docs/guides/external-seller-integration-guide). + + + ## External Marketplace + + In this section, you will find the endpoints involved in the VTEX integration between an external marketplace and a VTEX seller. + + + | **Request** | **From** | **To** | + |-|-|-| + | [VTEX Mapper Registration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/connector/register) | External marketplace | VTEX system | + | [Send Category Mapping to VTEX Mapper](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/categories/marketplace/-id-) | External marketplace | VTEX system | + | [New Order Integration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/order-integration/orders) | External marketplace | VTEX system | + | [Update Order Status](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#put-/api/order-integration/orders/status) | External marketplace | VTEX system | + | [Fulfillment simulation - External Marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/checkout/pub/orderForms/simulation) | External marketplace | VTEX system | + | [Place fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders) | External marketplace | VTEX Seller | + | [Authorize dispatch for fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders/-orderId-/fulfill) | External marketplace | VTEX Seller | + + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Authorize fulfillment.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Authorize fulfillment.yml new file mode 100644 index 0000000000..db6e01b366 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Authorize fulfillment.yml @@ -0,0 +1,123 @@ +info: + name: Authorize fulfillment + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:sellerOrderId/fulfill" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: sellerOrderId + value: 00-1268540501456-01 + type: path + - name: fulfillmentEndpoint + value: marketplaceexample.externalseller.com + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "1138342255777-01", + "marketplaceOrderGroup": "group-123", + "cancellationRequestId": "85838ab408514b52aa139e4236ce0c43", + "cancellationRequestDate": "2024-03-04T15:45:02.1306363+00:00", + "reason": "Incorrect product", + "requestedByUser": true, + "paymentData": { + "payments": [ + { + "paymentSystem": "1", + "paymentSystemName": "Visa", + "value": 32499, + "installments": 1, + "referenceValue": 32499, + "group": "creditCard" + } + ], + "connectorResponses": { + "Message": "Processing Payment", + "tid": "2212318890", + "authorizationId": "333333", + "status": "Approved", + "delayToAutoSettle": 432000, + "ReturnCode": "6205", + "nsu": "1234567891111110", + "code": "2000", + "message": "Transaction approved", + "acquirer": "Visa", + "authId": "769670", + "paymentId": "1138342255777", + "delayToAutoSettleAfterAntifraud": "12000" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:sellerOrderId/fulfill - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:sellerOrderId/fulfill - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:sellerOrderId/fulfill - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:sellerOrderId/fulfill - Schema is valid", function () { + const schema = {"type":"object","description":"Details related to an order, including the order approval date, marketplace order ID, order number, and order receipt code.","properties":{"date":{"type":"string","title":"Date","description":"Order approval date."},"marketplaceOrderId":{"type":"string","title":"Marketplace Order Id","description":"Identifies the order. The seller should use this ID to trigger the fulfillment process of the corresponding order."},"orderId":{"type":"string","title":"Order Id","description":"Order number."},"receipt":{"type":"string","description":"Order receipt code.","title":"Receipt"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent from VTEX to the seller after the payment is approved, to notify them that the fulfillment process can start. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerOrderId` | path | (Required) Seller's order ID of the order ready for fulfillment. The seller can be a VTEX seller or an external one. | + | `fulfillmentEndpoint` | path | (Required) This is the fulfillment endpoint registered for each specific external seller in the **seller management** section of VTEX's admin panel. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2014-10-06 18:52:00", + "marketplaceOrderId": "1138342255777-01", + "orderId": "959311095", + "receipt": "e39d05f9-0c54-4469-a626-8bb5cff169f8" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Fulfillment simulation - external seller.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Fulfillment simulation - external seller.yml new file mode 100644 index 0000000000..5f7a1f5ab2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Fulfillment simulation - external seller.yml @@ -0,0 +1,224 @@ +info: + name: Fulfillment simulation - external seller + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/pvt/orderForms/simulation" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: fulfillmentEndpoint + value: marketplaceexample.externalseller.com + type: path + body: + type: json + data: |- + { + "postalCode": "22270-030", + "geoCoordinates": [ + "-22.9443504" + ], + "country": "BRA", + "items": [ + { + "id": "6", + "quantity": 1, + "seller": "01" + } + ], + "sc": "1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orderForms/simulation - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orderForms/simulation - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orderForms/simulation - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orderForms/simulation - Schema is valid", function () { + const schema = {"title":"Response body","description":"Expected response body of fulfillment simulation.","type":"object","required":["country","items","logisticsInfo","postalCode"],"properties":{"country":{"title":"Country","description":"ISO 3-digit code of the country where the delivery address is located. If you don’t want to send it, use the value null.","type":"string"},"items":{"title":"Items","description":"Contains the data about each SKU in the cart.","type":"array","items":{"title":"Items","description":"Contains the data about each SKU in the cart.","type":"object","required":["id","listPrice","measurementUnit","merchantName","offerings","price","priceTags","priceValidUntil","quantity","requestIndex","seller","unitMultiplier"],"properties":{"id":{"title":"id","description":"SKU ID.","type":"string"},"listPrice":{"title":"listPrice","description":"List price. It’s the amount presented to the customer as a “previous” price that has been lowered due to a discount. Don’t separate the decimal places. The last two digits are the cents.","type":"integer"},"measurementUnit":{"title":"measurementUnit","description":"SKU’s measurement unit.","type":"string"},"merchantName":{"title":"merchantName","description":"Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [​​Payments in VTEX marketplaces](https://help.vtex.com/en/tutorial/payments-in-vtex-marketplaces--2kYOfWCZYweJkYl18bw9yD) article to know more.","type":"string"},"offerings":{"title":"offerings","description":"Services that may be offered for this SKU. example are the assembly of a piece of furniture or warranty. In case these information are sent, the following fields are mandatory. If you don’t want to send it, use an empty array.","type":"array","items":{"title":"offerings","description":"Services that may be offered for this SKU. example are the assembly of a piece of furniture or warranty. In case these information are sent, the following fields are mandatory. If you don’t want to send it, use an empty array.","type":"object","required":["type","id","name","price"],"properties":{"type":{"title":"type","description":"Type of the service.","type":"string"},"id":{"title":"id","description":"Service ID.","type":"string"},"name":{"title":"name","description":"Service name.","type":"string"},"price":{"title":"price","description":"Service price. The last two digits are the cents.","type":"integer"}}}},"price":{"title":"price","description":"Actual selling price of the SKU. Don’t separate the decimal places. The last two digits are the cents.","type":"integer"},"priceTags":{"title":"priceTags","description":"List with the promotions applied to the SKU.","type":"array","items":{"title":"priceTags","description":"Promotions applied to the SKU.","type":"string"}},"priceValidUntil":{"title":"priceValidUntil","description":"Expiration date of the SKU price. Example: `2014-03-01T22:58:28.143`. In case you don’t want to send it, use the value null.","type":["string","null"]},"quantity":{"title":"quantity","description":"Quantity of the item. The seller should send the quantity that was indicated in the request, or the maximum quantity possible.","type":"integer","default":0},"requestIndex":{"title":"requestIndex","description":"Position of this item in the original array (request).","type":"integer"},"seller":{"title":"seller","description":"ID of the seller as registered in VTEX. You should send the same value that came in the request.","type":"string"},"unitMultiplier":{"title":"unitMultiplier","description":"SKU unit multiplier. The default value is 1.","type":"integer"}}}},"logisticsInfo":{"title":"logisticsInfo","description":"Array that contains the data regarding the delivery methods and stock for each item. If all products are unavailable, this field should return empty.","type":"array","items":{"description":"Description of each logistics data object.","type":"object","required":["itemIndex","quantity","shipsTo","slas","stockBalance","deliveryChannels"],"properties":{"itemIndex":{"title":"itemIndex","description":"Position of this item in the original array, i.e., in the array that came with the request. This index is what identifies which SKU you are referring to for each object inside the `logisticsInfo`.","type":"integer"},"quantity":{"title":"quantity","description":"Quantity of the item. The seller should send the quantity that was indicated in the request, or the maximum quantity possible.","type":"integer"},"shipsTo":{"title":"shipsTo","description":"ISO 3-digit code of the countries to where the SKU is delivered.","type":"array","items":{"title":"shipsTo","description":"Array of country codes.","type":"string"}},"slas":{"title":"slas","description":"Contains the available delivery methods.","type":"array","items":{"title":"slas","description":"Object with delivery methods information.","type":"object","required":["id","deliveryChannel","name","price","shippingEstimate","availableDeliveryWindows","pickupStoreInfo"],"properties":{"id":{"title":"id","description":"Identifier of the delivery method.","type":"string"},"deliveryChannel":{"title":"deliveryChannel","description":"Type of delivery channel. The values that are possible are: `pickup-in-point` for pickup point and `delivery` for regular delivery.","type":"string"},"name":{"title":"name","description":"Name of the delivery method.","type":"string"},"price":{"title":"price","description":"Delivery price. The two last digits are the cents.","type":"integer"},"shippingEstimate":{"title":"shippingEstimate","description":"Time estimated for the delivery. Possible suffixes are `bd` for *business day* , `h` for *hours*, and `m` for *minutes*.","type":"string"},"availableDeliveryWindows":{"title":"availableDeliveryWindows","description":"Contains the delivery windows available for the SLA.","type":"array","items":{"title":"availableDeliveryWindows","description":"Object with delivery windows information.","type":"object","required":["startDateUtc","endDateUtc","price"],"properties":{"startDateUtc":{"title":"startDateUtc","description":"Start date of the delivery window.","type":"string"},"endDateUtc":{"title":"endDateUtc","description":"End date of the delivery window.","type":"string"},"price":{"title":"price","description":"Extra price for scheduled delivery. The last two digits are the cents.","type":"integer"}}}},"pickupStoreInfo":{"title":"pickupStoreInfo","description":"Contains the data about the pickup point. If you do not want to send this, use the value `null`.","type":["object","null"],"required":["isPickupStore","friendlyName","address","additionalInfo"],"properties":{"isPickupStore":{"title":"isPickupStore","description":"`true` if it is a pickup point.","type":"boolean"},"friendlyName":{"title":"friendlyName","description":"Friendly name of the pickup point.","type":"string"},"address":{"title":"address","description":"Address data of the pickup point.","type":"object","required":["addressType","receiverName","addressId","postalCode","city","state","country","street","number","neighborhood","complement","reference","geoCoordinates"],"properties":{"addressType":{"title":" addressType","description":"The possible value is pickup.","type":"string"},"receiverName":{"title":"receiverName","description":"Name of the person who will receive the product. May be sent as `null`.","type":["string","null"]},"addressId":{"title":"addressId","description":"Identifies the pickup point.","type":"string"},"postalCode":{"title":"postalCode","description":"Postal code of the pickup point. This field is mandatory, for shopping carts simulations, where both Country and Postal Code are required. This field should be sent as `null` for storefront simulations, where the information is not necessary.","type":"string"},"city":{"title":"city","description":"Pickup point's city.","type":"string"},"state":{"title":"state","description":"Pickup point's state.","type":"string"},"country":{"title":"country","description":"3-digit ISO code of the country where the pickup point is located.","type":"string"},"street":{"title":"street","description":"Street where the pickup point is located.","type":"string"},"number":{"title":"number","description":"Address number of the pickup point.","type":"string"},"neighborhood":{"title":"neighborhood","description":"Neighborhood where the pickup point is located.","type":"string"},"complement":{"title":"complement","description":"Complement of the pickup point address.","type":"string"},"reference":{"title":"reference","description":"A reference for the pickup point address.","type":["string","null"]},"geoCoordinates":{"title":"geoCoordinates","description":"Contains the geographic coordinates of the pickup point.","type":"array","items":{"title":"geoCoordinates","description":"Contains the geographic coordinates of the pickup point.","type":"number"}}}},"additionalInfo":{"title":"additionalInfo","description":"Description or extra information about the pickup point.","type":"string"}}}}}},"stockBalance":{"title":"stockBalance","description":"Stock balance of the SKU.","type":"integer"},"deliveryChannels":{"title":"deliveryChannels","description":"Array contains the stock balance for each channel.","type":"array","items":{"title":"deliveryChannels","description":"Object containing ID and stockbalance of each delivery channel.","type":"object","required":["id","stockBalance"],"properties":{"id":{"title":"id","description":"Identifies the channel type whose stock balance will be informed in the next field. Possible values are: pickup-in-point for pickup point and delivery for regular delivery.","type":"string"},"stockBalance":{"title":"stockBalance","description":"Stock balance for the channel type selected in the previous field.","type":"integer"}}}}}}},"postalCode":{"title":"postalCode","description":"Postal code of the delivery address. This field is mandatory, for shopping carts simulations, where both Country and Postal Code are required. This field should be sent as `null` for storefront simulations, where the information is not necessary.","type":"string"},"allowMultipleDeliveries":{"description":"Flag for permission of multiple deliveries.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint may be called upon by VTEX for fulfillment simulation in the external seller different contexts. See examples below. + + When a [price](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) or [inventory](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory) notification request returns a response with status `200 OK`, it means that the SKU already exists in the marketplace. Whenever this happens, the marketplace will call the seller to get two updated information about the SKU: Price and Inventory. + + The seller needs to have an endpoint implemented in order to receive this call and send a response containing the requested information to the marketplace. We call it the Fulfillment Simulation endpoint. + + If the seller wishes to include other parameters in this call (like account name, or [sales channel](https://help.vtex.com/en/tutorial/como-funciona-uma-politica-comercial--6Xef8PZiFm40kg2STrMkMV) ID), this should be done within their {fulfillmentEndpoint}. This path is then inserted in the marketplace's VTEX admin when [configuring a seller](https://help.vtex.com/en/tutorial/configurando-seller--tutorials_392). + + The marketplace will send an object containing an array of items. The seller must use this list to get the updated information about the referred SKUs and send them back to the marketplace, following the response format explained in the API Reference. + + This call is also applied in the Storefront simulation scenario, in which case the request from VTEX does not send the parameters `country` and `postalCode`. + The call's payload can be adapted into two scenarios: + + - **Displaying items in the storefront**: the address information can be nulled in the request since they are not mandatory data for this context. + - **Making a shopping cart simulation during checkout**: address information must be sent since this data is needed to calculate freight values. If the address information (including `postalCode` and `country`) is not sent through the call, VTEX interprets the stock balance as zero. Without a valid stock balance, the seller will not be shown as an option during checkout. + + ## Request body example - Indexing simulation + + ``` + { + "items": [ + { + "id": "7908010136043", + "quantity": 1, + "seller": "1", + } + ], + "isCheckedIn": false, + } + ``` + ## Request body example - Checkout simulation + + ``` + { + "items": [ + { + "id": "7908010136043", + "quantity": 1, + "seller": "1", + } + ], + "postalCode": "22270-030", + "country": "BRA", + } + ``` + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `fulfillmentEndpoint` | path | (Required) This is the fulfillment endpoint registered for each specific external seller in the **seller management** section of VTEX's admin panel. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "country": "BRA", + "items": [ + { + "id": "2000037", + "listPrice": 67203, + "measurementUnit": "un", + "merchantName": "mySeller1", + "offerings": [ + { + "type": "Warranty", + "id": "5", + "name": "1 year warranty", + "price": 10000 + } + ], + "price": 67203, + "priceTags": [], + "priceValidUntil": "2014-03-01T22:58:28.143", + "quantity": 1, + "requestIndex": 0, + "seller": "1", + "unitMultiplier": 1 + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "quantity": 1, + "shipsTo": [ + "BRA" + ], + "slas": [ + { + "id": "Curbside pickup", + "deliveryChannel": "pickup-in-point", + "name": "Curbside pickup", + "shippingEstimate": "0bd", + "price": 0, + "availableDeliveryWindows": [ + { + "startDateUtc": "2013-02-04T08:00:00+00:00", + "endDateUtc": "2013-02-04T13:00:00+00:00", + "price": 0 + } + ], + "pickupStoreInfo": { + "isPickupStore": true, + "friendlyName": "Santa Felicidade", + "address": { + "addressType": "pickup", + "receiverName": "Juliana", + "addressId": "548304ed-dd40-4416-b12b-4b32bfa7b1e0", + "postalCode": "82320-040", + "city": "Curitiba", + "state": "PR", + "country": "BRA", + "street": "Rua Domingos Strapasson", + "number": "100", + "neighborhood": "Santa Felicidade", + "complement": "Loja 10", + "reference": "Next to the unicorn statue", + "geoCoordinates": [ + 49.334934, + 25.401705 + ] + }, + "additionalInfo": "" + } + } + ], + "stockBalance": 199, + "deliveryChannels": [ + { + "id": "delivery", + "stockBalance": 179 + }, + { + "id": "pickup-in-point", + "stockBalance": 20 + } + ] + } + ], + "postalCode": "80250000", + "allowMultipleDeliveries": true + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Marketplace order cancellation.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Marketplace order cancellation.yml new file mode 100644 index 0000000000..930323016e --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Marketplace order cancellation.yml @@ -0,0 +1,120 @@ +info: + name: Marketplace order cancellation + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:orderId/cancel" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1138342255777-01 + type: path + - name: fulfillmentEndpoint + value: marketplaceexample.externalseller.com + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "1138342255777-01", + "marketplaceOrderGroup": "group-123", + "cancellationRequestId": "85835ab408514b52aa139e4236ce0c33", + "cancellationRequestDate": "2024-03-04T15:45:02.1306363+00:00", + "reason": "Out of stock", + "requestedByUser": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:orderId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:orderId/cancel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:orderId/cancel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:orderId/cancel - Schema is valid", function () { + const schema = {"type":"object","description":"Details related to an order, including the order approval date, marketplace order ID, order number, and order receipt code.","properties":{"date":{"type":"string","title":"Date","description":"Order approval date."},"marketplaceOrderId":{"type":"string","title":"Marketplace Order Id","description":"Identifies the order. The seller should use this ID to trigger the fulfillment process of the corresponding order."},"orderId":{"type":"string","title":"Order Id","description":"Order number."},"receipt":{"type":"string","description":"Order receipt code.","title":"Receipt"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request may be sent from VTEX to the external seller in case of order cancelation. For that, the seller will need to implement the Marketplace order cancellation endpoint. Whenever this request is received by the seller, the order should be canceled and the fulfillment flow should not proceed. + + For the seller to: + + - **Evaluate a cancellation request:** it is possible to send an empty body as a response to the cancellation request, meaning that the seller is evaluating whether to proceed with the cancellation or not. + + - **Confirm the cancellation request:** it is possible to confirm the order cancellation by the marketplace by responding to the call with a body including only one information: the `marketplaceOrderId`, which identifies the order in the marketplace. The seller should use this ID to trigger the cancellation of the corresponding order. The seller should then respond with the same `marketplaceOrderId` and also with the `orderId`, which identifies the order in the seller, the date and time of the notification receipt, and a protocol code that confirms the receipt of the request (which may have the value `null`). + + - **Refuse a cancellation request:** it is possible to to [send the Invoice](https://developers.vtex.com/vtex-rest-api/reference/external-seller#send-invoice), meaning that the cancellation has been denied, and the flow continues to the [Order Invoicing](https://developers.vtex.com/vtex-rest-api/docs/external-seller-integration-connector#order-invoicing) step, and the ones that follow it. + + >⚠️ This call should be made twice: once for the *Evaluate cancellation request* scenario, and a second time to *Confirm cancellation* or *Refuse cancellation*. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Order Cancellation** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Cancela Pedidos | Order Cancellation | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) ID of the order being fulfilled. | + | `fulfillmentEndpoint` | path | (Required) This is the fulfillment endpoint registered for each specific external seller in the **seller management** section of VTEX's admin panel. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2019-05-09 15:31:23", + "marketplaceOrderId": "959311095", + "orderId": "1138342255777-01", + "receipt": "e39d05f9-0c54-4469-a626-8bb5cff169f8" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Order placement.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Order placement.yml new file mode 100644 index 0000000000..4eacefcf99 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/Order placement.yml @@ -0,0 +1,315 @@ +info: + name: Order placement + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders" + headers: + - name: content-length + value: "2183" + - name: authorization + value: VTEX key="appKey" token="appToken" + - name: Accept + value: application/json + - name: accept-enconding + value: gzip, deflate + - name: x-vtex-operation-id + value: 8032114b-63e9-4e64-b30c-f7afcf676d7a + - name: x-forwarded-proto + value: https + - name: x-forwarded-for + value: 179.35.30.186, 130.176.35.67, 172.16.247.49 + - name: x-vtex-cache-client-bypass + value: "1" + - name: Content-Type + value: application/json + - name: traceparent + value: 00-083c0ca18bc8d94183f333809a70cd64-bf5e9a641e230540-00 + params: + - name: fulfillmentEndpoint + value: marketplaceexample.externalseller.com + type: path + body: + type: json + data: |- + { + "marketplaceOrderId": "1138342255777-01", + "marketplaceServicesEndpoint": "https://marketplaceservicesendpoint.myvtex.com/", + "marketplacePaymentValue": 2499, + "items": [ + { + "id": "123456789abc", + "quantity": 1, + "seller": "seller-example", + "commission": 0, + "freightCommission": 0, + "price": 2499, + "bundleItems": [ + { + "id": 12, + "quantity": 2 + }, + { + "id": 5, + "quantity": 1 + } + ], + "itemsAttachment": [ + { + "id": "attachment-1", + "name": "Product Manual", + "url": "https://example.com/manual.pdf" + } + ], + "attachments": [ + { + "id": "attachment-2", + "name": "Product Image", + "url": "https://example.com/image.jpg" + } + ], + "priceTags": [ + { + "identifier": "1234abc-5678b-1234c", + "isPercentual": false, + "name": "discount@name-1234abc-5678b-1234c", + "rawValue": 12, + "value": 1200 + } + ], + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false + } + ], + "paymentData": null, + "clientProfileData": { + "email": "customer@examplemail.com", + "firstName": "first-name", + "lastName": "last-name", + "documentType": "cpf", + "document": "123456789", + "phone": "+55110988887777", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false + }, + "shippingData": { + "address": { + "addressType": "residential", + "receiverName": "receiver-name", + "addressId": "Home", + "postalCode": "12345-000", + "city": "Rio de Janeiro", + "state": "Rio de Janeiro", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "neighborhood": "Botafogo", + "complement": "3rd floor", + "reference": "Grey building", + "geoCoordinates": [ + "49.334934", + "25.401705" + ] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Express", + "lockTTL": "8d", + "shippingEstimate": "7d", + "price": 1099, + "deliveryWindow": { + "startDateUtc": "2016-04-20T08:00:00+00:00", + "endDateUtc": "2016-04-20T12:00:00+00:00", + "listPrice": 10 + } + } + ], + "updateStatus": "updated" + }, + "marketingData": { + "utmSource": "Facebook", + "utmMedium": "CPC", + "utmCampaign": "Black friday", + "utmiPage": "utmi_page-example", + "utmiPart": "utmi_part-exmaple", + "utmiCampaign": "utmi_campaign-exmaple" + }, + "openTextField": "open-text-example" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders - Schema is valid", function () { + const schema = {"description":"Expected response from the Order Placement endpoint.","type":"object","properties":{"marketplaceOrderId":{"description":"Number of the order in the marketplace.","type":"string"},"orderId":{"description":"Order number.","type":"string"},"followUpEmail":{"description":"Email for contact with the store (seller).","type":"string"},"items":{"description":"List of order items.","type":"array","items":{"description":"Details of an order item.","type":"object","properties":{"id":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of the item."},"seller":{"type":"string","description":"ID of the seller registered in VTEX."},"commission":{"type":"integer","description":"Comission."},"freightCommission":{"type":"integer","description":"Freight comission."},"price":{"type":"number","description":"SKU price. The last two digits are the cents. For example, $24.99 is represented 2499."},"bundleItems":{"type":"array","description":"Information on services sold along with the SKU. Example: a gift package.","items":{"description":"An item included in a bundle, representing a service or product.","type":"object","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service identifier."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price. The last two digits are the cents."}}}},"itemsAttachment":{"type":"array","description":"Attachments sold with the SKU.","items":{"type":"object","description":"An attachment associated with an item, containing additional information or customization requested by the customer.","properties":{"name":{"type":"string","description":"Attachment name."},"content":{"type":"string","description":"Content referring to the customization requested by the customer."}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"object","description":"Attachment information.","properties":{"id":{"type":"string","description":"Unique identifier of the attachment."},"name":{"type":"string","description":"Name of the attachment."},"url":{"type":"string","description":"URL of the attachment."}}}},"priceTags":{"type":"array","description":"Array of price tags. Each one modifies the price in some way, like discounts or rates that apply to the item in the context of the order.","items":{"description":"Details of a price tag affecting the item's price.","type":"object","properties":{"identifier":{"type":"string","description":"Price tag identifier."},"isPercentual":{"type":"boolean","description":"`true` if price tag value is applied through a percentage."},"name":{"type":"string","description":"Price tag name."},"rawValue":{"type":"integer","description":"Price tag value."},"value":{"type":"integer","description":"Price tag raw value."}}}},"measurementUnit":{"type":"string","description":"SKU measurement unit."},"unitMultiplier":{"type":"integer","description":"SKU unit multiplier."},"isGift":{"type":"boolean","description":"`true` if the item is a gift."}}}},"clientProfileData":{"description":"Customer's data.","type":"object","properties":{"email":{"type":"string","description":"Customer's email address."},"firstName":{"type":"string","description":"Customer's first name."},"lastName":{"type":"string","description":"Customer's last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document number informed by the customer."},"phone":{"type":"string","description":"Customer's phone number."},"corporateName":{"type":["string","null"],"description":"Company name, if the customer is a legal entity."},"tradeName":{"type":["string","null"],"description":"Trade name, if the customer is a legal entity."},"corporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"stateInscription":{"type":["string","null"],"description":"State inscription, if the customer is a legal entity."},"corporatePhone":{"type":["string","null"],"description":"Corporate phone number, if the customer is a legal entity."},"isCorporate":{"type":["boolean","null"],"description":"`true` if the customer is a legal entity.","default":false}}},"shippingData":{"description":"Shipping information.","type":"object","properties":{"address":{"type":"object","description":"Shipping address.","required":["addressType","receiverName","postalCode","city","state","country","street","neighborhood","number"],"properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`, among others."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":"string","description":"Address ID."},"postalCode":{"type":"string","description":"Postal Code."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letter ISO code of the country of the shipping address."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":"string","description":"Complement to the shipping address in case it applies."},"reference":{"type":"string","description":"Complement that might help locate the shipping address more precisely in case of delivery."},"geoCoordinates":{"type":"array","description":"Geographic coordinates of the delivery address. This may be used instead of the postalCode, in case the marketplace is configured to accept geolocation. Example of value: `[-22.9443504,-43.1825635]`.","items":{"description":"Coordinate value.","type":"string"}}}},"logisticsInfo":{"type":"array","description":"Array of objects containing logistics information of each item.","items":{"description":"Logistics information for a specific item.","type":"object","required":["itemIndex","selectedSla","price"],"properties":{"itemIndex":{"type":"integer","description":"Index of the item in the `items` array, starting from 0."},"selectedSla":{"type":"string","description":"Selected shipping option."},"lockTTL":{"type":"string","description":"Logistics reservation waiting time."},"shippingEstimate":{"type":"string","description":"Estimated time until delivery for the item."},"price":{"type":"integer","description":"Shipping price for the item. Does not account for the whole order's shipping price."},"deliveryWindow":{"type":"object","description":"Scheduled delivery window information, in case it applies to the item.","properties":{"startDateUtc":{"type":"string","description":"Scheduled delivery window start date in UTC."},"endDateUtc":{"type":"string","description":"Scheduled delivery window end date in UTC."},"listPrice":{"type":"number","description":"Scheduled delivery window list price."}}}}}}}},"paymentData":{"type":["object","null"],"description":"In other contexts, this field tipically holds an object with payment information. However, since the payment is processed by the marketplace, it will be sent to the seller as `null` in this context."},"customData":{"description":"Custom data for the order.","type":"object"},"allowMultipleDeliveries":{"description":"Flag for permission of multiple deliveries.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent by VTEX to the external seller once the customer finishes their checkout, to let the seller know there is a newly placed order. It does that by calling the **Order Placement** endpoint, which needs to be implemented by the seller. + + The marketplace will send information such as the items contained in the cart, the client’s profile data, the shipping data, and the payment data. With all that, the seller will be able to create the order in their store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | VTEX Fulfilment | Fulfilment Resources | **Place Orders** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Create orders | Place Orders | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `fulfillmentEndpoint` | path | (Required) This is the fulfillment endpoint registered for each specific external seller in the **seller management** section of VTEX's admin panel. | + | `content-length` | header | (Required) Length of the request body. | + | `authorization` | header | (Required) Indicates authorization. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `accept-enconding` | header | (Required) Indicates the types of response enconding the client can understand. | + | `x-vtex-operation-id` | header | (Required) VTEX operation ID. | + | `x-forwarded-proto` | header | (Required) Determines the protocol used by the client in the request. | + | `x-forwarded-for` | header | (Required) Identifies the originating IP address of the HTTP client. | + | `x-vtex-cache-client-bypass` | header | (Required) VTEX cache client bypass. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `traceparent` | header | (Required) Identifies the incoming request in a tracing system. | + + ## Example response (`200`) + + ```json + { + "marketplaceOrderId": "959311095", + "orderId": "7890", + "followUpEmail": "seller@example.com", + "items": [ + { + "id": "2002495", + "quantity": 1, + "seller": "1", + "commission": 0, + "freightCommission": 0, + "price": 2499, + "bundleItems": [], + "itemAttachment": { + "name": null, + "content": {} + }, + "attachments": [], + "priceTags": [], + "measurementUnit": "g", + "unitMultiplier": 1, + "isGift": false + } + ], + "clientProfileData": { + "email": "customer@examplemail.com.br", + "firstName": "John", + "lastName": "Smith", + "documentType": "taxpayer registration number", + "document": "33333333333", + "phone": "+55110988887777", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false, + "userProfileId": null + }, + "shippingData": { + "address": { + "addressType": "residencial", + "receiverName": "John Smith", + "addressId": "Home", + "postalCode": "12345-000", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "neighborhood": "Botafogo", + "complement": "3rd floor", + "reference": "Grey building", + "geoCoordinates": [ + "49.334934", + "25.401705" + ] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Express", + "lockTTL": "8d", + "shippingEstimate": "7d", + "price": 1099, + "deliveryWindow": { + "startDateUtc": "2016-04-20T08:00:00+00:00", + "endDateUtc": "2016-04-20T12:00:00+00:00", + "listPrice": 10 + } + } + ] + }, + "customData": { + "openTextField": null, + "marketingData": { + "utmSource": "buscape", + "utmMedium": "", + "utmCampaign": "freeshipping", + "utmiPage": "_", + "utmiPart": "BuscaFullText", + "utmiCampaign": "artscase for iphone 5" + } + }, + "paymentData": null, + "allowMultipleDeliveries": true + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/folder.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/folder.yml new file mode 100644 index 0000000000..08d5552c81 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/External Seller/folder.yml @@ -0,0 +1,4 @@ +info: + name: External Seller + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/environments/VTEX.yml new file mode 100644 index 0000000000..e23af4efff --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: fulfillmentEndpoint + value: "{fulfillmentEndpoint}" + - name: baseUrl + value: https://{{fulfillmentEndpoint}} + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/opencollection.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/opencollection.yml new file mode 100644 index 0000000000..57b60da8f0 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Fulfillment/opencollection.yml @@ -0,0 +1,58 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace Protocol - External Seller Fulfillment + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The _Marketplace Protocol_ is a set of API requests and definitions to help you integrate external sellers into a VTEX marketplace as well as external marketplaces into VTEX sellers. + + ## External Seller + + Here you will find the endpoints involved in the integration between a VTEX marketplace and an external seller. Note that some of these requests are typically sent by the seller while others are received. + + | **Request** | **From** | **To** | + |-|-|-| + | [Fulfillment simulation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orderForms/simulation) | Marketplace | Seller | + | [Order placement](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders) | Marketplace | Seller | + | [Authorize fulfillment](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-sellerOrderId-/fulfill) | Marketplace | Seller | + | [Marketplace order cancellation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-orderId-/cancel) | Marketplace | Seller | + | [Send invoice](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice) | Seller | Marketplace | + | [Send tracking information](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-) | Seller | Marketplace | + | [Update tracking status](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-/tracking) | Seller | Marketplace | + | [Cancel order in marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/cancel) | Seller | Marketplace | + + For a detailed explanation of the steps required to develop a custom connector to sell products from an external seller in your storefront, check out our complete [External Seller Integration Guide](https://developers.vtex.com/docs/guides/external-seller-integration-guide). + + + ## External Marketplace + + In this section, you will find the endpoints involved in the VTEX integration between an external marketplace and a VTEX seller. + + + | **Request** | **From** | **To** | + |-|-|-| + | [VTEX Mapper Registration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/connector/register) | External marketplace | VTEX system | + | [Send Category Mapping to VTEX Mapper](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/categories/marketplace/-id-) | External marketplace | VTEX system | + | [New Order Integration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/order-integration/orders) | External marketplace | VTEX system | + | [Update Order Status](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#put-/api/order-integration/orders/status) | External marketplace | VTEX system | + | [Fulfillment simulation - External Marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/checkout/pub/orderForms/simulation) | External marketplace | VTEX system | + | [Place fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders) | External marketplace | VTEX Seller | + | [Authorize dispatch for fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders/-orderId-/fulfill) | External marketplace | VTEX Seller | + + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Cancel order in marketplace.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Cancel order in marketplace.yml new file mode 100644 index 0000000000..f30142b5f2 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Cancel order in marketplace.yml @@ -0,0 +1,104 @@ +info: + name: Cancel order in marketplace + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:marketplaceOrderId/cancel" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: marketplaceOrderId + value: 1138342255777-01 + type: path + - name: marketplaceServicesEndpoint + value: marketplaceservicesendpoint.myvtex.com + type: path + body: + type: json + data: |- + { + "reason": "Product is unavailable." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:marketplaceOrderId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/cancel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/cancel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/cancel - Schema is valid", function () { + const schema = {"properties":{"date":{"type":"string","description":"Request processing date and time."},"orderId":{"type":"string","description":"Order ID referring to the Invoice number sent."},"receipt":{"type":"string","description":"Requisition receipt code."}},"example":{"date":"2021-06-09T15:22:56.7612218-02:00","orderId":"1138342255777-01","receipt":"527b1ae251264ef1b7a9b597cd8f16b9"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent by the external seller to the VTEX marketplace to cancel an order. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Order Cancellation** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Cancel Orders | Order Cancellation | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `marketplaceOrderId` | path | (Required) Identifies the order in the marketplace. | + | `marketplaceServicesEndpoint` | path | (Required) This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2021-06-09T15:22:56.7612218-02:00", + "orderId": "1138342255777-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send agreement for order modifications.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send agreement for order modifications.yml new file mode 100644 index 0000000000..86617ba9e8 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send agreement for order modifications.yml @@ -0,0 +1,126 @@ +info: + name: Send agreement for order modifications + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:participantOrderId/changes/:changeRequestId/send-agreement?accountName=storeName" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: accountName + value: storeName + type: query + - name: participantOrderId + value: "" + type: path + - name: changeRequestId + value: "" + type: path + - name: orderId + value: v12772213qst-02 + type: path + - name: changeId + value: e8532a32-7f7e-434a-88ec-29609f0ede46 + type: path + body: + type: json + data: |- + { + "agreementType": "Acknowledgment" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:participantOrderId/changes/:changeRequestId/send-agreement - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:participantOrderId/changes/:changeRequestId/send-agreement - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:participantOrderId/changes/:changeRequestId/send-agreement - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:participantOrderId/changes/:changeRequestId/send-agreement - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderId":{"type":"string","description":"ID of the order refered in the agreement."},"changeRequestId":{"type":"string","description":"ID of the order modification refered in the agreement."},"agreementType":{"type":"string","description":"Type of agreement sent by the external seller.","enum":["Acknowledgment","Confirmation"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint sends an agreement for an order modification to VTEX. It can be used by external sellers to acknowledge that a modification request was made and confirm that the modification has been applied to their order. + + After a shopper requests a modification, VTEX automatically calls the external seller through the new client, sending a request to the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint while also sending the order modifications agreement with `agreementType: Acknowledgment`, indicating that it is waiting for a response from the seller. + + When the seller receives the modification request, they must use this same endpoint with `agreementType` also set to `Acknowledgment`, to register they acknowledge the request and are going to apply the modifications to the order. + + In the confirmation step, VTEX sends `agreementType: Confirmation`, and waits for a callback from the seller. Once the seller modifies the order, they must respond by calling this same endpoint with `agreementType` set to `Confirmation`. This allows the flow to proceed normally and the modification to be completed successfully. + + > ⚠️ The system only considers the modification as applied when it receives the status `Confirmation` from the external seller. + + The steps for the agreement flow are as follows: + + 1. Shopper requests modifications. + + 2. VTEX sends `Acknowledgment` to the External Seller. + + 3. External Seller sends `Acknowledgment` back to VTEX. + + External Seller acknowledges the request for modifications and will apply them to the order. + + 4. VTEX sends `Confirmation` to the External Seller. + + 5. External Seller sends `Confirmation` back to VTEX. + + External Seller confirms the modifications have been applied to the order. + + 6. The order flow continues. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID of the order for wish you want to send the agreement. | + | `changeId` | path | (Required) Once you make an order modification, you generate a `changeId` code that identifies the modifications made to that order. This field should be filled with that code. | + | `accountName` | query | (Required) Name of the VTEX account that created the order. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "orderId": "v12772213qst-02", + "changeRequestId": "e8532a32-7f7e-434a-88ec-29609f0ede46", + "agreementType": "Acknowledgment" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send invoice.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send invoice.yml new file mode 100644 index 0000000000..08f193cfbd --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send invoice.yml @@ -0,0 +1,114 @@ +info: + name: Send invoice + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:marketplaceOrderId/invoice" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: marketplaceOrderId + value: 1138342255777-01 + type: path + - name: marketplaceServicesEndpoint + value: marketplaceservicesendpoint.myvtex.com + type: path + - name: invoiceNumber + value: NFe-00002 + type: path + body: + type: json + data: |- + { + "type": "Output", + "invoiceNumber": "NFe-00002", + "items": [ + { + "id": "6", + "quantity": 1, + "price": 5500 + }, + { + "id": "6", + "quantity": 1, + "price": 5500 + } + ], + "courier": "courier-example", + "trackingNumber": "12345678abc", + "trackingUrl": "https://courier-example.com/tracking", + "issuanceDate": "2021-05-21T10:00:00", + "invoiceValue": 6000 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice - Schema is valid", function () { + const schema = {"properties":{"date":{"type":"string","description":"Request processing date and time."},"orderId":{"type":"string","description":"Order ID referring to the Invoice number sent."},"receipt":{"type":"string","description":"Requisition receipt code."}},"example":{"date":"2021-06-09T15:22:56.7612218-02:00","orderId":"1138342255777-01","receipt":"527b1ae251264ef1b7a9b597cd8f16b9"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent by the external seller to the VTEX marketplace to send invoice information. + + This can be necessary in a regular order or in the case of a return. The `type` field is used to indicate which of these is the case. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `marketplaceOrderId` | path | (Required) Identifies the order in the marketplace. | + | `marketplaceServicesEndpoint` | path | (Required) This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders). | + | `invoiceNumber` | path | (Required) Invoice number. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2021-06-09T15:22:56.7612218-02:00", + "orderId": "1138342255777-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send tracking information.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send tracking information.yml new file mode 100644 index 0000000000..afc8b49bc7 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Send tracking information.yml @@ -0,0 +1,111 @@ +info: + name: Send tracking information + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: marketplaceOrderId + value: 1138342255777-01 + type: path + - name: invoiceNumber + value: NFe-00002 + type: path + - name: marketplaceServicesEndpoint + value: marketplaceservicesendpoint.myvtex.com + type: path + body: + type: json + data: |- + { + "courier": "courier-example", + "trackingNumber": "12345678abc", + "trackingUrl": "https://courier-example.com/tracking", + "dispatchedDate": "2021-06-09" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber - Schema is valid", function () { + const schema = {"properties":{"date":{"type":"string","description":"Request processing date and time."},"orderId":{"type":"string","description":"Order ID referring to the Invoice number sent."},"receipt":{"type":"string","description":"Requisition receipt code."}},"example":{"date":"2021-06-09T15:22:56.7612218-02:00","orderId":"1138342255777-01","receipt":"527b1ae251264ef1b7a9b597cd8f16b9"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent by the external seller to the VTEX marketplace to add tracking information to a given order's invoice, in case it is necessary to do so after the invoice has been sent. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Allows you to report invoices (NF) and tracking data | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `marketplaceOrderId` | path | (Required) Identifies the order in the marketplace. | + | `invoiceNumber` | path | (Required) Invoice number. | + | `marketplaceServicesEndpoint` | path | (Required) This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2021-06-09T15:22:56.7612218-02:00", + "orderId": "1138342255777-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Update tracking status.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Update tracking status.yml new file mode 100644 index 0000000000..ee68102f5d --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/Update tracking status.yml @@ -0,0 +1,122 @@ +info: + name: Update tracking status + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber/tracking" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: marketplaceOrderId + value: 1138342255777-01 + type: path + - name: invoiceNumber + value: NFe-00002 + type: path + - name: marketplaceServicesEndpoint + value: marketplaceservicesendpoint.myvtex.com + type: path + body: + type: json + data: |- + { + "isDelivered": true, + "events": [ + { + "city": "Rio de Janeiro", + "state": "Rio de Janeiro", + "description": "Order delivered.", + "date": "2021-03-16" + }, + { + "city": "Rio de Janeiro", + "state": "Rio de Janeiro", + "description": "Order delivered.", + "date": "2021-03-16" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber/tracking - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber/tracking - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber/tracking - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pvt/orders/:marketplaceOrderId/invoice/:invoiceNumber/tracking - Schema is valid", function () { + const schema = {"properties":{"date":{"type":"string","description":"Request processing date and time."},"orderId":{"type":"string","description":"Order ID referring to the Invoice number sent."},"receipt":{"type":"string","description":"Requisition receipt code."}},"example":{"date":"2021-06-09T15:22:56.7612218-02:00","orderId":"1138342255777-01","receipt":"527b1ae251264ef1b7a9b597cd8f16b9"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is sent by the external seller to the VTEX marketplace to update a given order's tracking status. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Allows you to report invoices (NF) and tracking data | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `marketplaceOrderId` | path | (Required) Identifies the order in the marketplace. | + | `invoiceNumber` | path | (Required) Invoice number. | + | `marketplaceServicesEndpoint` | path | (Required) This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2021-06-09T15:22:56.7612218-02:00", + "orderId": "1138342255777-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + ``` diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/folder.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/folder.yml new file mode 100644 index 0000000000..af99b17512 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/External seller/folder.yml @@ -0,0 +1,4 @@ +info: + name: External seller + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/environments/VTEX.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/environments/VTEX.yml new file mode 100644 index 0000000000..c2be79b2e3 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: marketplaceServicesEndpoint + value: "{marketplaceServicesEndpoint}" + - name: baseUrl + value: https://{{marketplaceServicesEndpoint}} + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/opencollection.yml b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/opencollection.yml new file mode 100644 index 0000000000..a89c54cc48 --- /dev/null +++ b/BrunoCollections/VTEX - Marketplace Protocol - External Seller Marketplace/opencollection.yml @@ -0,0 +1,59 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Marketplace Protocol - External Seller Marketplace + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The _Marketplace Protocol_ is a set of API requests and definitions to help you integrate external sellers into a VTEX marketplace as well as external marketplaces into VTEX sellers. + + ## External Seller + + Here you will find the endpoints involved in the integration between a VTEX marketplace and an external seller. Note that some of these requests are typically sent by the seller while others are received. + + | **Request** | **From** | **To** | + |-|-|-| + | [Fulfillment simulation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orderForms/simulation) | Marketplace | Seller | + | [Order placement](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders) | Marketplace | Seller | + | [Authorize fulfillment](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-sellerOrderId-/fulfill) | Marketplace | Seller | + | [Marketplace order cancellation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-orderId-/cancel) | Marketplace | Seller | + | [Send invoice](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice) | Seller | Marketplace | + | [Send tracking information](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-) | Seller | Marketplace | + | [Update tracking status](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-/tracking) | Seller | Marketplace | + | [Cancel order in marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/cancel) | Seller | Marketplace | + | [Send agreement for order modifications](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/orders/-participantOrderId-/changes/-changeRequestId-/send-agreement) | Seller | Marketplace | + + For a detailed explanation of the steps required to develop a custom connector to sell products from an external seller in your storefront, check out our complete [External Seller Integration Guide](https://developers.vtex.com/docs/guides/external-seller-integration-guide). + + + ## External Marketplace + + In this section, you will find the endpoints involved in the VTEX integration between an external marketplace and a VTEX seller. + + + | **Request** | **From** | **To** | + |-|-|-| + | [VTEX Mapper Registration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/connector/register) | External marketplace | VTEX system | + | [Send Category Mapping to VTEX Mapper](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/categories/marketplace/-id-) | External marketplace | VTEX system | + | [New Order Integration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/order-integration/orders) | External marketplace | VTEX system | + | [Update Order Status](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#put-/api/order-integration/orders/status) | External marketplace | VTEX system | + | [Fulfillment simulation - External Marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/checkout/pub/orderForms/simulation) | External marketplace | VTEX system | + | [Place fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders) | External marketplace | VTEX Seller | + | [Authorize dispatch for fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders/-orderId-/fulfill) | External marketplace | VTEX Seller | + + + For a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Master Data API - v2/Clusters/Validate document by clusters.yml b/BrunoCollections/VTEX - Master Data API - v2/Clusters/Validate document by clusters.yml new file mode 100644 index 0000000000..3bf27342fb --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Clusters/Validate document by clusters.yml @@ -0,0 +1,129 @@ +info: + name: Validate document by clusters + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id/clusters" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + [ + { + "name": "male", + "rule": "gender=male" + }, + { + "name": "complex", + "rule": "((gender=male AND percent=0.35) AND any is null) AND (name=*go*)" + }, + { + "name": "complex2", + "rule": "((gender=male AND percent=0.35) AND any is not null) OR (name=*go*)" + }, + { + "name": "createdIn", + "rule": "createdIn between 2015-10-28 AND 2015-10-30" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/:dataEntityName/documents/:id/clusters - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents/:id/clusters - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents/:id/clusters - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents/:id/clusters - Schema is valid", function () { + const schema = {"type":"array","description":"Array with objects validating each cluster rule.","items":{"type":"object","description":"Cluster rule validation object.","properties":{"name":{"type":"string","description":"Cluster name."},"isValid":{"type":"boolean","description":"Informs if the document is valid according to the cluster rule (`true`) or not (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Checks if a document is present in one or more clusters (specific set of field values). + + >ℹ️ There is a limit of five rules per request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "name": "male", + "isValid": false + }, + { + "name": "complex", + "isValid": false + }, + { + "name": "complex2", + "isValid": false + }, + { + "name": "createdIn", + "isValid": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Clusters/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Clusters/folder.yml new file mode 100644 index 0000000000..1465d8867d --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Clusters/folder.yml @@ -0,0 +1,4 @@ +info: + name: Clusters + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Create document with custom ID or update entire document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create document with custom ID or update entire document.yml new file mode 100644 index 0000000000..dfed8e6cfd --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create document with custom ID or update entire document.yml @@ -0,0 +1,92 @@ +info: + name: Create document with custom ID or update entire document + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _schema + value: schema + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: Newsletter-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "phone": "+12025550195", + "documentType": "CPF", + "document": "12345678900", + "isCorporate": false, + "isNewsletterOptIn": false, + "localeDefault": "en-US" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID. For example, you can update a customer profile or address. + + >ℹ️ You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + A## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the document. If you inform an **unused ID**, this endpoint will create a new document with the informed custom ID, differently from the [Create new document](https://developers.vtex.com/docs/api-reference/master-data-api-v2#post-/api/dataentities/-dataEntityName-/documents) endpoint, which automatically generates the ID. If you inform an **existing ID**, this endpoint will update the entire document associated with the informed ID. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Create new document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create new document.yml new file mode 100644 index 0000000000..a5d865d0f5 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create new document.yml @@ -0,0 +1,113 @@ +info: + name: Create new document + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + body: + type: json + data: |- + { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "phone": "+12025550195", + "documentType": "CPF", + "document": "12345678900", + "isCorporate": false, + "isNewsletterOptIn": false, + "localeDefault": "en-US" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/:dataEntityName/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/:dataEntityName/documents - Schema is valid", function () { + const schema = {"required":["Id","Href","DocumentId"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created, with data entity prefix."},"Href":{"type":"string","description":"Document reference URL."},"DocumentId":{"type":"string","description":"ID of the document that was created."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new document with an ID automatically generated by VTEX, corresponding to a new or existing data entity. If an unexisting `dataEntityName` is informed in the path, this endpoint will create the data entity as well as the new document. For example, you can create a new customer profile or address. + + >ℹ️ You can use this request to create documents for any data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. However you should be aware of the fields allowed or required for each document you wish to create. + + > To create a document with a custom ID, refer to the [Create document with custom ID](https://developers.vtex.com/docs/api-reference/master-data-api-v2#put-/api/dataentities/-dataEntityName-/documents/-id-) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": "Newsletter-cbfc4f67-6ea3-11ee-83ab-0a8d18f9f827", + "Href": "http://cosmetics2.vtexcommercestable.com.br/api/dataentities/Newsletter/documents/cbfc4f67-6ea3-11ee-83ab-0a8d18f9f827", + "DocumentId": "cbfc4f67-6ea3-11ee-83ab-0a8d18f9f827" + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Create partial document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create partial document.yml new file mode 100644 index 0000000000..6712932dd0 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Create partial document.yml @@ -0,0 +1,104 @@ +info: + name: Create partial document + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + body: + type: json + data: |- + { + "phone": "+12025550195", + "isNewsletterOptIn": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/:dataEntityName/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/:dataEntityName/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/:dataEntityName/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/:dataEntityName/documents - Schema is valid", function () { + const schema = {"required":["Id","Href","DocumentId"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created, with data entity prefix."},"Href":{"type":"string","description":"Document reference URL."},"DocumentId":{"type":"string","description":"ID of the document that was created."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request allows you to partially update a document corresponding to a given data entity. + + >ℹ️ You can use this request to create documents for any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "Newsletter-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/apiexamples/dataentities/Newsletter/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e", + "DocumentId": "b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Delete document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Delete document.yml new file mode 100644 index 0000000000..28ffef5ee7 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Delete document.yml @@ -0,0 +1,66 @@ +info: + name: Delete document + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/:dataEntityName/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/:dataEntityName/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Get document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Get document.yml new file mode 100644 index 0000000000..a09c894dda --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Get document.yml @@ -0,0 +1,109 @@ +info: + name: Get document + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: _schema + value: schema + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id - Schema is valid", function () { + const schema = {"title":"Using_fields=_all","required":["id","accountId","accountName","dataEntityId"],"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document."},"accountId":{"type":"string","description":"ID of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"dataEntityId":{"type":"string","description":"Data entity name."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a document by ID. + + + >ℹ️ Assign the `_fields` parameter in the query string to retrieve the desired fields. If you want to return all the fields use `_fields=_all`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "b818cbda-e489-11e6-94f4-0ac138d2d42e", + "accountId": "14af940d-9300-4279-9355-61d44c2ff879", + "accountName": "apiexamples", + "dataEntityId": "Newsletter" + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/Update partial document.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/Update partial document.yml new file mode 100644 index 0000000000..eb2429cf85 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/Update partial document.yml @@ -0,0 +1,85 @@ +info: + name: Update partial document + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _schema + value: schema + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + { + "phone": "+12025550195", + "isNewsletterOptIn": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/:dataEntityName/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/:dataEntityName/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request allows you to partially update a document corresponding to a given data entity. For example, you can update some fields of a customer profile or address. + + >ℹ️ You can use this request to update documents for any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Documents/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Documents/folder.yml new file mode 100644 index 0000000000..343c443c99 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Documents/folder.yml @@ -0,0 +1,4 @@ +info: + name: Documents + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Indices/Create index.yml b/BrunoCollections/VTEX - Master Data API - v2/Indices/Create index.yml new file mode 100644 index 0000000000..c0326ecfd8 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Indices/Create index.yml @@ -0,0 +1,62 @@ +info: + name: Create index + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:dataEntityName/indices" + headers: + - name: Content-Type + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + body: + type: json + data: |- + { + "name": "indexName", + "multiple": false, + "fields": "fieldName" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/dataentities/:dataEntityName/indices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates an [index](https://developers.vtex.com/docs/guides/master-data-components#index). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Index | **Edit index** | + | Dynamic Storage | Index | **Create index** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Indices/Delete index by name.yml b/BrunoCollections/VTEX - Master Data API - v2/Indices/Delete index by name.yml new file mode 100644 index 0000000000..c95a0b6ea1 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Indices/Delete index by name.yml @@ -0,0 +1,63 @@ +info: + name: Delete index by name + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/:dataEntityName/indices/:index_name" + headers: + - name: Content-Type + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: index_name + value: "{{index_name}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/:dataEntityName/indices/:index_name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/:dataEntityName/indices/:index_name - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an [index](https://developers.vtex.com/docs/guides/master-data-components#index). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Index | **Remove index** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `index_name` | path | (Required) Name of the index. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Indices/Get index by name.yml b/BrunoCollections/VTEX - Master Data API - v2/Indices/Get index by name.yml new file mode 100644 index 0000000000..a2a9d4e280 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Indices/Get index by name.yml @@ -0,0 +1,94 @@ +info: + name: Get index by name + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/indices/:index_name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: index_name + value: "{{index_name}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/indices/:index_name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices/:index_name - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices/:index_name - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices/:index_name - Schema is valid", function () { + const schema = {"type":"object","description":"Index information.","properties":{"name":{"type":"string","description":"Index name."},"acronym":{"type":"string","description":"Data entity name."},"isGlobal":{"type":"boolean","description":"Defines whether the index is global (`true`) or not (`false`)."},"multiple":{"type":"boolean","description":"Determines whether the values need to be unique. If `false`, values must be unique."},"fields":{"type":"string","description":"Comma-separated fields of the index."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves an [index](https://developers.vtex.com/docs/guides/master-data-components#index). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Index | **View index details** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `index_name` | path | (Required) Name of the index. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "name": "fullName", + "acronym": "Newsletter", + "isGlobal": false, + "multiple": false, + "fields": "firstName,lastName" + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Indices/Get indices.yml b/BrunoCollections/VTEX - Master Data API - v2/Indices/Get indices.yml new file mode 100644 index 0000000000..2ba7b1c72e --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Indices/Get indices.yml @@ -0,0 +1,93 @@ +info: + name: Get indices + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/indices" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/indices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/indices - Schema is valid", function () { + const schema = {"type":"array","description":"Array with information about indices.","items":{"type":"object","description":"Index information.","properties":{"name":{"type":"string","description":"Index name."},"acronym":{"type":"string","description":"Data entity name."},"isGlobal":{"type":"boolean","description":"Defines whether the index is global (`true`) or not (`false`)."},"multiple":{"type":"boolean","description":"Determines whether the values need to be unique. If `false`, values must be unique."},"fields":{"type":"string","description":"Comma-separated fields of the index."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the list of [indices](https://developers.vtex.com/docs/guides/master-data-components#index) by data entity. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Index | **View index details** | + | Dynamic Storage | Index | **List index** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "name": "fullName", + "acronym": "Newsletter", + "isGlobal": false, + "multiple": false, + "fields": "firstName,lastName" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Indices/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Indices/folder.yml new file mode 100644 index 0000000000..21e283ddfb --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Indices/folder.yml @@ -0,0 +1,4 @@ +info: + name: Indices + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Schemas/Delete schema by name.yml b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Delete schema by name.yml new file mode 100644 index 0000000000..6b3d8f06e2 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Delete schema by name.yml @@ -0,0 +1,62 @@ +info: + name: Delete schema by name + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/:dataEntityName/schemas/:schemaName" + headers: + - name: Content-Type + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: schemaName + value: "{{schema}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/:dataEntityName/schemas/:schemaName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/:dataEntityName/schemas/:schemaName - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) for a given data entity. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `schemaName` | path | (Required) Name of the schema. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schema by name.yml b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schema by name.yml new file mode 100644 index 0000000000..4b88c0d6b3 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schema by name.yml @@ -0,0 +1,96 @@ +info: + name: Get schema by name + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/schemas/:schemaName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: schemaName + value: "{{schema}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/schemas/:schemaName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas/:schemaName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas/:schemaName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas/:schemaName - Schema is valid", function () { + const schema = {"title":"SaveschemabynameRequest","required":["properties"],"type":"object","description":"JSON Schema of the data entity. Add `v-indexed` with an array of property names to make those fields filterable and sortable in /search and /scroll.","properties":{"properties":{"type":"object","description":"Object containing schema properties.","properties":{"name":{"type":"object","description":"Property name.","required":["type"],"properties":{"type":{"type":"string","description":"Type of property.","enum":["array","boolean","integer","number","object","string"]}}}}},"v-indexed":{"type":"array","items":{"type":"string"},"description":"Names of properties to index for /search, /scroll, and _sort. Required for reliable filtering (e.g. _where=field=value) and sorting (_sort=field ASC). Indexing is asynchronous after schema save."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns an existing [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) for a given data entity. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `schemaName` | path | (Required) Name of the schema. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "properties": { + "name": { + "type": "string" + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schemas.yml b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schemas.yml new file mode 100644 index 0000000000..0c76a98807 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Get schemas.yml @@ -0,0 +1,97 @@ +info: + name: Get schemas + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/schemas" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/schemas - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/schemas - Schema is valid", function () { + const schema = {"type":"array","description":"Array with existing schemas. In case there is only one existing schema, it will be an object instead, without the `name` property and the named `schema` object, following the same structure as the [Get schema by name](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/schemas/-schemaName-?endpoint=get-/api/dataentities/-dataEntityName-/schemas/-schemaName-) endpoint response.","items":{"title":"GetSchemasResponse","required":["name","schema"],"type":"object","description":"Schema.","properties":{"name":{"type":"string","description":"Schema name."},"schema":{"type":"object","description":"Object with schema properties.","properties":{"properties":{"type":"object","description":"Object containing schema properties.","properties":{"name":{"type":"object","description":"Property name.","required":["type"],"properties":{"type":{"type":"string","description":"Type of property.","enum":["array","boolean","integer","number","object","string"]}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all existing [schemas](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) for a given data entity. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "name": "testschema", + "schema": { + "properties": { + "name": { + "type": "string" + } + } + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Schemas/Save schema by name.yml b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Save schema by name.yml new file mode 100644 index 0000000000..63fd44c9ea --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Schemas/Save schema by name.yml @@ -0,0 +1,125 @@ +info: + name: Save schema by name + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:dataEntityName/schemas/:schemaName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: schemaName + value: "{{schema}}" + type: path + body: + type: json + data: |- + { + "properties": { + "name": { + "type": "string" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/dataentities/:dataEntityName/schemas/:schemaName - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:dataEntityName/schemas/:schemaName - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/dataentities/:dataEntityName/schemas/:schemaName - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/dataentities/:dataEntityName/schemas/:schemaName - Schema is valid", function () { + const schema = {"type":"object","description":"Response body object.","properties":{"Message":{"type":"string","description":"Success message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or edits a data entity schema. Learn more about [Master Data schemas](https://developers.vtex.com/vtex-rest-api/docs/master-data-schema-lifecycle). + + > Note that if you send a `schemaName` that does not exist for that data entity, this request will create it. + + This request can also be used to [create or edit Master Data v2 triggers](https://developers.vtex.com/vtex-rest-api/docs/setting-up-triggers-in-master-data-v2). + + > Each Master Data v2 data entity can have up to 60 schemas. + + ## Indexing fields for search, scroll and sort + + To filter or sort by a field in [Search documents](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/search) or [Scroll documents](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/scroll), add that field to the `v-indexed` array in the schema. This is the schema-level index (separate from the [indices](https://developers.vtex.com/docs/api-reference/master-data-api-v2#get-/api/dataentities/-dataEntityName-/indices) endpoint). + + - `v-indexed`: Array of property names that Master Data v2 must index for `/search`, `/scroll`, and `_sort`. Use it whenever you want to use `_where`, `_sort`, or range filters (e.g. `_where=postalCode between 10000 AND 20000`) on that field. Indexing runs asynchronously after the schema is saved. + - `filterable` and `searchable`: Apply to the UI (e.g. Master Data v1/CRM-style behavior). They do **not** create the index used by `/search`; only `v-indexed` does. + + **Example request body with `v-indexed`:** + + ```json + { + "properties": { + "skuId": { "type": "string" }, + "postalCode": { "type": "string" } + }, + "v-indexed": ["postalCode"] + } + ``` + + > ℹ️ Use `v-indexed` when you need fields to be filterable/sortable in `/search`. Use the [/indices](https://developers.vtex.com/docs/api-reference/master-data-api-v2#put-/api/dataentities/-dataEntityName-/indices) endpoint when you need entity-level uniqueness, composite keys, or relationships between entities. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `schemaName` | path | (Required) Name of the schema. | + + ## Example response (`200`) + + ```json + { + "Message": "JSON Schema persisted successfully. Revalidation and indexing process running in background." + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Schemas/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Schemas/folder.yml new file mode 100644 index 0000000000..e4e79f5039 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Schemas/folder.yml @@ -0,0 +1,4 @@ +info: + name: Schemas + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Scroll/Scroll documents.yml b/BrunoCollections/VTEX - Master Data API - v2/Scroll/Scroll documents.yml new file mode 100644 index 0000000000..bf3349d475 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Scroll/Scroll documents.yml @@ -0,0 +1,160 @@ +info: + name: Scroll documents + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/scroll" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _token + value: "123456" + type: query + disabled: true + - name: _size + value: "100" + type: query + disabled: true + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _schema + value: schema + type: query + disabled: true + - name: _sort + value: firstName ASC + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/scroll - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/scroll - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/scroll - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/scroll - Schema is valid", function () { + const schema = {"type":"array","description":"List of documents that correspond to the result of the scroll.","items":{"title":"Using_fields=_all","required":["id","accountId","accountName","dataEntityId"],"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document."},"accountId":{"type":"string","description":"ID of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"dataEntityId":{"type":"string","description":"Data entity name."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of documents according to query parameter filters. If you need to query the entire database, or your collection is over 10000 documents, use this endpoint. + + In the first request, the `X-VTEX-MD-TOKEN` token will be obtained in the response header. This token must be passed to the next request in the `_token` query string parameter. The token expires after 20 minutes of inactivity, and each request made with the token during this time resets the expiration timer. + + After the token is obtained, it is no longer necessary to send the filter or document size per page parameters. You only need to resend the token until the document collection is empty. + + First request: + ``` + /dataentities/Newsletter/scroll?isCluster=true&_size=250&_fields=email,firstName + ``` + + Retrieve the token in the header `X-VTEX-MD-TOKEN` from the first request's response and use it to make the following requests. + + Subsequent requests: + ``` + /dataentities/Newsletter/scroll?_token={tokenValue} + ``` + + + Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api). + + >⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or using the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `429`. + + ## Query examples + + | **Query Type** | **Example** | + |-|-| + | **Simple filter** | `/dataentities/Newsletter/scroll?email=my@email.com` | + | **Complex filter** | `/dataentities/Newsletter/scroll?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)` | + | **Date range** | `/dataentities/Newsletter/scroll?_where=createdIn between 2001-01-01 AND 2016-01-01` | + | **Range numeric fields** | `/dataentities/Newsletter/scroll?_where=age between 18 AND 25` | + | **Partial filter** | `/dataentities/Newsletter/scroll?firstName=*Maria*` | + | **Filter for null values** | `/dataentities/Newsletter/scroll?_where=firstName is null` | + | **Filter for non-null values** | `/dataentities/Newsletter/scroll?_where=firstName is not null` | + | **Filter for difference** | `/dataentities/Newsletter/scroll?_where=firstName<>maria` | + | **Filter greater than** | `/dataentities/Newsletter/scroll?_where=number>5` | + | **Filter less than** | `/dataentities/Newsletter/scroll?_where=date<2001-01-01` | + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `_token` | query | Value of the `X-VTEX-MD-TOKEN` token obtained in the response header of the first request, necessary on subsequent requests to continue scrolling through documents. The token expires after 20 minutes of inactivity, and each request made with the token during this time resets the expiration timer. | + | `_size` | query | Inform the number of documents per request. Maximum value of `1000`. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `_sort` | query | Defines sorting mode in two parts. The first part is the name of the field you want to sort by. It can be a nested field up to the first level (e.g. `wishlistProduct.productName`). In the second part, use `ASC` for ascending order or `DESC` for descending order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "b818cbda-e489-11e6-94f4-0ac138d2d42e", + "accountId": "14af940d-9300-4279-9355-61d44c2ff879", + "accountName": "apiexamples", + "dataEntityId": "Newsletter" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Scroll/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Scroll/folder.yml new file mode 100644 index 0000000000..e960a37e2a --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Scroll/folder.yml @@ -0,0 +1,4 @@ +info: + name: Scroll + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Search/Search documents.yml b/BrunoCollections/VTEX - Master Data API - v2/Search/Search documents.yml new file mode 100644 index 0000000000..def4fedc77 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Search/Search documents.yml @@ -0,0 +1,141 @@ +info: + name: Search documents + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: REST-Range + value: resources=0-10 + params: + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _schema + value: schema + type: query + disabled: true + - name: _sort + value: firstName ASC + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/search - Schema is valid", function () { + const schema = {"type":"array","description":"List of documents that correspond to the result of the search.","items":{"title":"Using_fields=_all","required":["id","accountId","accountName","dataEntityId"],"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document."},"accountId":{"type":"string","description":"ID of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"dataEntityId":{"type":"string","description":"Data entity name."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Master Data v2 documents' information, while choosing which fields will be returned and filtering documents by specific fields. + + > The response header `REST-Content-Range` indicates the total amount of results for that specific search. For example, it may return `resources 0-100/136108`, which indicates it has returned the first 100 results out of a total of 136108. + + Below you can see some query examples and learn more about each query parameter. + + + Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api). + + >⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`. + + ## Query examples + + | **Query Type** | **Example** | + |-|-| + | **Simple filter** | `/dataentities/Newsletter/search?email=my@email.com` | + | **Complex filter** | `/dataentities/Newsletter/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)` | + | **Date range** | `/dataentities/Newsletter/search?_where=createdIn between 2001-01-01 AND 2016-01-01` | + | **Range numeric fields** | `/dataentities/Newsletter/search?_where=age between 18 AND 25` | + | **Partial filter** | `/dataentities/Newsletter/search?firstName=*Maria*` | + | **Filter for null values** | `/dataentities/Newsletter/search?_where=firstName is null` | + | **Filter for non-null values** | `/dataentities/Newsletter/search?_where=firstName is not null` | + | **Filter for difference** | `/dataentities/Newsletter/search?_where=firstName<>maria` | + | **Filter greater than** | `/dataentities/Newsletter/search?_where=number>5` | + | **Filter less than** | `/dataentities/Newsletter/search?_where=date<2001-01-01` | + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `_fields` | query | Fields that should be returned by document. Separate fields' names with commas. For example `_fields=email,firstName,document`. You can also use `_fields=_all` to fetch all fields. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `_sort` | query | Defines sorting mode in two parts. The first part is the name of the field you want to sort by. It can be a nested field up to the first level (e.g. `wishlistProduct.productName`). In the second part, use `ASC` for ascending order or `DESC` for descending order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | (Required) Specifies the range of documents to be returned in the response. The value should follow the format `resources={x}-{y}`, where: * `x`: Index of the first document in the returned array. * `y`: Index of the last document in the returned array + 1. This field controls pagination by defining the subset of documents to be retrieved. The maximum number of documents returned per query is limited to 100. For example, `resources=0-10` returns the first 10 documents. | + + ## Example response (`200`) + + ```json + [ + { + "id": "b818cbda-e489-11e6-94f4-0ac138d2d42e", + "accountId": "14af940d-9300-4279-9355-61d44c2ff879", + "accountName": "apiexamples", + "dataEntityId": "Newsletter" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Search/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Search/folder.yml new file mode 100644 index 0000000000..d80211c505 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Search/folder.yml @@ -0,0 +1,4 @@ +info: + name: Search + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Master Data API - v2/Versions/Get version.yml b/BrunoCollections/VTEX - Master Data API - v2/Versions/Get version.yml new file mode 100644 index 0000000000..6df3151a3a --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Versions/Get version.yml @@ -0,0 +1,112 @@ +info: + name: Get version + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id/versions/:versionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: versionId + value: _8sZcvyj4nng7FgA2RgtVVZmkIxb4Pbfe_ + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Schema is valid", function () { + const schema = {"title":"Getversion","required":["id","author","document"],"type":"object","description":"Request body object.","properties":{"id":{"type":"string","description":"Version ID."},"author":{"type":"string","description":"ID of the user who created the version."},"document":{"title":"Document","required":["id","dataEntityId","accountId","accountName","followers"],"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document."},"dataEntityId":{"type":"string","description":"Data entity name."},"accountId":{"type":"string","description":"ID of the VTEX account."},"accountName":{"type":"string","description":"Name of the VTEX account."},"followers":{"type":"array","description":"Followers.","items":{"type":"string","description":"Follower."}},"schemas":{"type":"array","description":"Schemas which the document is compliant with.","items":{"type":"string","description":"Schema name."}},"email":{"type":"string","description":"User email."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the version of a document. + + >ℹ Master Data documents are versioned. This means that, for each change, a new version is generated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `versionId` | path | (Required) ID of the version to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "cSIAceEelBEmSOqRkzJYLRQuGgi6.CqF", + "author": "1f936e42-79b3-4e5b-91d2-da9a8af0b215", + "document": { + "id": "cbfc4f67-6ea3-11ee-83ab-0a8d18f9f827", + "dataEntityId": "Newsletter", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "followers": [], + "schemas": [ + "testprofile", + "testprofile2" + ], + "email": "clark.kent@examplemail.com" + } + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Versions/List versions.yml b/BrunoCollections/VTEX - Master Data API - v2/Versions/List versions.yml new file mode 100644 index 0000000000..8c4aa1f039 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Versions/List versions.yml @@ -0,0 +1,124 @@ +info: + name: List versions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id/versions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: load + value: "true" + type: query + disabled: true + - name: fields + value: id,dataEntityId,isNewsletterOptIn,createdBy + type: query + disabled: true + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:dataEntityName/documents/:id/versions - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Listversion","required":["id","date"],"type":"object","description":"Version information.","properties":{"id":{"type":"string","description":"Version ID."},"date":{"type":"string","description":"Date when the version was created in ISO 8601 format."},"document":{"type":"object","description":"Information about the document.","properties":{"id":{"type":"string","description":"Document ID."},"dataEntityId":{"type":"string","description":"Data entity name."},"isNewsletterOptIn":{"type":["boolean","null"],"description":"Indicates whether client otped to receive the store newsletter (`true`) or not (`false`)."},"createdBy":{"type":"string","description":"ID of the user who created the document."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the versions of a document. + + >ℹ Master Data documents are versioned. This means that, for each change, a new version is generated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `load` | query | If true, return all the fields in each version of the document. | + | `fields` | query | If `load` is true, the response will return only these specific fields. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "_EAR0cJ7XB5k5grnmm0zeKGlVvVM9WCPy_", + "date": "2016-10-18T16:53:32+00:00", + "document": { + "id": "72e7f8dd-1168-23ec-82ac-0e2b61663eb4", + "dataEntityId": "Newsletter", + "isNewsletterOptIn": true, + "createdBy": "81fc8b10-25b7-48de-b425-7b93554002cc" + } + }, + { + "id": "_E5SH9WXVvhPBNnbQtYAAGqrIysIeNYhV_", + "date": "2016-09-08T20:11:42+00:00", + "document": { + "id": "72e7f8dd-1168-23ec-82ac-0e2b61663eb4", + "dataEntityId": "Newsletter", + "isNewsletterOptIn": true, + "createdBy": "81fc8b10-25b7-48de-b425-7b93554002cc" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Versions/Update version.yml b/BrunoCollections/VTEX - Master Data API - v2/Versions/Update version.yml new file mode 100644 index 0000000000..d83d3af6a8 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Versions/Update version.yml @@ -0,0 +1,99 @@ +info: + name: Update version + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:dataEntityName/documents/:id/versions/:versionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: dataEntityName + value: Newsletter + type: path + - name: id + value: b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: versionId + value: _8sZcvyj4nng7FgA2RgtVVZmkIxb4Pbfe_ + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/dataentities/:dataEntityName/documents/:id/versions/:versionId - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the document's version value. + + >ℹ Master Data documents are versioned. This means that, for each change, a new version is generated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dataEntityName` | path | (Required) Name of the data entity. | + | `id` | path | (Required) ID of the Document. | + | `versionId` | path | (Required) ID of the version to update | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "Newsletter-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/apiexamples/dataentities/Newsletter/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - Master Data API - v2/Versions/folder.yml b/BrunoCollections/VTEX - Master Data API - v2/Versions/folder.yml new file mode 100644 index 0000000000..13a3519e1d --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/Versions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Versions + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Master Data API - v2/environments/VTEX.yml b/BrunoCollections/VTEX - Master Data API - v2/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Master Data API - v2/opencollection.yml b/BrunoCollections/VTEX - Master Data API - v2/opencollection.yml new file mode 100644 index 0000000000..5ba0c7f291 --- /dev/null +++ b/BrunoCollections/VTEX - Master Data API - v2/opencollection.yml @@ -0,0 +1,59 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Master Data API - v2 + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ Master Data v2 is not compatible with data entities from previous versions, such as CL and AD. + + [Master Data](https://developers.vtex.com/docs/guides/master-data-introduction) is a secure, fast, scalable, and extensible solution that allows users to create their own entities, store data, and retrieve information directly from the storefront or external integrations. + + Several internal VTEX modules use Master Data as a data repository, including Orders and Sales App. + + There are two main ways to use Master Data: + + - [Directly from the storefront](#directly-from-the-storefront) + - [With an external integration](#external-integrations) + + ## Directly from the storefront + + When using Master Data within the storefront, consider the following: + + - Use the storefront host to query or store information to avoid issues related to Cross-origin resource sharing (CORS). + - Use the relative path to avoid CORS issues. + - Configure the JSON Schema of the Data Entity to specify which information should be public and which should not be. + - Avoid creating query loops to prevent potential throttling issues or APIs being disabled due to security protection measures. + - Never add authentication keys, such as `X-VTEX-API-AppKey` or `X-VTEX-API-AppToken`, via JavaScript as this could pose security risks. + + ## External integrations + + When using Master Data to store data from an external integration, such as client data from another service, consider the following: + + - Use the host `{{accountName}}.vtexcommercestable.com.br`. + - Use the authentication keys (`X-VTEX-API-AppKey` ou `X-VTEX-API-AppToken`). + + ## Common parameters + + | Name | Description | + | -------- | -------- | + | `accountName` | Account name in VTEX License Manager. | + | `name` | Data Entity name. | + | `schema` | JSON Schema of a Data Entity. | + | `id` | Identifier of a document. | + | `X-VTEX-API-AppKey` | appKey. | + | `X-VTEX-API-AppToken` | appToken. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Create new customer address.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Create new customer address.yml new file mode 100644 index 0000000000..caf262770c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Create new customer address.yml @@ -0,0 +1,110 @@ +info: + name: Create new customer address + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/AD/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: schema + type: query + disabled: true + body: + type: json + data: |- + { + "addressName": "My house", + "addressLabel": "NC Office", + "addressType": "commercial", + "receiverName": "Clark Kent", + "city": "Raleigh", + "state": "NC", + "country": "USA", + "postalCode": "12345", + "street": "Main Street", + "number": "300", + "neighborhood": "Downtown", + "complement": "3rd floor", + "reference": "Next to the park", + "geoCoordinate": "40.7128,-74.0060", + "userId": "7e03m794-a33a-11e9-84rt6-0adfa64s5a8e" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/AD/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/AD/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/AD/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/AD/documents - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates new customer address. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "AD-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/AD/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Delete address by ID.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Delete address by ID.yml new file mode 100644 index 0000000000..b233f90046 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Delete address by ID.yml @@ -0,0 +1,62 @@ +info: + name: Delete address by ID + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/AD/documents/:addressId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to delete a specific address document from the `AD` data entity. Deletes a customer address. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to be deleted. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Get address by ID.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Get address by ID.yml new file mode 100644 index 0000000000..484397f62c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Get address by ID.yml @@ -0,0 +1,120 @@ +info: + name: Get address by ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId?_fields=_all" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: _all + type: query + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/AD/documents/:addressId - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for an address document.","properties":{"addressLabel":{"type":["string","null"],"description":"A user-defined label to identify the address."},"addressType":{"type":["string","null"],"description":"The type of address: `commercial` for shipping, `invoice` for billing.","enum":["commercial","invoice"]},"city":{"type":["string","null"],"description":"The city of the address."},"complement":{"type":["string","null"],"description":"Any additional information for the address (e.g., apartment, floor)."},"country":{"type":["string","null"],"description":"The country of the address in three-letter code format (e.g., `\"USA\"`)."},"countryfake":{"type":["string","null"],"description":"Placeholder or optional country value."},"geoCoordinate":{"type":["string","null"],"description":"Geographical coordinates of the address (latitude and longitude)."},"neighborhood":{"type":["string","null"],"description":"The neighborhood of the address."},"number":{"type":["string","null"],"description":"The street number of the address."},"postalCode":{"type":["string","null"],"description":"The postal code of the address. The format must be compatible with the address country postal code format. (e.g., `00000` for addresses in the USA)."},"receiverName":{"type":["string","null"],"description":"The name of the person or entity receiving at this address."},"reference":{"type":["string","null"],"description":"Optional reference point or landmark near the address."},"state":{"type":["string","null"],"description":"The state or province of the address."},"street":{"type":["string","null"],"description":"The street name of the address."},"userId":{"type":["string","null"],"description":"The ID of the user or related entity."},"id":{"type":["string","null"],"description":"Unique identifier for this address record."},"accountId":{"type":["string","null"],"description":"ID of the account related to this address."},"accountName":{"type":["string","null"],"description":"Name of the account related to this address."},"dataEntityId":{"type":["string","null"],"description":"ID of the data entity this address belongs to (always `\"AD\"`)."},"createdBy":{"type":["string","null"],"description":"ID of the user who created the address record."},"createdIn":{"type":["string","null"],"description":"Timestamp of when the address record was created."},"updatedBy":{"type":["string","null"],"description":"ID of the user who last updated the address record."},"updatedIn":{"type":["string","null"],"description":"Timestamp of the last update to the address record."},"lastInteractionBy":{"type":["string","null"],"description":"ID of the user who had the last interaction with the record."},"lastInteractionIn":{"type":["string","null"],"description":"Timestamp of the last interaction with the record."},"followers":{"type":["array","null"],"description":"List of users following this address record.","items":{"type":"string","description":"User ID."}},"tags":{"type":["array","null"],"description":"List of tags associated with this address.","items":{"type":"string","description":"Tag value."}},"auto_filter":{"type":["string","null"],"description":"Optional field used for automatic filtering or categorization."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves information of a specific address by its unique identifier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to retrieve. | + | `_fields` | query | (Required) Specifies that all fields of the document should be included in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "addressLabel": "NC Office", + "addressType": "commercial", + "city": "Raleigh", + "complement": "", + "country": "USA", + "countryfake": null, + "geoCoordinate": "", + "neighborhood": "", + "number": "11", + "postalCode": "48226", + "receiverName": "Backpack-Klub-LLC", + "reference": null, + "state": "NC", + "street": "Toringon Street", + "userId": "2da4e9ab-050b-11f0-b37f-f4b136dbcce1", + "id": "4286e252-050b-11f0-b37f-d6617047d485", + "accountId": "5f1fe23b-9fd1-417d-a4aa-14df38e7746e", + "accountName": "qastore", + "dataEntityId": "AD", + "createdBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "createdIn": "2025-03-19T21:44:01.4199691Z", + "updatedBy": null, + "updatedIn": null, + "lastInteractionBy": "c83ea7ed-f875-4a10-b0a0-98d96aedab06", + "lastInteractionIn": "2025-03-19T21:44:01.4199691Z", + "followers": [], + "tags": [], + "auto_filter": null + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Update address by ID.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Update address by ID.yml new file mode 100644 index 0000000000..2131898800 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/Update address by ID.yml @@ -0,0 +1,116 @@ +info: + name: Update address by ID + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/AD/documents/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: addressId + value: 4286e252-050b-11f0-b37f-d6617047d485 + type: path + body: + type: json + data: |- + { + "addressName": "NC Office", + "addressLabel": "NC Office", + "postalCode": "48226", + "street": "Toringon Street", + "number": "11", + "neighborhood": "", + "complement": "", + "city": "Raleigh", + "state": "NC", + "country": "USA", + "receiverName": "Backpack-Klub-LLC", + "geoCoordinate": "", + "addressType": "commercial", + "reference": "Grey building", + "userId": "2da4e9ab-050b-11f0-b37f-d6617047d485" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/AD/documents/:addressId - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to update an existing address document in the `AD` data entity. Partially updates a customer address. + + > ⚠️ When updating addresses you must send each field according to the specifications provided. Otherwise, the Checkout module will not be able to autofill data during the shopping flow, which can block the purchase. Learn more about [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-preenchimento-automatico-de-dados-do-cliente--2Nuu3xAFzdhIzJIldAdtan#). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `addressId` | path | (Required) ID of the address to update. | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "AD-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/AD/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/folder.yml new file mode 100644 index 0000000000..8e1ea0db1e --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Addresses/folder.yml @@ -0,0 +1,4 @@ +info: + name: Addresses + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Retrieve attachment.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Retrieve attachment.yml new file mode 100644 index 0000000000..6997e7076e --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Retrieve attachment.yml @@ -0,0 +1,83 @@ +info: + name: Retrieve attachment + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/:field/attachments/:file-name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: field + value: image + type: path + - name: file-name + value: image.png + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/dataentities/:acronym/documents/:id/:field/attachments/:file-name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/:field/attachments/:file-name - Content-Type is image/jpg", function () { + expect(String(res.getHeader("content-type"))).to.include("image/jpg"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a file that had been previously saved in a field of type `File`. + + >⚠️ Make sure to include the file extension in the name, like in this example: `/api/dataentities/CL/documents/123/file/attachments/image.png`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `field` | path | (Required) Name of the field where the file is saved, as it appears on VTEX Admin. | + | `file-name` | path | (Required) File name and extension. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```text + binary image data + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Save attachment.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Save attachment.yml new file mode 100644 index 0000000000..5e038c7c72 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/Save attachment.yml @@ -0,0 +1,80 @@ +info: + name: Save attachment + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/:field/attachments" + headers: + - name: Content-Type + value: image/jpg + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: field + value: profilePicture + type: path + body: + type: multipart-form + data: + - name: file + type: text + value: ullamco laborum adipisicing,laborum enim + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/dataentities/:acronym/documents/:id/:field/attachments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/:acronym/documents/:id/:field/attachments - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Saves a file in a field of type `File`. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types).` + + + > You can upload more than one file. Just add a new field in the `form-data` with type `File`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `field` | path | (Required) Name of the field to attach the file to, as it appears in VTEX Admin. | + | `Content-Type` | header | (Required) Type of the content being sent. If you are uploading an image, use `image/jpg` or `image/png`. When using JavaScript, use `multipart/form-data`. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/folder.yml new file mode 100644 index 0000000000..d95d7ce61b --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Attachments/folder.yml @@ -0,0 +1,4 @@ +info: + name: Attachments + type: folder + seq: 8 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/Validate document by clusters.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/Validate document by clusters.yml new file mode 100644 index 0000000000..1b20b57614 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/Validate document by clusters.yml @@ -0,0 +1,86 @@ +info: + name: Validate document by clusters + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/clusters" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + [ + { + "name": "male", + "rule": "gender=male" + }, + { + "name": "complex", + "rule": "((gender=male AND percent=0.35) AND any is null) AND (name=*go*)" + }, + { + "name": "complex2", + "rule": "((gender=male AND percent=0.35) AND any is not null) OR (name=*go*)" + }, + { + "name": "createdIn", + "rule": "createdIn between 2015-10-28 AND 2015-10-30" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/dataentities/:acronym/documents/:id/clusters - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Validate documents by clusters. + + + > Learn more about Master Data [clusters](https://help.vtex.com/en/tutorial/how-can-i-create-cluster-of-customers--frequentlyAskedQuestions_1724). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/folder.yml new file mode 100644 index 0000000000..ac4ced7d07 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Clusters/folder.yml @@ -0,0 +1,4 @@ +info: + name: Clusters + type: folder + seq: 9 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Create new customer profile.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Create new customer profile.yml new file mode 100644 index 0000000000..cee9df40ae --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Create new customer profile.yml @@ -0,0 +1,104 @@ +info: + name: Create new customer profile + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/CL/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: schema + type: query + disabled: true + body: + type: json + data: |- + { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent", + "phone": "+12025550195", + "documentType": "CPF", + "document": "12345678900", + "isCorporate": false, + "isNewsletterOptIn": false, + "localeDefault": "en-US" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/CL/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/CL/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/CL/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/CL/documents - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates new customer profile. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "CL-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/CL/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Delete customer profile.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Delete customer profile.yml new file mode 100644 index 0000000000..4863c2e61e --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Delete customer profile.yml @@ -0,0 +1,62 @@ +info: + name: Delete customer profile + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/CL/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/CL/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/CL/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a customer profile. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Update customer profile.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Update customer profile.yml new file mode 100644 index 0000000000..6a2106b181 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/Update customer profile.yml @@ -0,0 +1,102 @@ +info: + name: Update customer profile + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/CL/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _schema + value: schema + type: query + disabled: true + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + { + "email": "clark.kent@examplemail.com", + "firstName": "Clark", + "lastName": "Kent" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/CL/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/CL/documents/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/CL/documents/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/CL/documents/:id - Schema is valid", function () { + const schema = {"required":["Id","Href"],"type":"object","description":"Response body object.","properties":{"Id":{"type":"string","description":"ID of the document that was created or updated."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates a customer profile. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the document. | + | `_schema` | query | Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "CL-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://api.vtex.com/my-store-name/dataentities/CL/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/folder.yml new file mode 100644 index 0000000000..0b42aaf4ea --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Customer profiles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Customer profiles + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/Get data entity structure.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/Get data entity structure.yml new file mode 100644 index 0000000000..350e553403 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/Get data entity structure.yml @@ -0,0 +1,83 @@ +info: + name: Get data entity structure + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym - Schema is valid", function () { + const schema = {"title":"Data entity structure","required":["acronym","name","primaryKeyType","allowGetAll","fields"],"type":"object","description":"Data entity structure.","properties":{"acronym":{"title":"acronym","type":"string","description":"Two-letter string that identifies the data entity."},"name":{"title":"name","type":"string","description":"Data entity name."},"primaryKeyType":{"title":"primaryKeyType","type":"string","description":"Primary key type."},"allowGetAll":{"title":"allowGetAll","type":"boolean","description":"Defines if it will be allowed to retrieve all fields from documents from this data entity at once using the [Get document](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-) endpoint (`true`) or not (`false`)."},"fields":{"title":"fields","type":"array","description":"List of fields that documents from the given data entity have.","items":{"title":"Field","description":"Field information.","required":["name","type","displayName","isNullable","isSearchable","isFilter","isInternal"],"type":"object","properties":{"name":{"type":"string","description":"Field name."},"type":{"type":"string","description":"Field type."},"displayName":{"type":"string","description":"Field display name."},"isNullable":{"type":"boolean","description":"Defines whether the field is nullable (`true`) or not (`false`)."},"isSearchable":{"type":"boolean","description":"Defines whether the field is searchable (`true`) or not (`false`)."},"isFilter":{"type":"boolean","description":"Defines whether the field is a filter (`true`) or not (`false`)."},"isInternal":{"type":"boolean","description":"Defines whether the field is for internal use only (`true`) or not (`false`)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the data entity structure with its respective fields and data type. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Dynamic Storage | Data entity | **View data entity details** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Data entity acronym. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/List data entities.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/List data entities.yml new file mode 100644 index 0000000000..de7fa56b90 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/List data entities.yml @@ -0,0 +1,99 @@ +info: + name: List data entities + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Listdataentity","required":["acronym","name","primaryKeyType","allowGetAll"],"type":"object","description":"Data entity information.","properties":{"acronym":{"title":"acronym","type":"string","description":"Two-letter string that identifies the data entity."},"name":{"title":"name","type":"string","description":"Data entity name."},"primaryKeyType":{"title":"primaryKeyType","type":"string","description":"Primary key type."},"allowGetAll":{"title":"allowGetAll","type":"boolean","description":"Defines if it will be allowed to retrieve all fields from documents from this data entity at once using the [Get document](https://developers.vtex.com/docs/api-reference/masterdata-api#get-/api/dataentities/-acronym-/documents/-id-) endpoint (`true`) or not (`false`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of existing data entities in the store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + | Dynamic Storage | Data entity | **List data entity** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "acronym": "SP", + "name": "Sample", + "primaryKeyType": "GUID", + "allowGetAll": false + }, + { + "acronym": "AD", + "name": "Endereço", + "primaryKeyType": "GUID", + "allowGetAll": false + }, + { + "acronym": "CL", + "name": "Cliente", + "primaryKeyType": "GUID", + "allowGetAll": false + } + ] + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/folder.yml new file mode 100644 index 0000000000..3c5058bd89 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Data entities/folder.yml @@ -0,0 +1,4 @@ +info: + name: Data entities + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create document with custom ID or update entire document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create document with custom ID or update entire document.yml new file mode 100644 index 0000000000..f9efbd1a4d --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create document with custom ID or update entire document.yml @@ -0,0 +1,116 @@ +info: + name: Create document with custom ID or update entire document + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + { + "Boolean": true, + "Currency": 2.5, + "Date": "1992-11-17", + "Date_Time": "2016-09-14T19:21:01.3163733Z", + "Decimal": 2.5, + "Email": "meu@email.com", + "Integer": 1000000, + "Long": 1000000000, + "Percent": 85.42, + "Time": "23:50", + "URL": "http://www.vtex.com", + "Varchar10": "Lorem ipsu", + "Varchar50": "Lorem ipsum dolor sit amet, consectetur adipiscing", + "Varchar750": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Varchar100": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Relationship": "5eb31afb-7ab0-11e6-94b4-0a44686e393f", + "Text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/dataentities/:acronym/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID. + + >ℹ️ You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Custom field types + + The table below presents the types of custom fields you can use when creating or updating documents in Master Data v1 and example values. + + | Field Type| Example value | + | - | - | + | Boolean | `true` | + | Currency | `2.5` | + | Date | `1992-11-17` | + | Date_Time | `2016-09-14T19:21:01.3163733Z` | + | Decimal | `2.5` | + | Email | `meu@email.com` | + | Integer | `1000000` | + | Long | `1000000000` | + | Percent | `85.42` | + | Time | `23:50` | + | URL | `https://www.vtex.com` | + | Varchar10 | `Lorem ipsu` | + | Varchar50 | `Lorem ipsum dolor sit amet, consectetur adipiscing` | + | Varchar750 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + | Varchar100 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + | Relationship | `5eb31afb-7ab0-11e6-94b4-0a44686e393f` | + | Text | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create new document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create new document.yml new file mode 100644 index 0000000000..868c2c9063 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create new document.yml @@ -0,0 +1,141 @@ +info: + name: Create new document + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/:acronym/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + body: + type: json + data: |- + { + "Boolean": true, + "Currency": 2.5, + "Date": "1992-11-17", + "Date_Time": "2016-09-14T19:21:01.3163733Z", + "Decimal": 2.5, + "Email": "meu@email.com", + "Integer": 1000000, + "Long": 1000000000, + "Percent": 85.42, + "Time": "23:50", + "URL": "http://www.vtex.com", + "Varchar10": "Lorem ipsu", + "Varchar50": "Lorem ipsum dolor sit amet, consectetur adipiscing", + "Varchar750": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Varchar100": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Relationship": "5eb31afb-7ab0-11e6-94b4-0a44686e393f", + "Text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/:acronym/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/:acronym/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/:acronym/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/:acronym/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document that was created, with data entity prefix."},"href":{"type":"string","description":"Document reference URL."},"documentId":{"type":"string","description":"Unique identifier of the document."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new document with an ID automatically generated by VTEX, corresponding to a given data entity. The request body is a JSON object where the key is the name of the field. + + >⚠️ Do not use Master Data as a log, cache, or temporary data store. Writing high volumes of disposable data can trigger API throttling and degrade store performance. + + >ℹ️ You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Custom field types + + The table below presents the types of custom fields you can use when creating or updating documents in Master Data v1 and example values. + + | Field Type| Example value | + | - | - | + | Boolean | `true` | + | Currency | `2.5` | + | Date | `1992-11-17` | + | Date_Time | `2016-09-14T19:21:01.3163733Z` | + | Decimal | `2.5` | + | Email | `meu@email.com` | + | Integer | `1000000` | + | Long | `1000000000` | + | Percent | `85.42` | + | Time | `23:50` | + | URL | `https://www.vtex.com` | + | Varchar10 | `Lorem ipsu` | + | Varchar50 | `Lorem ipsum dolor sit amet, consectetur adipiscing` | + | Varchar750 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + | Varchar100 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + | Relationship | `5eb31afb-7ab0-11e6-94b4-0a44686e393f` | + | Text | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "CL-be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "documentId": "be30ed0b-78ec-11ee-83ab-0eca8d1868e1" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create partial document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create partial document.yml new file mode 100644 index 0000000000..f0a8e1d77c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Create partial document.yml @@ -0,0 +1,99 @@ +info: + name: Create partial document + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/:acronym/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + body: + type: json + data: |- + { + "id": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e", + "addressName": "4726026151251" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/dataentities/:acronym/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/:acronym/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/dataentities/:acronym/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/dataentities/:acronym/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Document information.","properties":{"id":{"type":"string","description":"ID of the document that was created, with data entity prefix."},"href":{"type":"string","description":"Document reference URL."},"documentId":{"type":"string","description":"Unique identifier of the document."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a partial document, sending only some of the fields. + + > You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "CL-be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "documentId": "be30ed0b-78ec-11ee-83ab-0eca8d1868e1" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Delete document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Delete document.yml new file mode 100644 index 0000000000..8ba185c05c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Delete document.yml @@ -0,0 +1,66 @@ +info: + name: Delete document + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/:acronym/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/:acronym/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Get document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Get document.yml new file mode 100644 index 0000000000..5324caac4c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Get document.yml @@ -0,0 +1,101 @@ +info: + name: Get document + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id - Schema is valid", function () { + const schema = {"title":"Document","required":["id","dataEntityId","accountId","accountName"],"type":"object","description":"Object representing each document.","properties":{"{customProperty}":{"type":"string","description":"Custom property."},"id":{"type":"string","description":"Unique identifier of the document."},"accountId":{"type":"string","description":"Unique identifier of the account."},"accountName":{"type":"string","description":"Account name."},"dataEntityId":{"type":"string","description":"Two-letter string that identifies the data entity."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `_fields` | query | Names of the fields that will be returned per document, separated by a comma `,`. It is possible to fetch all fields using `_all` as the value of this query parameter. However, in order to avoid permission errors, we strongly recommend informing only the names of the exact fields that will be used. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Update partial document.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Update partial document.yml new file mode 100644 index 0000000000..d1907e0a7f --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/Update partial document.yml @@ -0,0 +1,75 @@ +info: + name: Update partial document + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + { + "addressName": "4726026151253" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/dataentities/:acronym/documents/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/dataentities/:acronym/documents/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a subset of fields of a document, without impacting the other fields. + + >ℹ️ You can use this request to update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Documents/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/folder.yml new file mode 100644 index 0000000000..e8490b496b --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Documents/folder.yml @@ -0,0 +1,4 @@ +info: + name: Documents + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Score/Delete score by field.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Delete score by field.yml new file mode 100644 index 0000000000..c66cee62e4 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Delete score by field.yml @@ -0,0 +1,76 @@ +info: + name: Delete score by field + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/score/:field-name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: field-name + value: carttag + type: path + body: + type: json + data: |- + { + "key": "first key" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/dataentities/:acronym/documents/:id/score/:field-name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/dataentities/:acronym/documents/:id/score/:field-name - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a key from a specific `Score2` type field. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `field-name` | path | (Required) Name of the field to remove a key from. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update score by field.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update score by field.yml new file mode 100644 index 0000000000..ad610d1c39 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update score by field.yml @@ -0,0 +1,79 @@ +info: + name: Update score by field + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/score/:field-name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: field-name + value: carttag + type: path + body: + type: json + data: |- + { + "key": "first key", + "point": 1, + "until": "10m" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/dataentities/:acronym/documents/:id/score/:field-name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/score/:field-name - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the score of a specific `Score2` type field. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `field-name` | path | (Required) Name of the field to score. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update scores.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update scores.yml new file mode 100644 index 0000000000..25e15cd5ae --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Score/Update scores.yml @@ -0,0 +1,84 @@ +info: + name: Update scores + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/score" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + body: + type: json + data: |- + [ + { + "field": "carttag", + "key": "Payment", + "point": 1, + "until": "10m" + }, + { + "field": "scoretest", + "key": "Point 1", + "point": 1, + "until": "1d" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/dataentities/:acronym/documents/:id/score - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/score - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the score of more than one `Score2` type field and more than one key. Learn more about [Data entity field types](https://help.vtex.com/en/tutorial/creating-data-entity--tutorials_1265#understanding-the-types). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Score/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Score/folder.yml new file mode 100644 index 0000000000..8dc7ff982b --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Score/folder.yml @@ -0,0 +1,4 @@ +info: + name: Score + type: folder + seq: 10 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/Scroll documents.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/Scroll documents.yml new file mode 100644 index 0000000000..d4e1f5a626 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/Scroll documents.yml @@ -0,0 +1,163 @@ +info: + name: Scroll documents + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/scroll" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _sort + value: firstName ASC + type: query + disabled: true + - name: _size + value: "10" + type: query + disabled: true + - name: _token + value: "123456" + type: query + disabled: true + - name: acronym + value: SP + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym/scroll - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/scroll - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym/scroll - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym/scroll - Schema is valid", function () { + const schema = {"type":"array","description":"List of documents.","items":{"type":"object","description":"Object representing each document.","properties":{"additionalProperties":{"type":"string","description":"Custom properties."},"id":{"type":"string","description":"Unique identifier of the document."},"accountId":{"type":"string","description":"Unique identifier of the account."},"accountName":{"type":"string","description":"Account name."},"dataEntityId":{"type":"string","description":"Two-letter string that identifies the data entity."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a list of documents according to query parameter filters. If you need to query the entire database, or your collection is over 10000 documents, use this endpoint. + + In the first request, the `X-VTEX-MD-TOKEN` token will be obtained in the response header. This token must be passed to the next request in the `_token` query string parameter. The token expires after 20 minutes of inactivity, and each request made with the token during this time resets the expiration timer. + + After the token is obtained, it is no longer necessary to send the filter or document size per page parameters. You only need to resend the token until the document collection is empty. + + ### First request example: + ``` + /dataentities/CL/scroll?isCluster=true&_size=250&_fields=email,firstName + ``` + + To inform the number of documents per request, use the query string parameter `_size`, which has the maximum value of 1000. + + After the first request, retrieve the token in the header `X-VTEX-MD-TOKEN` and make the next requests. + + ### Example of subsequent requests: + ``` + /dataentities/CL/scroll?_token={tokenValue} + ``` + + >ℹ️ Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api). + + ## Query examples + + + | **Filter Type** | **Example** | + |-|-| + | **Simple filter** | `/dataentities/CL/scroll?email=my@email.com` | + | **Complex filter** | `/dataentities/CL/scroll?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)` | + | **Date range** | `/dataentities/CL/scroll?_where=createdIn between 2001-01-01 AND 2016-01-01` | + | **Numeric field range** | `/dataentities/CL/scroll?_where=age between 18 AND 25` | + | **Partial filter** | `/dataentities/CL/scroll?firstName=*Maria*` | + | **Null values** | `/dataentities/CL/scroll?_where=firstName is null` | + | **Non-null values** | `/dataentities/CL/scroll?_where=firstName is not null` | + | **Difference** | `/dataentities/CL/scroll?_where=firstName<>maria` | + | **Greater than** | `/dataentities/CL/scroll?_where=number>5` | + | **Less than** | `/dataentities/CL/scroll?_where=date<2001-01-01` | + + >⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens, you will receive an error with status code `429`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `_fields` | query | Names of the fields that will be returned per document, separated by a comma `,`. It is possible to fetch all fields using `_all` as the value of this query parameter. However, in order to avoid permission errors, we strongly recommend informing only the names of the exact fields that will be used. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_sort` | query | Defines sorting mode in two parts. The first part is the name of the field you want to sort by. It can be a nested field up to the first level (e.g. `wishlistProduct.productName`). In the second part, use `ASC` for ascending order or `DESC` for descending order. | + | `_size` | query | Maximum amount of documents returned per request. The maximum value you can set is `1000`. | + | `_token` | query | Value of the `X-VTEX-MD-TOKEN` token obtained in the response header of the first request, necessary on subsequent requests to continue scrolling through documents. The token expires after 20 minutes of inactivity, and each request made with the token during this time resets the expiration timer. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + }, + { + "id": "3b3a3fc9-164b-11ea-82ee-121449f60ecb", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + ] + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/folder.yml new file mode 100644 index 0000000000..62a674ca10 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Scroll/folder.yml @@ -0,0 +1,4 @@ +info: + name: Scroll + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Search/Search documents.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Search/Search documents.yml new file mode 100644 index 0000000000..31920fcfc6 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Search/Search documents.yml @@ -0,0 +1,139 @@ +info: + name: Search documents + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + - name: REST-Range + value: resources=0-10 + params: + - name: _fields + value: email,firstName,document + type: query + disabled: true + - name: _where + value: firstName is not null + type: query + disabled: true + - name: _sort + value: firstName ASC + type: query + disabled: true + - name: acronym + value: SP + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym/search - Schema is valid", function () { + const schema = {"type":"array","description":"List of documents.","items":{"type":"object","description":"Object representing each document.","properties":{"additionalProperties":{"type":"string","description":"Custom properties."},"id":{"type":"string","description":"Unique identifier of the document."},"accountId":{"type":"string","description":"Unique identifier of the account."},"accountName":{"type":"string","description":"Account name."},"dataEntityId":{"type":"string","description":"Two-letter string that identifies the data entity."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Master Data v1 documents' information, while choosing which fields will be returned and filtering documents by specific fields. + + >ℹ️ Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api) and [Querying documents in Master Data v1](https://developers.vtex.com/docs/guides/querying-documents-in-master-data-v1). + + ## Query examples + + + | **Filter Type** | **Example** | + |-|-| + | **Simple filter** | `/dataentities/CL/search?email=my@email.com` | + | **Complex filter** | `/dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)` | + | **Date range** | `/dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01` | + | **Numeric field range** | `/dataentities/CL/search?_where=age between 18 AND 25` | + | **Partial filter** | `/dataentities/CL/search?firstName=*Maria*` | + | **Null values** | `/dataentities/CL/search?_where=firstName is null` | + | **Non-null values** | `/dataentities/CL/search?_where=firstName is not null` | + | **Difference** | `/dataentities/CL/search?_where=firstName<>maria` | + | **Greater than** | `/dataentities/CL/search?_where=number>5` | + | **Less than** | `/dataentities/CL/search?_where=date<2001-01-01` | + + + >⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `_fields` | query | Names of the fields that will be returned per document, separated by a comma `,`. It is possible to fetch all fields using `_all` as the value of this query parameter. However, in order to avoid permission errors, we strongly recommend informing only the names of the exact fields that will be used. | + | `_where` | query | Defines a condition the document must comply with. When referring to fields, you can use a nested field up to the first level (e.g. `wishlistProduct.productName`). | + | `_sort` | query | Defines sorting mode in two parts. The first part is the name of the field you want to sort by. It can be a nested field up to the first level (e.g. `wishlistProduct.productName`). In the second part, use `ASC` for ascending order or `DESC` for descending order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `REST-Range` | header | (Required) Specifies the range of documents to be returned in the response. The value should follow the format `resources={x}-{y}`, where: * `x`: Index of the first document in the returned array. * `y`: Index of the last document in the returned array + 1. This field controls pagination by defining the subset of documents to be retrieved. The maximum number of documents returned per query is limited to 100. For example, `resources=0-10` returns the first 10 documents. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + }, + { + "id": "3b3a3fc9-164b-11ea-82ee-121449f60ecb", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + ] + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Search/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Search/folder.yml new file mode 100644 index 0000000000..0f316f431c --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Search/folder.yml @@ -0,0 +1,4 @@ +info: + name: Search + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Get version.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Get version.yml new file mode 100644 index 0000000000..b3005edb20 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Get version.yml @@ -0,0 +1,104 @@ +info: + name: Get version + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/versions/:versionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: versionId + value: _X58kLameckHYRuBMUbaimlhwqslsrrwT_ + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Schema is valid", function () { + const schema = {"title":"Getversion","required":["id","author","document"],"type":"object","description":"Version information.","properties":{"id":{"type":"string","description":"Unique identifier of the version."},"author":{"type":"string","description":"Unique identifier of the user who created the version."},"document":{"title":"Document","required":["id","dataEntityId","accountId","accountName"],"type":"object","description":"Object representing each document.","properties":{"{customProperty}":{"type":"string","description":"Custom property."},"id":{"type":"string","description":"Unique identifier of the document."},"accountId":{"type":"string","description":"Unique identifier of the account."},"accountName":{"type":"string","description":"Account name."},"dataEntityId":{"type":"string","description":"Two-letter string that identifies the data entity."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the version of a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `versionId` | path | (Required) Unique identifier of the version to retrieve. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "version-id", + "author": "user-id", + "document": { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Versions/List versions.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/List versions.yml new file mode 100644 index 0000000000..a7c33eaf3e --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/List versions.yml @@ -0,0 +1,104 @@ +info: + name: List versions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/versions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/:acronym/documents/:id/versions - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Listversion","required":["id","date"],"type":"object","description":"Version information.","properties":{"id":{"type":"string","description":"Unique identifier of the version."},"date":{"type":"string","description":"Date when the version was created, in ISO 8601 format."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all versions of a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "_EAR0cJ7XB5k5grnmm0zeKGlVvVM9WCPV_", + "date": "2016-10-18T16:53:32+00:00" + }, + { + "id": "_E5SH9WXVvhPBNnbQtYAAGqrIysIeNYhy_", + "date": "2016-09-08T20:11:42+00:00" + }, + { + "id": "_cwVfOG7S6XeAiDBhNpLiJM1cwRiJcvdp_", + "date": "2016-07-14T00:36:36+00:00" + } + ] + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Update version.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Update version.yml new file mode 100644 index 0000000000..9fa9962787 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/Update version.yml @@ -0,0 +1,97 @@ +info: + name: Update version + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/dataentities/:acronym/documents/:id/versions/:versionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/vnd.vtex.ds.v10+json + params: + - name: acronym + value: SP + type: path + - name: id + value: SP-b818cbda-e489-11e6-94f4-0ac138d2d42e + type: path + - name: versionId + value: _X58kLameckHYRuBMUbaimlhwqslsrrwT_ + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/dataentities/:acronym/documents/:id/versions/:versionId - Schema is valid", function () { + const schema = {"title":"IdHref","required":["Id","Href"],"type":"object","description":"Document information.","properties":{"Id":{"type":"string","description":"ID of the document that was created, with data entity prefix."},"Href":{"type":"string","description":"Document reference URL."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the version of a document. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `acronym` | path | (Required) Two-letter string that identifies the data entity. | + | `id` | path | (Required) Unique identifier of the document. | + | `versionId` | path | (Required) Unique identifier of the version to update. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "CL-b818cbda-e489-11e6-94f4-0ac138d2d42e", + "Href": "http://{{accountName}}.vtexcommercestable.com.br/api/dataentities/CL/documents/b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + ``` diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/Versions/folder.yml b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/folder.yml new file mode 100644 index 0000000000..6e76120d54 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/Versions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Versions + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/environments/VTEX.yml b/BrunoCollections/VTEX - MasterData API - v10.2/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - MasterData API - v10.2/opencollection.yml b/BrunoCollections/VTEX - MasterData API - v10.2/opencollection.yml new file mode 100644 index 0000000000..dc4d167483 --- /dev/null +++ b/BrunoCollections/VTEX - MasterData API - v10.2/opencollection.yml @@ -0,0 +1,24 @@ +opencollection: 1.0.0 + +info: + name: VTEX - MasterData API - v10.2 + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Master Data is a highly customizable VTEX database solution, which enables you to create applications. By default, Master Data is used to store and organize Customer data from your store. It features a powerful search engine, allowing you to store, search, expand, and customize data. Learn more about [Master Data v1](https://help.vtex.com/en/tutorial/master-data--4otjBnR27u4WUIciQsmkAw). + + >⚠️ Do not use Master Data as a log, cache, or temporary data store. Writing high volumes of disposable data can trigger API throttling and degrade store performance. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Message Center API/DKIM configuration/Generate DKIM keys.yml b/BrunoCollections/VTEX - Message Center API/DKIM configuration/Generate DKIM keys.yml new file mode 100644 index 0000000000..ff8a80ab79 --- /dev/null +++ b/BrunoCollections/VTEX - Message Center API/DKIM configuration/Generate DKIM keys.yml @@ -0,0 +1,91 @@ +info: + name: Generate DKIM keys + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/mail-service/pvt/providers/:EmailProvider/dkim" + headers: + - name: Accept + value: application/json + params: + - name: EmailProvider + value: help@valdie.co + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/mail-service/pvt/providers/:EmailProvider/dkim - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/mail-service/pvt/providers/:EmailProvider/dkim - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/mail-service/pvt/providers/:EmailProvider/dkim - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/mail-service/pvt/providers/:EmailProvider/dkim - Schema is valid", function () { + const schema = {"type":"object","additionalProperties":true,"properties":{"status":{"type":"string","description":"DKIM key generating status, which can be one of the following values: \r\n\r\n- Status `emailNotFound` \r\n\r\n- `emailNotVerified` \r\n\r\n- `created`","enum":["emailNotFound","emailNotVerified","created"]},"dkimKeys":{"type":["array","null"],"description":"List of DKIM keys.","items":{"type":"string","description":"DKIM keys."},"additionalProperties":true}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Create [DKIM keys](https://developers.vtex.com/docs/guides/setting-up-dkim-for-transactional-emails) for a sender that was [setup](https://help.vtex.com/en/tracks/transactional-emails--6IkJwttMw5T84mlY9RifRP/42LVaxtFb2VHX9xTZU58qC) in VTEX mail servers. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Message Center | Providers | **Add or edit provider** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `EmailProvider` | path | (Required) Email address for the sender that was setup in VTEX mail servers. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + + ## Example response (`200`) + + ```json + { + "status": "emailNotFound", + "dkimKeys": null + } + ``` diff --git a/BrunoCollections/VTEX - Message Center API/DKIM configuration/folder.yml b/BrunoCollections/VTEX - Message Center API/DKIM configuration/folder.yml new file mode 100644 index 0000000000..969edcbb97 --- /dev/null +++ b/BrunoCollections/VTEX - Message Center API/DKIM configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: DKIM configuration + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Message Center API/environments/VTEX.yml b/BrunoCollections/VTEX - Message Center API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Message Center API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Message Center API/opencollection.yml b/BrunoCollections/VTEX - Message Center API/opencollection.yml new file mode 100644 index 0000000000..b0bb5bb7f7 --- /dev/null +++ b/BrunoCollections/VTEX - Message Center API/opencollection.yml @@ -0,0 +1,28 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Message Center API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + **Message Center** corresponds to [order transactional email templates](https://help.vtex.com/en/tutorial/order-transactional-email-templates--3g2S2kqBOoSGcCaqMYK2my). The store can configure templates to automatically send emails to customers and notify them about their order events, such as payment confirmation and shipping. + + ## Message Center API Index + + ### DKIM configuration + + - `POST` [Generate DKIM keys](https://developers.vtex.com/docs/api-reference/message-center-api#post-/api/mail-service/pvt/providers/-EmailProvider-/dkim) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/Configure location capacity.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/Configure location capacity.yml new file mode 100644 index 0000000000..8705052755 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/Configure location capacity.yml @@ -0,0 +1,140 @@ +info: + name: Configure location capacity + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/fulfillment-locations/location/:locationId/capacities/:code" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: locationId + value: "71" + type: path + - name: code + value: fulfill_orders + type: path + body: + type: json + data: |- + { + "capacityType": "FIXED", + "capacityUnit": "ORDERS", + "fullCapacityAction": "PAUSE", + "maxIncreasePromise": { + "amount": 18 + }, + "dayCapacity": { + "MONDAY": 11, + "TUESDAY": 3, + "WEDNESDAY": 1, + "THURSDAY": 8, + "FRIDAY": 4, + "SATURDAY": 10, + "SUNDAY": 7, + "HOLIDAYS_AND_EXCEPTIONS": 5 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/fulfillment-locations/location/:locationId/capacities/:code - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/fulfillment-locations/location/:locationId/capacities/:code - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/fulfillment-locations/location/:locationId/capacities/:code - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/fulfillment-locations/location/:locationId/capacities/:code - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"description":"Unique identifier of the location.","type":"integer"},"capacityType":{"type":"string","enum":["FIXED","UNLIMITED"],"description":"Type of capacity."},"capacityUnit":{"type":"string","enum":["ORDERS","ORDER_ITEMS"],"description":"Unit of capacity."},"fullCapacityAction":{"type":"string","enum":["PAUSE","MOVE_TO_NEXT_SHIFT"],"description":"Action to take when full capacity is reached."},"taskId":{"description":"Unique identifier of the task.","type":"integer"},"locationTask":{"description":"Object containing information of the task associated with the location.","type":["object","null"]},"capacityShifts":{"description":"List of capacity shifts of the location.","type":"array","items":{"description":"Object cointainf capacity shift information.","type":"object","properties":{"id":{"description":"Unique identifier of the capacity shift.","type":"integer"},"capacityAmount":{"description":"Amount of product avaiable in the capacity shift.","type":"integer"},"capacityRuleId":{"description":"Unique identifier of the capacity shift rule.","type":"integer"},"timeStart":{"description":"Start time for the capacity period in the format `HH:MM:SS`.","type":"string"},"timeEnd":{"description":"time for the capacity period in the format `HH:MM:SS`.","type":"string"},"weekDay":{"description":"Day of the week .","type":"string"}}}},"additionalInfo":{"description":"Additional information of the capacity shifts.","type":"object","properties":{"maxIncreasePromise":{"type":"object","description":"Defines the maximum allowed increase in the delivery promise.","properties":{"amount":{"type":"integer","maximum":18,"description":"Maximum number of additional capacity units allowed."},"unit":{"type":"string","description":"Unit of the amount.","enum":["DAYS","WEEKS"]}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the capacity settings of a specific location for a given task type (`code`). The API allows configuration of capacity parameters (such as capacity type, unit, and actions) that control the operational capacity of the location. If a field is omitted, the current values will be preserved. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location. | + | `code` | path | (Required) The type of task to update. Currently, the only supported value is `fulfill_orders`. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": 71, + "capacityType": "FIXED", + "capacityUnit": "ORDERS", + "fullCapacityAction": "PAUSE", + "taskId": 1, + "locationTask": null, + "capacityShifts": [ + { + "id": 607, + "capacityAmount": 11, + "capacityRuleId": 71, + "timeStart": "00:00:00", + "timeEnd": "23:59:59", + "weekDay": "MONDAY" + }, + { + "id": 608, + "capacityAmount": 3, + "capacityRuleId": 71, + "timeStart": "00:00:00", + "timeEnd": "23:59:59", + "weekDay": "TUESDAY" + } + ], + "additionalInfo": { + "maxIncreasePromise": { + "amount": 18, + "unit": "DAYS" + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/folder.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/folder.yml new file mode 100644 index 0000000000..1cbf449754 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Capacity configuration + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity details/List location capacities.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity details/List location capacities.yml new file mode 100644 index 0000000000..8f1fa398d2 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity details/List location capacities.yml @@ -0,0 +1,111 @@ +info: + name: List location capacities + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/fulfillment-locations/locations/:locationId/capacities" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: daysRequested + value: "3" + type: query + disabled: true + - name: locationId + value: "71" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/fulfillment-locations/locations/:locationId/capacities - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/fulfillment-locations/locations/:locationId/capacities - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/fulfillment-locations/locations/:locationId/capacities - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/fulfillment-locations/locations/:locationId/capacities - Schema is valid", function () { + const schema = {"type":"array","description":"List of capacity details for the specified location.","items":{"type":"object","description":"Details for a specific day's capacity including usage percentage, limit, usage amount, and the active time window.","properties":{"amountPercentage":{"type":"number","description":"Percentage of capacity used."},"capacityLimitAmount":{"type":"integer","description":"Maximum capacity amount for the day."},"capacityUsageAmount":{"type":"integer","description":"Capacity amount used for the day."},"startAt":{"type":"string","format":"date-time","description":"Start time for the capacity period."},"endAt":{"type":"string","format":"date-time","description":"End time for the capacity period."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the capacity details for the next `daysRequested` days for the specified location. If `daysRequested` is not provided, it defaults to `3` days. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics viewer** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location. | + | `daysRequested` | query | Number of days to be displayed. Defaults to `3` if not provided. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "amountPercentage": 92.10526315789474, + "capacityLimitAmount": 38, + "capacityUsageAmount": 35, + "startAt": "2025-02-07T03:00:00+00:00", + "endAt": "2025-02-08T02:59:59+00:00" + }, + { + "amountPercentage": 92.10526315789474, + "capacityLimitAmount": 38, + "capacityUsageAmount": 35, + "startAt": "2025-02-08T03:00:00+00:00", + "endAt": "2025-02-09T02:59:59+00:00" + }, + { + "amountPercentage": 92.10526315789474, + "capacityLimitAmount": 38, + "capacityUsageAmount": 35, + "startAt": "2025-02-09T03:00:00+00:00", + "endAt": "2025-02-10T02:59:59+00:00" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity details/folder.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity details/folder.yml new file mode 100644 index 0000000000..18b1630c1d --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity details/folder.yml @@ -0,0 +1,4 @@ +info: + name: Capacity details + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity/Get locations capacities by account.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity/Get locations capacities by account.yml new file mode 100644 index 0000000000..dcd1209a8a --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity/Get locations capacities by account.yml @@ -0,0 +1,90 @@ +info: + name: Get locations capacities by account + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/fulfillment-locations/capacity/by-parent-account-name" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/fulfillment-locations/capacity/by-parent-account-name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/fulfillment-locations/capacity/by-parent-account-name - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/fulfillment-locations/capacity/by-parent-account-name - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/fulfillment-locations/capacity/by-parent-account-name - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object that represents the capacity information for a fulfillment location, including its identifier, account details, and availability window.","properties":{"locationId":{"type":"string","description":"Unique identifier for the location."},"accountName":{"type":"string","description":"Name of the account associated with the location."},"accountId":{"type":"string","description":"Identifier for the VTEX account."},"availability":{"type":"object","description":"Availability details including usage percentage and time window.","properties":{"amountUsagePercentage":{"type":"number","description":"Percentage of capacity currently in use."},"startAt":{"type":"string","format":"date-time","description":"Start time of the availability period."},"endAt":{"type":"string","format":"date-time","description":"End time of the availability period."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the current capacities of all locations associated with a parent account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "locationId": "locationId_3", + "accountName": "seller_2", + "accountId": "id_2", + "availability": { + "amountUsagePercentage": 0, + "startAt": "2025-02-10T00:00:00-03:00", + "endAt": "2025-02-10T23:59:59-03:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Operational Capacity API/Capacity/folder.yml b/BrunoCollections/VTEX - Operational Capacity API/Capacity/folder.yml new file mode 100644 index 0000000000..68dd00265e --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Capacity/folder.yml @@ -0,0 +1,4 @@ +info: + name: Capacity + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Operational Capacity API/Location status/Update location status.yml b/BrunoCollections/VTEX - Operational Capacity API/Location status/Update location status.yml new file mode 100644 index 0000000000..20de1adfad --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Location status/Update location status.yml @@ -0,0 +1,114 @@ +info: + name: Update location status + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/fulfillment-locations/locations/:locationId/status" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: locationId + value: "71" + type: path + body: + type: json + data: |- + { + "status": "MANUALLY_PAUSED" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/fulfillment-locations/locations/:locationId/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/fulfillment-locations/locations/:locationId/status - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/fulfillment-locations/locations/:locationId/status - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/fulfillment-locations/locations/:locationId/status - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the location."},"name":{"type":"string","description":"Name of the location."},"status":{"type":"string","enum":["ACTIVE","MANUALLY_PAUSED","PAUSED"],"description":"Current status of the location."},"timeZone":{"type":"string","description":"Time zone of the location."},"vtexAccountName":{"type":"string","description":"VTEX account name associated with the location."},"vtexAccount":{"type":"object","description":"Detailed VTEX account information.","properties":{"id":{"type":"string","description":"VTEX account unique identifier."},"name":{"type":"string","description":"Name of the VTEX account."},"companyName":{"type":"string","description":"Company name associated with the VTEX account."},"ownerAccountName":{"type":"string","description":"Owner account name."}}},"locationTasks":{"type":"array","description":"List of tasks associated with the location.","items":{"type":"object","description":"Represents a task associated with the location."}},"address":{"type":"object","description":"Address details of the location.","properties":{"formattedAddress":{"type":"string","description":"The full formatted address."},"country":{"type":"string","description":"Country where the location is situated."},"administrativeAreaLevel1":{"type":"string","description":"First administrative division (e.g., state)."},"administrativeAreaLevel2":{"type":"string","description":"Second administrative division (e.g., city)."},"postalCode":{"type":"string","description":"Postal code of the location."},"geoLocation":{"type":"object","description":"Geographic coordinates of the location.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the status of a specific location (identified by `locationId`) to either `ACTIVE` or `MANUALLY_PAUSED`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `locationId` | path | (Required) Unique identifier of the location. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "id": "locationId_1", + "name": "Location A", + "status": "MANUALLY_PAUSED", + "timeZone": "America/Bahia", + "vtexAccountName": "", + "vtexAccount": { + "id": "1b4018ec-48bf-4a59-9eae-547403e11afc", + "name": "logisticsqa", + "companyName": "VTEX", + "ownerAccountName": "logisticsqa" + }, + "locationTasks": [], + "address": { + "formattedAddress": "Centro Empresarial - Praia de Botafogo, 300 - 3º Andar - Botafogo, Rio de Janeiro - RJ, 22250-040, Brasil", + "country": "Brasil", + "administrativeAreaLevel1": "RJ", + "administrativeAreaLevel2": "Rio de Janeiro", + "postalCode": "22250-040", + "geoLocation": { + "latitude": -22.9443688, + "longitude": -43.1825604 + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Operational Capacity API/Location status/folder.yml b/BrunoCollections/VTEX - Operational Capacity API/Location status/folder.yml new file mode 100644 index 0000000000..17479ece00 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Location status/folder.yml @@ -0,0 +1,4 @@ +info: + name: Location status + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Operational Capacity API/Locations/List locations.yml b/BrunoCollections/VTEX - Operational Capacity API/Locations/List locations.yml new file mode 100644 index 0000000000..4cfe94b6d5 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Locations/List locations.yml @@ -0,0 +1,118 @@ +info: + name: List locations + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/fulfillment-locations/location" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: page + value: "0" + type: query + disabled: true + - name: pageSize + value: "30" + type: query + disabled: true + - name: status + value: ACTIVE + type: query + disabled: true + - name: search + value: seller_2 + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/fulfillment-locations/location - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/fulfillment-locations/location - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/fulfillment-locations/location - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/fulfillment-locations/location - Schema is valid", function () { + const schema = {"type":"object","properties":{"hasNextPage":{"type":"boolean","description":"Indicates if there is another page of results."},"data":{"type":"array","description":"List of fulfillment locations.","items":{"type":"object","description":"Represents a fulfillment location with its details, including identifier, name, status, time zone, account information, associated tasks, and address.","properties":{"id":{"type":"string","description":"Unique identifier of the location."},"name":{"type":"string","description":"Name of the location."},"status":{"type":"string","enum":["ACTIVE","MANUALLY_PAUSED","PAUSED"],"description":"Current status of the location."},"timeZone":{"type":"string","description":"Time zone of the location."},"vtexAccountName":{"type":"string","description":"VTEX account name associated with the location."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a paginated list of fulfillment locations that match the given search criteria and status filter. Pagination is controlled via `page` and `pageSize` parameters. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Logistics full access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | query | Page number, starting from `0`. Defaults to `0` if not provided. | + | `pageSize` | query | Number of results per page (maximum: `30`). Defaults to `30` if not provided. | + | `status` | query | Filter by location status. Multiple statuses can be separated by commas. | + | `search` | query | Search for locations by name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "hasNextPage": false, + "data": [ + { + "id": "locationId_1", + "name": "Location A", + "status": "ACTIVE", + "timeZone": "America/Bahia", + "vtexAccountName": "" + }, + { + "id": "locationId_3", + "name": "seller_2", + "status": "ACTIVE", + "timeZone": "America/Bahia", + "vtexAccountName": "" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Operational Capacity API/Locations/folder.yml b/BrunoCollections/VTEX - Operational Capacity API/Locations/folder.yml new file mode 100644 index 0000000000..a10e093424 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/Locations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Locations + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Operational Capacity API/environments/VTEX.yml b/BrunoCollections/VTEX - Operational Capacity API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Operational Capacity API/opencollection.yml b/BrunoCollections/VTEX - Operational Capacity API/opencollection.yml new file mode 100644 index 0000000000..b21f874498 --- /dev/null +++ b/BrunoCollections/VTEX - Operational Capacity API/opencollection.yml @@ -0,0 +1,42 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Operational Capacity API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + This API allows management of fulfillment locations and their capacities for VTEX logistics operations. It supports retrieving capacities by parent account, configuring capacity settings per location, listing capacity details, retrieving a paginated list of locations, and updating location status. + + ## Capacity + + - `PUT` [Get locations capacities by account]() + + ## Capacity configuration + + - `PUT` [Configure location capacity]() + + ## Capacity details + + - `GET` [List location capacities]() + + ## Locations + + - `GET` [List locations]() + + ## Location status + + - `PUT` [Update location status]() + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Invoice/Order invoice notification.yml b/BrunoCollections/VTEX - Orders API (PII version)/Invoice/Order invoice notification.yml new file mode 100644 index 0000000000..3a2873ad56 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Invoice/Order invoice notification.yml @@ -0,0 +1,129 @@ +info: + name: Order invoice notification + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/invoices" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + body: + type: json + data: |- + { + "type": "Output", + "issuedDate": "2024-09-20", + "invoiceNumber": "000059579", + "invoiceValue": 2499, + "items": [ + { + "itemIndex": 0, + "price": 2499, + "quantity": 3 + }, + { + "itemIndex": 0, + "price": 2499, + "quantity": 3 + } + ], + "extraValue": 100, + "invoiceKey": "33240945242914001845550010004817221546274961", + "invoiceUrl": "https://ecommerce.str.com/logged/nf/v71021948str-01", + "courier": "OSAPLAG_EXPRESS", + "trackingNumber": "71021938", + "trackingUrl": "https://tracking.agj.com/order/v71021948str-01/status", + "cfop": "5100", + "volumes": 3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Date and time when the order invoice notification was received in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID in the seller environment."},"receipt":{"type":["string","null"],"description":"Protocol code generated by the request."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Endpoint used by the seller after order invoicing to send the invoice information to the marketplace. + + Once the seller has the order tracking information, it is also possible to use this endpoint to send order tracking information to the marketplace. + + >⚠️ To avoid price rounding errors, we strongly recommend sending the object with the invoiced items in the request body. + + >❗ It is not allowed to use the same `invoiceNumber` in more than one request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify invoice | + | IntegrationProfile - Fulfillment Gateway Oms | Notify invoice | + | IntegrationProfile - Fulfillment Oms | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "date": "2024-09-25T18:03:19.7055982Z", + "orderId": "v71021948str-01", + "receipt": "38e0e47da2934847b489216d208cfd91" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Invoice/folder.yml b/BrunoCollections/VTEX - Orders API (PII version)/Invoice/folder.yml new file mode 100644 index 0000000000..bcd813cd46 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Invoice/folder.yml @@ -0,0 +1,4 @@ +info: + name: Invoice + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Orders/Cancel order.yml b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Cancel order.yml new file mode 100644 index 0000000000..3821a25bdf --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Cancel order.yml @@ -0,0 +1,106 @@ +info: + name: Cancel order + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/cancel" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + body: + type: json + data: |- + { + "reason": "Unexpected stock shortage" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Cancellation request date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID in the seller environment."},"receipt":{"type":["string","null"],"description":"Protocol code generated by the cancellation request."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Requests order cancellation by searching by order ID. + + It is possible for the seller to [decline an order cancellation request](https://help.vtex.com/tutorial/declining-order-cancelation--F2n0h1TeQ5td540Gjyff4), know more in [Order canceling improvements](https://developers.vtex.com/docs/guides/order-canceling-improvements). + + >⚠️ You can only cancel an order in the `invoiced` [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) if you send a return invoice first, using the [Order Invoice Notification](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/invoices) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Cancel order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Cancel order | + | Sales App - Sales Associate | Cancel order | + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms | Cancel order | + | IntegrationProfile - Fulfillment Oms | Cancel order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderId": "1417440051885-01", + "receipt": "38e0e47da2934847b489216d208cfd91", + "date": "2024-09-26T00:00:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Orders/Get order.yml b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Get order.yml new file mode 100644 index 0000000000..b42c6a6fff --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Get order.yml @@ -0,0 +1,105 @@ +info: + name: Get order + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/orders/pvt/document/:orderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + disabled: true + - name: orderId + value: v71021948str-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/orders/pvt/document/:orderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Order ID."},"sellerOrderId":{"type":"string","description":"Seller order ID."},"orderFormId":{"type":"string","description":"ID of the shopping cart from which the order was created."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196).","enum":["Marketplace","Fulfillment","Chain"]},"orderGroup":{"type":"string","description":"Order group ID."},"items":{"type":"array","description":"Information on order items.","items":{"type":"object","description":"Information on each order item.","properties":{"productCategories":{"type":"object","description":"Object containing product categories with the structure: `{CategoryID}: {CategoryName}`.","properties":{"additionalProperties":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"uniqueId":{"type":"string","description":"Order item unique ID."},"id":{"type":"string","description":"Item ID."},"productId":{"type":"string","description":"Product ID."},"lockId":{"type":["string","null"],"description":"[Reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) ID."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"quantity":{"type":"integer","description":"Item quantity."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"sellerSku":{"type":"string","description":"Seller SKU ID."},"priceValidUntil":{"type":"string","description":"Item price expiration date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"name":{"type":"string","description":"SKU name."},"additionalInfo":{"type":"object","description":"Item additional information.","properties":{"brandName":{"type":"string","description":"Item brand name."},"brandId":{"type":"string","description":"Item brand ID."},"categoriesIds":{"type":"string","description":"Categories IDs."},"dimension":{"type":"object","description":"Item dimensions.","properties":{"cubicweight":{"type":"number","description":"Item cubic weight."},"height":{"type":"number","description":"Item height."},"length":{"type":"number","description":"Item length."},"weight":{"type":"number","description":"Item weight."},"width":{"type":"number","description":"Item width."}}},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial condition ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categories":{"type":"array","description":"Item [categories](https://help.vtex.com/tracks/catalog-101--5AF0XfnjfWeopIFBgs3LIQ/2gkZDjXRqfsq62TlAkj4uf) information.","items":{"type":"object","description":"Information about a given category.","properties":{"id":{"type":"integer","description":"Category ID."},"name":{"type":"string","description":"Category name."}}}}}},"attachments":{"type":["array","null"],"description":"Information on [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"attachmentOfferings":{"type":["array","null"],"description":"Array containing attachments details.","items":{"type":["object","null"],"description":"Attachment details.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Schema of the content declared in the field `attachmentOfferings`."}}}},"assemblies":{"type":["array","null"],"description":"Information about the item customization, when applicable.","items":{"type":["string","null"],"description":"Customization information."}},"refId":{"type":"string","description":"Ref ID."},"shippingPrice":{"type":["integer","null"],"description":"Item shipping price in cents. This value does not account for the order total shipping price."},"price":{"type":"integer","description":"Item price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents. This field can present rounding discrepancies, so we recommend retrieving pricing information from the `priceDefinition` field."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) in cents."},"tax":{"type":"integer","description":"Tax value in cents."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"freightCommission":{"type":"integer","description":"Freight commission value in cents."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"priceTags":{"type":"array","description":"Information about price tags. A price tag is a price modifier, like s discount or a promotion applicable to the item in the order context.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":"string","description":"Price tag name."},"rawValue":{"type":"number","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"identifier":{"type":"string","description":"Price tag identifier."},"rate":{"type":["integer","null"],"description":"Price tag value."},"jurisCode":{"type":["string","null"],"description":"Juris code."},"jurisType":{"type":["string","null"],"description":"Juris type."},"jurisName":{"type":["string","null"],"description":"Juris name."}}}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"components":{"type":["array","null"],"description":"Item components.","items":{"type":["string","null"],"description":"Component name."}},"bundleItems":{"type":["array","null"],"description":"Information about services sold with the item. For example, a gift package.","items":{"type":"object","description":"Information about a given service.","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service ID."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"offerings":{"type":["array","null"],"description":"Information about offerings, which are services related to the item. For example, a warranty or installation.","items":{"type":["string","null"],"description":"Name of the service related to the item. For example, warranty or installation."}},"preSaleDate":{"type":["string","null"],"description":"Presale date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`) or not (`false`)."},"taxCode":{"type":["string","null"],"description":" Item tax code."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"marketingData":{"type":["object","null"],"description":"Information about marketing and promotions, such as coupon code and [Urchin Tracking Module (UTM)](https://help.vtex.com/en/tutorial/what-are-utm-source-utm-campaign-and-utm-medium--2wTz7QJ8KUG6skGAoAQuii).","properties":{"utmSource":{"type":["string","null"],"description":"A UTM is an Urchin Tracking Module used to track traffic related to your store. This field is an UTM for tracking the traffic source, to know from which site, advertiser, or publication the customer came before reaching your site."},"utmMedium":{"type":"string","description":"UTM for tracking the advertising or marketing media used to reach your site, such as banners and newsletters."},"utmCampaign":{"type":["string","null"],"description":"UTM for tracking the marketing campaign context."},"utmPartner":{"type":["string","null"],"description":"UTM for tracking the partner."},"utmipage":{"type":["string","null"],"description":"A `utmi` is an internal Urchin Tracking Module (UTM) used to track traffic inside your site. This field is an internal UTM for tracking pages."},"utmiPart":{"type":["string","null"],"description":"Internal UTM for tracking the partner."},"utmiCampaign":{"type":["string","null"],"description":"Internal UTM for tracking the marketing campaign context."},"coupon":{"type":["string","null"],"description":"Coupon code used by the customer."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the item.","items":{"type":"string","description":"Marketing tag name."}}}},"parentAssemblyBinding":{"type":["string","null"],"description":"When items are indexed in between each other, this field returns the assembly option ID. This response is `null` for items that are not [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)."},"parentItemIndex":{"type":["integer","null"],"description":"Ranking number that shows how related items are indexed in between each other. It starts at `0` as the primary item reference and counts up to `1`, `2`, and so on. For example, a customer bought sunglasses and hired a warranty service. Since the sunglasses are index `0`, the warranty service (the [assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)) is index `1` and has the `parentItemIndex` value `0`. This response is `null` for items that are not assembly options."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator that sold the item, when applicable."},"priceDefinition":{"type":"object","description":"Item price information.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item calculated selling price in cents."},"total":{"type":"integer","description":"Item total price in cents."},"sellingPrices":{"type":"array","description":"Item selling prices.","items":{"type":"object","description":"Price value per quantity.","properties":{"value":{"type":"integer","description":"Item selling price value in cents."},"quantity":{"type":"integer","description":"Item quantity."}}}},"reason":{"type":["string","null"],"description":"Item price definition reason."}}},"costPrice":{"type":["integer","null"],"description":"Item cost price in cents."}}}},"marketplaceItems":{"type":["array","null"],"description":"Marketplace items.","items":{"type":["string","null"],"description":"Marketplace item."}},"authorizedDate":{"type":"string","description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"subscriptionData":{"type":["object","null"],"description":"Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453), when applicable.","properties":{"subscriptionGroupId":{"type":["string","null"],"description":"Subscription group ID. If this field returns `null` and the `executionCount` is `0`, the order is the first subscription order."},"subscriptions":{"type":["array","null"],"description":"List with subscriptions details.","items":{"type":"object","description":"Subscription details.","properties":{"executionCount":{"type":"integer","description":"Position of the order in the subscription cycle. The first order will have the value `0`, the second will have the value `1`, and so on."},"priceAtSubscriptionDate":{"type":["number","null"],"description":"Value of the order when the customer subscribed. Subscriptions created via VTEX Admin or [Subscriptions API](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3) do not have an original order, so this field returns `0.0`."},"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"plan":{"type":"object","description":"Information about the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR).","properties":{"type":{"type":"string","description":"Plan type."},"frequency":{"type":"object","description":"Information about subscriptions' recurrence.","properties":{"periodicity":{"type":"string","description":"Defines the subscription recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the frequency. For a `DAY` frequency, the value will be days, for `MONTH` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription will be valid.","properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}}}}}},"taxData":{"type":["object","null"],"description":"Order taxes information.","required":["areTaxesDesignatedByMarketplace","taxInfoCollection"],"properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were applied by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Order taxes details.","items":{"type":"object","description":"Information about a given tax.","required":["itemIndex","sku","priceTags"],"properties":{"itemIndex":{"type":"integer","description":"Item indexing number."},"sku":{"type":"string","description":"SKU ID."},"priceTags":{"type":["object","null"],"description":"Information about order taxes.","properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were designated by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Array with taxes' details.","items":{"type":"object","description":"Details about a given tax.","properties":{"itemIndex":{"type":"integer","description":"Item index number."},"sku":{"type":"string","description":"Alphanumeric sequence that identifies a SKU."},"priceTags":{"type":"array","description":"Price tags information with the original taxes calculated at order placement.","items":{"type":"object","description":"Information about a given price tag.","properties":{"identifier":{"type":"string","description":"Price tag identifier code."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"name":{"type":"string","description":"Price tag name."},"value":{"type":"number","description":"Price tag value."},"rawValue":{"type":"number","description":"Price tag raw value that can contain up to five decimals, separated by a period."}}}}}}}}}}}}}},"invoicedDate":{"type":["string","null"],"description":"Order invoice date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"marketplaceOrderId":{"type":["string","null"],"description":"Order ID in the marketplace."},"marketplaceServicesEndpoint":{"type":["string","null"],"description":"Marketplace endpoint for post purchase communication."},"clientProfileData":{"type":"object","description":"Information about the client who created the order.","required":["id","email","firstName","lastName","documentType","document","phone","corporateName","tradeName","corporateDocument","stateInscription","corporatePhone","isCorporate","userProfileId","customerClass"],"properties":{"id":{"type":["string","null"],"description":"Client ID."},"userProfileId":{"type":"string","description":"User profile ID."},"userProfileVersion":{"type":["string","null"],"description":"User profile version."},"firstName":{"type":"string","description":"Client first name."},"lastName":{"type":"string","description":"Client last name."},"email":{"type":"string","description":"Client email address."},"document":{"type":"string","description":"Client document code."},"corporateDocument":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate document."},"corporateName":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate name."},"documentType":{"type":"string","description":"Client document type."},"phone":{"type":"string","description":"Client telephone number."},"tradeName":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the trade name."},"stateInscription":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate state inscription."},"corporatePhone":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate telephone number."},"isCorporate":{"type":"boolean","description":"Defines if the client is corporate and a legal entity (`true`) or not (`false`)."},"customerClass":{"type":["string","null"],"description":"Customer class identification."},"customerCode":{"type":["string","null"],"description":"Customer code."}}},"giftRegistryData":{"type":["object","null"],"description":"[Gift list](https://developers.vtex.com/docs/guides/creating-gift-lists) information.","properties":{"giftRegistryId":{"type":"string","description":"Gift list ID."},"giftRegistryType":{"type":"string","description":"[Gift list type](https://help.vtex.com/en/tutorial/creating-a-type-of-list)."},"giftRegistryTypeName":{"type":"string","description":"Gift list type name."},"addressId":{"type":"string","description":"Gift list shipping address ID."},"description":{"type":"string","description":"Gift list description."}}},"emailTracked":{"type":"string","description":"Customer email [tracked](https://help.vtex.com/en/tutorial/understanding-the-conversation-tracker--tutorials_195)."},"isCheckedIn":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"approvedBy":{"type":["string","null"],"description":"User who approved the order, in case of manual approval."},"cancelledBy":{"type":["string","null"],"description":"User that canceled the order."},"canceledBy":{"type":["string","null"],"description":"User that canceled the order."},"cancelReason":{"type":["string","null"],"description":"Order cancellation reason."},"callCenterOperatorData":{"type":["object","null"],"description":"Information about the call center operator responsible for the order.","properties":{"id":{"type":"string","description":"Call center operator identification code."},"email":{"type":"string","description":"Call center operator email."},"userName":{"type":"string","description":"Call center operator user name."}}},"allowCancellation":{"type":"boolean","description":"Defines if order cancellation is allowed (`true`) or not anymore (`false`)."},"allowEdition":{"type":"boolean","description":"Defines if the order can be edited (`true`) or not anymore (`false`)."},"roundingError":{"type":"integer","description":"Rounding error total amount in cents, when applicable. For example, in orders with a discount over non-integer multiplier items, the rounding price is performed per item, not after the sum of all items. That can cause a difference in the total discount amount, which is informed in this field."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) related to the order."},"salesChannelData":{"type":"object","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) information.","properties":{"countryCode":{"type":["string","null"],"description":"Three-digit country code, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":["string","null"],"description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":["object","null"],"description":"Currency format details.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Defines what currency decimal separator will be applied."},"CurrencyGroupSeparator":{"type":"string","description":"Defines what currency group separator will be applied."},"CurrencyGroupSize":{"type":"integer","description":"Defines how many characters will be grouped."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if all prices will be initiated with the currency symbol (`true`) or not (`false`)."}}},"cultureInfo":{"type":["string","null"],"description":"Information about the culture."},"currencyLocale":{"type":"integer","description":"Currency Locale Code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":["string","null"],"description":"Currency symbol."},"timeZone":{"type":["string","null"],"description":"Time zone where the order was created."},"id":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID."},"name":{"type":"string","description":"Store name."},"isActive":{"type":"boolean","description":"Defines if the sales channel is active (`true`) or inactive (`false`)."}}},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields. For example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}},"changesAttachment":{"type":["object","null"],"description":"Information about changes in the order.","required":["id","changesData"],"properties":{"id":{"type":"string","description":"Order changes ID."},"changesData":{"type":"array","description":"Order changes details.","items":{"required":["reason","discountValue","incrementValue","itemsAdded","itemsRemoved","receipt"],"type":"object","description":"Details about an order change.","properties":{"reason":{"type":"string","description":"Text explaining why the order was changed. This information may be shown to the customer in the storefront or transactional emails."},"discountValue":{"type":["integer","null"],"description":"Order change discount value in cents."},"incrementValue":{"type":["integer","null"],"description":"Order change increment value in cents."},"itemsAdded":{"type":["array","null"],"description":"Information about items added to the order, when applicable.","items":{"type":"object","description":"Information about an item added to the order.","properties":{"id":{"type":"string","description":"Added item SKU ID."},"name":{"type":"string","description":"Added item SKU name."},"quantity":{"type":"integer","description":"Quantity of items added."},"price":{"type":"integer","description":"Added item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Added item unit multiplier."}}}},"itemsRemoved":{"type":["array","null"],"description":"Information about items removed from the order, when applicable.","items":{"type":"object","description":"Information about an item removed from the order.","required":["id","name","quantity","price","unitMultiplier"],"properties":{"id":{"type":"string","description":"Removed item SKU ID."},"name":{"type":"string","description":"Removed item name."},"quantity":{"type":"integer","format":"int32","description":"Quantity of removed items."},"price":{"type":"integer","format":"int32","description":"Removed item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Removed item unit multiplier."}}}},"receipt":{"required":["date","orderId","receipt"],"type":"object","description":"Order changes receipt information.","properties":{"date":{"type":"string","description":"Receipt creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID."},"receipt":{"type":"string","description":"Receipt unique identifier code."}}}}}}}},"commercialConditionData":{"type":["string","null"],"description":"Commercial condition information."},"shippingData":{"type":"object","description":"Order shipping information.","required":["address","logisticsInfo","trackingHints","selectedAddresses"],"properties":{"address":{"type":"object","description":"Shipping address details.","required":["addressType","receiverName","addressId","postalCode","city","state","country","street","number","neighborhood","complement","reference","geoCoordinates"],"properties":{"addressType":{"type":"string","description":"Shipping address type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"postalCode":{"type":"string","description":"Shipping address postal code."},"city":{"type":"string","description":"Shipping address city."},"state":{"type":"string","description":"Shipping address state."},"country":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Shipping address street."},"number":{"type":"string","description":"Shipping address number."},"neighborhood":{"type":"string","description":"Shipping address neighborhood."},"complement":{"type":["string","null"],"description":"Shipping address complement."},"reference":{"type":["string","null"],"description":"Shipping address additional information."},"geoCoordinates":{"type":"array","description":"Shipping address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"logisticsInfo":{"type":"array","description":"Logistics information regarding order items.","items":{"type":"object","description":"Logistics information about an item.","properties":{"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, when applicable."},"sellingPrice":{"type":"integer","description":"Item selling price in cents."},"listPrice":{"type":"integer","description":"Item [list price](https://help.vtex.com/en/tracks/prices-101--6f8pwCns3PJHqMvQSugNfP/3XcXp0r5WrJvogB8KIX4Kx#list-price) in cents."},"price":{"type":"integer","description":"Item shipping price in cents. This value does not correspond to the order total shipping price."},"deliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or pickup.","enum":["delivery","pickup-in-point"]},"deliveryCompany":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company name."},"deliveryIds":{"type":"array","description":"Order delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"courierName":{"type":"string","description":"Carrier name."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"shippingEstimateDate":{"type":"string","description":"Shipping estimate date, defined after order confirmation, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"deliveryChannels":{"type":"array","description":"Delivery channels associated with the sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)).","items":{"type":"object","description":"Delivery channel information.","properties":{"id":{"type":"string","description":"Delivery channel shipping type.","enum":["delivery","pickup-in-point"]},"stockBalance":{"type":"integer","description":"Stock check for SKU availability."}}}},"itemId":{"type":"string","description":"SKU ID."},"shipsTo":{"type":"array","description":"List of shipping address countries.","items":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."}},"slas":{"type":"array","description":"Service Level Agreements (SLA) corresponding to [shipping policies](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).","items":{"type":"object","description":"Service Level Agreement (SLA) information.","properties":{"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"tax":{"type":"integer","description":"SLA tax information."},"listPrice":{"type":"integer","description":"SLA shipping list price in cents."},"price":{"type":"integer","description":"SLA shipping price in cents. Does not account for the order total shipping price."},"deliveryWindow":{"type":["string","null"],"description":"[Delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"availableDeliveryWindows":{"type":["array","null"],"description":"Available delivery windows information, when applicable.","items":{"type":"string","description":"Information about an available delivery window."}},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time related to the SLA."},"shippingEstimateDate":{"type":["string","null"],"description":"SLA shipping estimate date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"deliveryIds":{"type":"array","description":"SLA delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"courierName":{"type":"string","description":"Carrier name."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"name":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) name."},"deliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"id":{"type":"string","description":"ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."}}}},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"selectedDeliveryChannel":{"type":"string","description":"Delivery channel selected by the customer. This field is being deprecated and the information it retrieves can be found in the `deliveryChannel` field.","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time."},"selectedSla":{"type":"string","description":"Service Level Agreement (SLA), which corresponds to the shipping method selected by the customer, usually like normal or express."},"itemIndex":{"type":"integer","description":"Each item in the order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when applicable."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."}}}},"trackingHints":{"type":["array","null"],"description":"Order shipping label information.","items":{"type":"object","description":"Shipping label details.","properties":{"trackingId":{"type":"string","description":"Order tracking ID."},"courierName":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) name."},"trackingUrl":{"type":"string","description":"Order tracking URL."},"trackingLabel":{"type":"string","description":"Order tracking label."}}}},"selectedAddresses":{"type":"array","description":"Selected adresses information.","items":{"type":"object","description":"Details about a selected adress.","properties":{"addressType":{"type":"string","description":"Selected adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Selected address ID."},"versionId":{"type":["string","null"],"description":"Selected address version ID."},"entityId":{"type":["string","null"],"description":"Selected address entity ID."},"postalCode":{"type":"string","description":"Selected address postal code."},"city":{"type":"string","description":"Selected address city."},"state":{"type":"string","description":"Selected address state."},"country":{"type":"string","description":"Selected address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Selected address street."},"number":{"type":"string","description":"Selected address number."},"neighborhood":{"type":"string","description":"Selected address neighborhood."},"complement":{"type":["string","null"],"description":"Selected address complement."},"reference":{"type":["string","null"],"description":"Selected address additional information."},"geoCoordinates":{"type":"array","description":"Selected address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}}},"availableAddresses":{"type":"array","description":"Available adresses information.","items":{"type":"object","description":"Details about an available adress.","properties":{"addressType":{"type":"string","description":"Available adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Available address ID."},"versionId":{"type":["string","null"],"description":"Available address version ID."},"entityId":{"type":["string","null"],"description":"Available address entity ID."},"postalCode":{"type":"string","description":"Available address postal code."},"city":{"type":"string","description":"Available address city."},"state":{"type":"string","description":"Available address state."},"country":{"type":"string","description":"Available address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Available address street."},"number":{"type":"string","description":"Available address number."},"neighborhood":{"type":"string","description":"Available address neighborhood."},"complement":{"type":["string","null"],"description":"Available address complement."},"reference":{"type":["string","null"],"description":"Available address additional information."},"geoCoordinates":{"type":"array","description":"Available address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}}},"contactInformation":{"type":["array","null"],"description":"Order contact information.","items":{"type":"object","description":"Order contact details.","properties":{"id":{"type":"string","description":"Contact ID."},"email":{"type":"string","description":"Contact email."},"firstName":{"type":"string","description":"Contact first name."},"lastName":{"type":"string","description":"Contact last name."},"document":{"type":"string","description":"Contact document number."},"phone":{"type":"string","description":"Contact phone number."},"documentType":{"type":"string","description":"Contact document type."}}}}}},"packageAttachment":{"type":["object","null"],"description":"Information about shipping packages, which are created after order invoicing.","properties":{"packages":{"type":["array","null"],"description":"List with packages' information.","items":{"type":"object","description":"Package details.","properties":{"courier":{"type":"string","description":"Name of the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) responsible for the package shipping."},"description":{"type":["string","null"],"description":"Package description."},"invoiceNumber":{"type":"string","description":"Unique identification code of the package invoice."},"invoiceValue":{"type":"integer","description":"Package invoice value in cents."},"invoiceUrl":{"type":"string","description":"Package invoice URL."},"issuanceDate":{"type":"string","description":"Package invoice issuance date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"trackingNumber":{"type":"string","description":"Package [tracking number](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-)."},"invoiceKey":{"type":"string","description":"Package invoice key."},"trackingUrl":{"type":"string","description":"Package tracking URL."},"embeddedInvoice":{"type":"string","description":"Package invoice text in [xml format](https://help.vtex.com/en/tutorial/configuring-xml--tutorials_242). This field is important for stores integrated with [external marketplaces](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide)."},"type":{"type":"string","description":"Package invoice type, which can be:\r\n- `Output`: Selling order invoice.\r\n- `Input`: Returning items invoice.","enum":["Output","Input"]},"items":{"type":"array","description":"Information on each item in the package.","items":{"type":"object","description":"Package item details.","properties":{"itemIndex":{"type":"integer","description":"Item index of the item position whithin the `items` array. The count starts at `0`."},"id":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Package item quantity."},"price":{"type":"integer","description":"Package item price in cents."},"description":{"type":"string","description":"Package item description."},"unitMultiplier":{"type":"number","description":"Package item unit multiplier."}}}},"courierStatus":{"type":["object","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) shipping information.","properties":{"deliveredDate":{"type":"string","description":"Package delivery date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"status":{"type":["string","null"],"description":"Defines if a carrier was assigned for order shipping (`ok`) or not (`null`)."},"finished":{"type":"boolean","description":"Defines if the carrier has already delivered the package (`true`) or not (`false`)."},"data":{"type":"array","description":"Package tracking information.","items":{"type":"object","description":"Package tracking details.","properties":{"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"city":{"type":"string","description":"Package tracking city."},"state":{"type":"string","description":"Package tracking state in two-digit code format."},"description":{"type":"string","description":"Package tracking description."},"createDate":{"type":"string","description":"Package tracking creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"cfop":{"type":["string","null"],"description":"[CFOP](https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/facilitacao/anexo-ecf-cfop) (_Código Fiscal de Operação e Prestação_) is a Brazilian fiscal code of operations and services that classifies business transaction types."},"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"restitutions":{"type":["object","null"],"description":"Information about a value being returned to the customer. This field applies only to invoices with the `Input` type because it relates to returning items.","properties":{"refund":{"type":"object","description":"Customer refund details.","properties":{"value":{"type":"integer","description":"Refund value in cents."},"giftCardData":{"type":["string","null"],"description":"Refund involving a [gift card](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."},"items":{"type":["array","null"],"description":"Information about the items being returned.","items":{"type":"object","description":"Returned item details.","properties":{"useFreight":{"type":["boolean","null"],"description":"Defines if the refund includes freight values (`true`) or not (`false`)."},"isCompensation":{"type":"boolean","description":"Defines if there are compensated unit tags in the package (`true`) or not (`false`)."},"compensationValue":{"type":"integer","description":"Compensational refund value in cents."},"id":{"type":"string","description":"SKU ID of the returned item."},"quantity":{"type":"integer","description":"Number of items being returned."},"price":{"type":"integer","description":"Returned item price in cents."},"description":{"type":"string","description":"Customer reason for returning the item."}}}}}}}},"volumes":{"type":["integer","null"],"description":"Indicates the number of boxes (volumes) needed to contain the package items. For example, two refrigerators do not fit in a single volume, so this field would have value `2`."}}}}}},"marketplace":{"type":["object","null"],"description":"Information about the marketplace related to the order.","properties":{"baseURL":{"type":"string","description":"Marketplace base URL."},"isCertified":{"type":["boolean","null"],"description":"Defines if the marketplace is a [VTEX certified marketplace](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-certified-marketplaces) (`true`) or not (`false`)."},"name":{"type":"string","description":"Marketplace name."}}},"contextData":{"type":"object","description":"Information about the order context.","properties":{"loggedIn":{"type":"boolean","description":"Defines if the user was logged in the account or not (`true`) or not (`false`)."},"hasAccessToOrderFormEnabledByLicenseManager":{"type":"boolean","description":"Defines if in order placement the user had access to the order form enabled by the [License Manager](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) (`true`) or not (`false`)."},"userAgent":{"type":"string","description":"User agent name."},"userId":{"type":"string","description":"User ID."}}},"lastMessage":{"type":["string","null"],"description":"Last transactional message sent to the customer."},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"handlingData":{"type":["string","null"],"description":"Order handling information."},"documentVersion":{"type":"string","description":"Document version identification."},"appVersion":{"type":"string","description":"APP version identification."},"workflowData":{"type":"object","description":"Information about order processing and workflow.","properties":{"instances":{"type":"array","description":"Order processing details.","items":{"type":"object","description":"Order processing details for the marketplace and seller instances.","properties":{"id":{"type":"string","description":"Workflow instance ID."},"name":{"type":"string","description":"Workflow instance name, related to marketplace and fulfillment."},"currentStepName":{"type":"string","description":"Current [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"currentStepDescription":{"type":["string","null"],"description":"Current step description for the order status in the workflow."},"lastChange":{"type":"string","description":"Date of the order last change in the workflow in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isInError":{"type":"boolean","description":"Defines if the order processing in the workflow is in error (`true`) or not (`false`)."},"isInAutomaticRetry":{"type":"boolean","description":"Defines if the order is in automatic processing retry in the workflow (`true`) or not (`false`)."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"owner":{"type":["string","null"],"description":"Code that identifies the owner."},"version":{"type":["string","null"],"description":"Workflow version."},"timeLine":{"type":"array","description":"Workflow timeline steps.","items":{"type":"object","description":"Information about a given workflow timeline step.","properties":{"stepName":{"type":"string","description":"Name of the timeline step."},"date":{"type":"string","description":"Timeline step processing date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"parentStepName":{"type":"string","description":"Timeline parent step name."}}}},"logicTimeLine":{"type":"array","description":"Logical workflow timeline steps.","items":{"type":"object","description":"Information about a given logical workflow timeline step.","properties":{"stepName":{"type":"string","description":"Name of the logical timeline step."},"date":{"type":"string","description":"Logical timeline step processing date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}},"steps":{"type":"array","description":"Steps in the order processing in the workflow.","items":{"type":"object","description":"Details about a given step in the order processing.","properties":{"name":{"type":"string","description":"Order processing step name."},"next":{"type":["array","null"],"description":"Next order steps in the workflow.","items":{"type":"object","description":"Information about a given step in the workflow.","properties":{"name":{"type":"string","description":"Step status name."},"next":{"type":["string","null"],"description":"Next order status step."},"systemWillMove":{"type":"boolean","description":"Defines if the order can move to the next step (`true`) or not (`false`)."},"actionsAllowed":{"type":["object","null"],"description":"Type of actions allowed in the next steps.","properties":{"type":{"type":"string","description":"Name of the order action allowed."}}},"expectFlow":{"type":["boolean","null"],"description":"Defines if the order is progressing in the workflow as expected (`true`) or not (`false`)."}}}},"systemWillMove":{"type":"boolean","description":"Defines if the order can move to the next workflow status (`true`) or not (`false`)."},"actionsAllowed":{"type":["object","null"],"description":"Type of actions allowed for order processing in the workflow.","properties":{"type":{"type":"string","description":"Name of the order action allowed."}}},"start":{"type":"boolean","description":"Defines if the step corresponds to the order creation (`true`) or not (`false`)."}}}},"currentLogicalStep":{"type":"string","description":"Name of the order current logical step in the workflow."}}}},"mainFlowIndex":{"type":"integer","description":"Workflow processing index, starting from `0`."}}},"checkedInPickupPointId":{"type":["string","null"],"description":"When the order is created at a physical store which is configured as a pickup point, this field retrieves the pickup point ID."},"fingerPrint":{"type":"string","description":"Order finger print code."},"piiHidden":{"type":"boolean","description":"Defines if the VTEX account uses [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) (`true`) or not (`false`)."},"workflowIsInError":{"type":"boolean","description":"Indicates if the order workflow presents an error (`true`) or if there are no errors (`false`)."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator responsible for the order, when applicable."},"state":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"timeZoneCreationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"timeZoneLastChange":{"type":"string","description":"Date of the order processing last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"userType":{"type":["string","null"],"description":"User type."},"clientPreferencesData":{"type":"object","description":"Information about the customer preferences.","properties":{"locale":{"type":"string","description":"Language code of the customer preferred language while accessing the store."},"optinNewsLetter":{"type":"boolean","description":"Defines if the customer receives the store's newsletter (`true`) or not (`false`)."}}},"orderId":{"type":"string","description":"Order ID."},"workflowInstanceId":{"type":["string","null"],"description":"Workflow instance ID."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"totals":{"type":"array","description":"Information about the order totals.","items":{"type":"object","description":"Details about the order totals.","properties":{"id":{"type":"string","description":"Total ID, which defines what the total is about.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value in cents."},"alternativeTotals":{"type":["array","null"],"description":"Information about the order alternative totals, when applicable. For example, when there is a discount for items in the marketplace that results in a difference in the `Items` total value, the `alternativeTotals` can retrieve details about it.","items":{"type":"object","description":"Details about the order alternative totals.","properties":{"id":{"type":"string","description":"Alternative total ID, which can be related to items, discounts, shipping or taxes."},"name":{"type":"string","description":"Alternative total name."},"value":{"type":"integer","description":"Alternative total value in cents."}}}}}}},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v70530116str-01`, the sequence is `70530116`."},"receiptData":{"type":"object","description":"Receipts with information about transactions.","properties":{"receiptCollection":{"type":"array","description":"Collection of receipts.","items":{"type":"object","description":"Receipt with information about a given transaction.","properties":{"receiptType":{"type":"string","description":"Receipt transaction type."},"date":{"type":"string","description":"Receipt transaction date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"isCompleted":{"type":"boolean","description":"Defines if the order payment has been settled (`true`) or not (`false`)."},"openTextField":{"type":["object","null"],"description":"Optional field for additional information.","additionalProperties":{"type":"string","description":"Additional information."}},"affiliateId":{"type":["string","null"],"description":"Three-letter [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) code configured by the seller to identify a marketplace."},"value":{"type":"integer","description":"Order total value in cents."},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"followUpEmail":{"type":"string","description":"Email of the store employee responsible for managing the order."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"sellers":{"type":"array","description":"Information about the sellers associated with the order.","items":{"type":"object","description":"Information about a given seller.","properties":{"id":{"type":"string","description":"Seller identifier."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo URL."},"fulfillmentEndpoint":{"type":"string","description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace use to communicate with the seller."},"subSellerId":{"type":"string","description":"Sub seller ID. When the main account acts both as seller and marketplace, this field will return the value `1`."}}}},"marketingData":{"type":["object","null"],"description":"Information about marketing and promotions, such as coupon code and [Urchin Tracking Module (UTM)](https://help.vtex.com/en/tutorial/what-are-utm-source-utm-campaign-and-utm-medium--2wTz7QJ8KUG6skGAoAQuii).","properties":{"utmSource":{"type":["string","null"],"description":"A UTM is an Urchin Tracking Module used to track traffic related to your store. This field is an UTM for tracking the traffic source, to know from which site, advertiser, or publication the customer came before reaching your site."},"utmMedium":{"type":"string","description":"UTM for tracking the advertising or marketing media used to reach your site, such as banners and newsletters."},"utmCampaign":{"type":["string","null"],"description":"UTM for tracking the marketing campaign context."},"utmPartner":{"type":["string","null"],"description":"UTM for tracking the partner."},"utmipage":{"type":["string","null"],"description":"A `utmi` is an internal Urchin Tracking Module (UTM) used to track traffic inside your site. This field is an internal UTM for tracking pages."},"utmiPart":{"type":["string","null"],"description":"Internal UTM for tracking the partner."},"utmiCampaign":{"type":["string","null"],"description":"Internal UTM for tracking the marketing campaign context."},"coupon":{"type":["string","null"],"description":"Coupon code used by the customer."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the order.","items":{"type":"string","description":"Marketing tag name."}}}},"ratesAndBenefitsData":{"type":"object","description":"Information about promotions and taxes valid for the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List of promotions and taxes.","items":{"type":"object","description":"Information about a given promotion or tax.","properties":{"id":{"type":"string","description":"Promotion or tax ID."},"name":{"type":"string","description":"Promotion or tax name."},"featured":{"type":"boolean","description":"Defines if the [target audience](https://help.vtex.com/en/tutorial/creating-a-campaign-audience--6cnuDZJzIkIeocewAQQK4K) is featured (`true`) or not (`false`)."},"description":{"type":["string","null"],"description":"Promotion or tax description."},"matchedParameters":{"type":["object","null"],"description":"Conditions met by the purchase for the promotion or tax to be applied.","additionalProperties":{"type":"string","description":"Promotion or tax condition."}},"additionalInfo":{"type":["object","null"],"description":"Object containing additional information about the promotion or tax.","additionalProperties":{"type":"string","description":"Promotion or tax additional information."}}}}},"teaser":{"type":["array","null"],"description":"List of promotion teasers.","items":{"type":"object","description":"Information about a promotion teaser.","properties":{"name":{"type":"string","description":"Promotion teaser name."},"description":{"type":"string","description":"Promotion teaser description."}}}}}},"paymentData":{"type":"object","description":"Payments information.","properties":{"giftCards":{"type":["array","null"],"description":"[Gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"object","description":"Gift card details.","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionCode":{"type":"string","description":"Gift card code used by the customer at checkout."},"name":{"type":["string","null"],"description":"Gift card name."},"caption":{"type":["string","null"],"description":"Gift card loyalty program, when applicable."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be `0.0`."},"provider":{"type":"string","description":"Gift card provider name."},"groupName":{"type":["string","null"],"description":"Gift card group name."},"inUse":{"type":"boolean","description":"Defines if the gift card is in use (`true`) or not (`false`)."},"isSpecialCard":{"type":"boolean","description":"Defines if the gift card is a special card (`true`) or not (`false`)."}}}},"transactions":{"type":"array","description":"Information about the order financial transactions.","items":{"type":"object","description":"Information about a given transaction.","properties":{"isActive":{"type":"boolean","description":"Defines of the transaction is active (`true`) or inactive (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Payments information.","items":{"type":"object","description":"Payment details.","properties":{"bankIssuedInvoiceIdentificationNumberFormatted":{"type":["string","null"],"description":"Bank issued invoice numeric sequence formatted as customers see."},"bankIssuedInvoiceIdentificationNumber":{"type":["string","null"],"description":"Bank issued invoice numeric sequence."},"parentAccountId":{"type":["string","null"],"description":"When the payment was made in a subaccount, this field retrieves the main account ID."},"accountId":{"type":"string","description":"Identification code of the account where the payment was made."},"dueDate":{"type":["string","null"],"description":"Payment due date in `MM/YY` format."},"group":{"type":"string","description":"Transaction payment method, which can be credit card, debid card, bank invoice, promissory, gift card or pix (`instantPayment`).","enum":["creditCard","debitCard","bankInvoice","promissory","giftCard","instantPayment"]},"isGiftCardDiscount":{"type":["boolean","null"],"description":"Defines if the payment has a gift card discount (`true`) or not (`false`)."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider ID."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"redemptionCode":{"type":["string","null"],"description":"Gift card code used by the customer at checkout."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"koinUrl":{"type":["string","null"],"description":"Koin connector URL."},"url":{"type":["string","null"],"description":"Payment URL."},"expireYear":{"type":["string","null"],"description":"Card expiration year in 4-digit format."},"expireMonth":{"type":["string","null"],"description":"Card expiration month in 2-digit format."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"lastDigits":{"type":["string","null"],"description":"Card last four digits."},"firstDigits":{"type":["string","null"],"description":"Card first four digits."},"cardNumber":{"type":["string","null"],"description":"Card number."},"cardHolder":{"type":["string","null"],"description":"Name of the card owner."},"referenceValue":{"type":"integer","description":"Total payment reference value in cents."},"connectorResponses":{"type":"object","description":"Payment provider (connector) responses. The fields within this object can vary according to the order payment provider.","properties":{"Message":{"type":"string","description":"Provider operational message or error to be logged."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"authorizationId":{"type":"string","description":"Provider authorization ID."},"status":{"type":"string","description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."},"delayToAutoSettle":{"type":"integer","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`, regardless if the payment was approved by the merchant's anti-fraud provider. The maximum value allowed is `604800` seconds (7 days)."},"ReturnCode":{"type":["string","null"],"description":"Provider operational return code or error to be logged."},"nsu":{"type":"string","description":"Provider unique sequential number for the transaction."},"code":{"type":"string","description":"Provider operational code or error to be logged."},"message":{"type":"string","description":"Provider operational message or error to be logged."},"Tid":{"type":"string","description":"Provider unique identifier for the transaction."},"acquirer":{"type":"string","description":"[Acquirer](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/kdPbEIWf8Xq8tESQvViMB#acquirer) name (mostly used for card payments)."},"authId":{"type":"string","description":"Authorization identification."},"paymentId":{"type":"string","description":"Payment ID."},"delayToAutoSettleAfterAntifraud":{"type":"string","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`. This happens only after the payment was approved by the merchant's anti-fraud provider."}}},"installments":{"type":"integer","description":"Number of payment installments."},"value":{"type":"integer","description":"Order total payment value in cents."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystem":{"type":"string","description":"Payment system ID."},"paymentOrigin":{"type":["string","null"],"description":"Type of [wallet](https://help.vtex.com/en/tutorial/what-is-an-e-wallet--4v5wcOe4A0SiaimWM2cU60) used in the payment."},"id":{"type":"string","description":"Payment unique identifier."},"bankIssuedInvoiceBarCodeNumber":{"type":["string","null"],"description":"Bank issued invoice bar code number."},"bankIssuedInvoiceBarCodeType":{"type":["string","null"],"description":"Bank issued invoice bar code type."},"billingAddress":{"type":["object","null"],"description":"Billing address information.","properties":{"addressType":{"type":"string","description":"Billing address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Billing address ID."},"versionId":{"type":["string","null"],"description":"Billing address version ID."},"entityId":{"type":["string","null"],"description":"Billing address entity ID."},"postalCode":{"type":"string","description":"Billing address postal code."},"city":{"type":"string","description":"Billing address city."},"state":{"type":"string","description":"Billing address state."},"country":{"type":"string","description":"Billing address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Billing address street."},"number":{"type":"string","description":"Billing address number."},"neighborhood":{"type":"string","description":"Billing address neighborhood."},"complement":{"type":["string","null"],"description":"Billing address complement."},"reference":{"type":["string","null"],"description":"Billing address additional information."},"geoCoordinates":{"type":"array","description":"Billing address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Billing contact unique identifier."}}}}}},"sharedTransaction":{"type":"boolean","description":"Defines if the transaction is shared (`true`) or not (`false`)."},"status":{"type":["string","null"],"description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."}}}}}},"invoiceData":{"type":["object","null"],"description":"Order invoices information.","properties":{"address":{"type":["object","null"],"description":"Invoice address information.","properties":{"addressType":{"type":["string","null"],"description":"Invoice address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":["string","null"],"description":"Full name of the order receiver."},"addressId":{"type":["string","null"],"description":"Invoice address ID."},"versionId":{"type":["string","null"],"description":"Invoice address version ID."},"entityId":{"type":["string","null"],"description":"Invoice address entity ID."},"postalCode":{"type":"string","description":"Invoice address postal code."},"city":{"type":"string","description":"Invoice address city."},"state":{"type":"string","description":"Invoice address state."},"country":{"type":"string","description":"Invoice address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Invoice address street."},"number":{"type":"string","description":"Invoice address number."},"neighborhood":{"type":"string","description":"Invoice address neighborhood."},"complement":{"type":["string","null"],"description":"Invoice address complement."},"reference":{"type":["string","null"],"description":"Invoice address additional information."},"geoCoordinates":{"type":"array","description":"Invoice address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"userPaymentInfo":{"type":["object","null"],"description":"Invoice information regarding payment method.","properties":{"paymentMethods":{"type":"array","description":"List of the payment methods used by the customer in the purchase.","items":{"type":"string","description":"Payment method name."}}}},"settleInvoices":{"type":["array","null"],"description":"List with the order settled invoices.","items":{"type":"string","description":"Settled invoice numeric identifier."}},"invoiceSubject":{"type":["object","null"],"description":"Information about the invoice subject.","properties":{"id":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject email address."},"firstName":{"type":"string","description":"Invoice subject first name."},"lastName":{"type":"string","description":"Invoice subject last name."},"phone":{"type":"string","description":"Invoice subject phone number."}}}}},"storePreferencesData":{"type":"object","description":"Store preferences in the [Account settings](https://help.vtex.com/en/tutorial/account-details-page--2vhUVOKfCaswqLguT2F9xq).","properties":{"countryCode":{"type":"string","description":"Country code in three-digit [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":"object","description":"Currency format settings.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Number of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Character for currency decimal separation."},"CurrencyGroupSeparator":{"type":"string","description":"Character for currency group separation."},"CurrencyGroupSize":{"type":"integer","description":"Limit of characters that can be grouped for currency groups."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if the prices displayed for customers start with the currency symbol (`true`) or not (`false`)."}}},"currencyLocale":{"type":"integer","description":"Currency locale code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":"string","description":"Currency symbol characters."},"timeZone":{"type":"string","description":"Time zone considered for the store orders."}}},"merchantName":{"type":["string","null"],"description":"Merchant name."},"itemMetadata":{"type":"object","description":"Metadata information about items.","properties":{"items":{"type":"array","description":"Metadata details about items.","items":{"type":"object","description":"Metadata details about a given item","properties":{"id":{"type":"string","description":"SKU ID."},"seller":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Item name as displayed to customers in the storefront."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"SKU reference ID."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"imageUrl":{"type":"string","description":"SKU image URL."},"detailUrl":{"type":"string","description":"SKU slug."},"assemblyOptions":{"type":["array","null"],"description":"[Assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) information related to the item, when applicable.","items":{"type":"object","description":"[Assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) details.","properties":{"id":{"type":"string","description":"Assembly option ID."},"name":{"type":"string","description":"Assembly option name."},"required":{"type":"boolean","description":"Defines if sending the attachment for the item purchased is required(`true`) or optional (`false`)."},"inputValues":{"type":["object","null"],"description":"Assembly option content.","additionalProperties":{"type":["string","null"],"description":"Assembly option value."}},"composition":{"type":["object","null"],"description":"Assembly option composition.","additionalProperties":{"type":"string","description":"Assembly option composition value."}}}}}}}}}},"creationEnvironment":{"type":["string","null"],"description":"Order creation environment, which can be a [development workspace](https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-development-workspace) (`BETA`) or a [production workspace](https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-production-workspace) (`STABLE`).","enum":["BETA","STABLE"]},"cancellationData":{"type":["object","null"],"description":"Information about [order cancellation](https://developers.vtex.com/docs/guides/order-canceling-improvements), when applicable.","properties":{"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"requestedBySystem":{"type":["boolean","null"],"description":"Defines if the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example."},"requestedBySellerNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the seller (`true`) or not (`false`)."},"requestedByPaymentNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the payment gateway (`true`) or not (`false`)."},"reason":{"type":"string","description":"Reason why the order was canceled."},"cancellationDate":{"type":"string","description":"Order cancellation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cancellationRequestId":{"type":"string","description":"ID that identifies the cancellation operation."}}},"cancellationRequests":{"type":["array","null"],"description":"Information about the [seller order cancellation denials](https://developers.vtex.com/docs/guides/order-canceling-improvements), regardless if the cancellation request was made by the marketplace or the customer.","items":{"type":"object","description":"Information about the seller denial to a given order cancellation request.","properties":{"id":{"type":"string","description":"ID that identifies the original cancellation operation made by the marketplaces or its customer care service using the [Cancel order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/cancel) endpoint."},"reason":{"type":"string","description":"Reason why there was a request to cancel the order."},"cancellationRequestDate":{"type":"string","description":"Date of when the order cancellation request was processed by the platform. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"deniedBySeller":{"type":"boolean","description":"Defines if the order cancellation request was [denied by the seller](https://developers.vtex.com/docs/guides/order-canceling-improvements) (`true`) or accepted by the seller (`false`)."},"deniedBySellerReason":{"type":["string","null"],"description":"Reason given by the seller for denying the order cancellation."},"cancellationRequestDenyDate":{"type":["string","null"],"description":"Date of when the platform processed the seller denial to an order cancellation request. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves order details by searching by order ID. + + If you wish to retrieve unmasked data, use the `reason` query parameter. + + >⚠️ Throttling: Each VTEX account can make up to 6000 requests per minute. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + > Check the [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `reason` | query | Reason for requesting unmasked data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 29 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Orders/List orders.yml b/BrunoCollections/VTEX - Orders API (PII version)/Orders/List orders.yml new file mode 100644 index 0000000000..ddbbde866c --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Orders/List orders.yml @@ -0,0 +1,129 @@ +info: + name: List orders + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/orders/extendsearch/orders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "f_status": "ready-for-handling", + "f_creationDate": "creationDate:[2024-07-01T00:00:00.000Z TO 2024-08-01T00:00:00.000Z]", + "incompleteOrders": true, + "filterError": "all", + "per_page": 30, + "page": 1, + "orderBy": "creationDate,asc", + "q": "customer@email.com", + "sku_Ids": "6178691,6099191", + "listId": "3098", + "f_authorizedDate": "authorizedDate:[2024-01-01T00:00:00.000Z TO 2024-03-01T00:00:00.000Z]", + "f_paymentNames": "Visa", + "paymentId": "CE7751558D574E3093989B5BB5248A5D", + "pci_tid": "Z424WMJ37ZN9SKF4", + "nsu": "027946189", + "f_hasInputInvoice": true, + "f_hasOutputInvoice": true, + "f_invoicedDate": "invoicedDate:[2024-01-01T00:00:00.000Z TO 2024-03-01T00:00:00.000Z]", + "f_shippingEstimate": "4.days", + "f_sellerNames": "Fashion SellerName", + "f_affiliateId": "CBS", + "f_callCenterOperatorName": "Operator%20Name", + "f_isInstore": true, + "f_RnB": "Free+Shipping", + "salesChannelId": "2", + "f_salesChannel": "Main" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/extendsearch/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/extendsearch/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/extendsearch/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/extendsearch/orders - Schema is valid", function () { + const schema = {"type":"object","properties":{"list":{"type":"array","description":"List with orders' information.","items":{"type":"object","description":"Information about an order.","properties":{"paymentNames":{"type":"string","description":"Payment system name."},"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v71041992str-01`, the sequence is `71041992`."},"clientEmail":{"description":"Customer email.","type":"string"},"clientDocument":{"type":"string","description":"Customer document number."},"clientCorporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"clientCorporateName":{"type":["string","null"],"description":"Corporate name, if the customer is a legal entity."},"clientName":{"type":"string","description":"Customer name."},"totalValue":{"type":"integer","description":"Order total value in cents."},"origin":{"type":"string","description":"Order's origin in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196).","enum":["Marketplace","Fulfillment","Chain"]},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"sellerNames":{"type":"array","description":"Names of the sellers responsible for order fuflillment.","items":{"type":"string","description":"Seller name."}},"sellerIds":{"type":"array","description":"IDs of the sellers responsible for order fuflillment.","items":{"type":"string","description":"Seller ID."}},"sellerOrderId":{"type":"string","description":"Seller order ID."},"totalItems":{"type":"integer","description":"Order total quantity of items."},"pciTransactionId":{"type":"array","description":"List with the PCI transaction ID.","items":{"type":"string","description":"PCI transaction ID."}},"paymentNSU":{"type":"array","description":"Unique sequence number that identifies a sales transaction using cards.","items":{"type":"string","description":"NSU sequence number."}},"ratesAndBenefitsNames":{"type":"array","description":"List of the promotions and taxes names valid for the purchase.","items":{"type":"string","description":"Promotion or tax name."}},"ratesAndBenefitsIds":{"type":"array","description":"List of the promotions and taxes IDs valid for the purchase.","items":{"type":"string","description":"Promotion or tax ID."}},"shippingEstimatedDateMax":{"type":"string","description":"Maximum shipping estimated date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"shippingEstimatedDateMin":{"type":"string","description":"Minimum shipping estimated date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"transactionIds":{"type":"array","description":"Array with payment transaction IDs information.","items":{"type":"string","description":"Payment transaction ID."}},"paymentIds":{"type":"array","description":"Array with payment IDs information.","items":{"type":"string","description":"Payment unique identifier."}},"isInstore":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"deliveryChannel":{"type":"array","description":"List of delivery channels, which can be delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","items":{"type":"string","description":"Delivery channel.","enum":["delivery","pickup-in-point"]}},"productIds":{"type":"array","description":"List of product IDs related to the orders items.","items":{"type":"string","description":"Product ID."}},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"invoicedDate":{"type":["string","null"],"description":"Order invoice date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"authorizedDate":{"type":"string","description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderIsComplete":{"type":"boolean","description":"Defines if the order is complete (`true`) or [incomplete](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294) (`false`)."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the order.","items":{"type":"string","description":"Marketing tag name."}},"invoicesOutput":{"type":["array","null"],"description":"Information about order invoice `Output` operation, when the store sells an item to the customer.","items":{"type":["string","null"],"description":"The `Output` invoice number."}},"invoicesInput":{"type":["array","null"],"description":"Information about order invoice `Input` operation, when the customer returnes an item to the store.","items":{"type":["string","null"],"description":"The `Input` invoice number."}},"workflowInErrorState":{"type":"boolean","description":"Defines if the order processing in the workflow is in error (`true`) or not (`false`)."},"workflowInRetry":{"type":"boolean","description":"Defines if the order is in automatic processing retry in the workflow (`true`) or not (`false`)."},"userProfileId":{"type":"string","description":"User profile ID."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isAllDelivered":{"type":"boolean","description":"Defines if all order items have being delivered (`true`) or not (`false`)."},"isAnyDelivered":{"type":"boolean","description":"Defines if any order item has being delivered (`true`) or not (`false`)."},"giftCardProviders":{"type":["array","null"],"description":"Order [gift card](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"string","description":"Gift card name."}},"orderFormId":{"type":"string","description":"ID of the shopping cart from which the order was created."},"paymentApprovedDate":{"type":"string","description":"Payment approval date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"readyForHandlingDate":{"type":["string","null"],"description":"Order ready for handling date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"deliveryDates":{"type":["array","null"],"description":"Array with delivery date information.","items":{"type":"string","description":"Order delivey date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}},"ingestPipelineMetadata":{"type":"array","description":"Array with order processing metadata.","items":{"type":"string","description":"Metadata information."}},"marketplaceWorkflowInstanceId":{"type":["string","null"],"description":"Marketplace workflow instance ID."},"fulfillmentWorkflowInstanceId":{"type":["string","null"],"description":"Seller workflow instance ID."},"callCenterOperatorEmail":{"type":["string","null"],"description":"Email of the call center operator responsible for the order, when applicable."},"callCenterOperatorName":{"type":["string","null"],"description":"Name of the call center operator responsible for the order, when applicable."},"productNames":{"type":"array","description":"List of the order product names.","items":{"type":"string","description":"Product name."}}}}},"facets":{"type":["array","null"],"description":"Array of facets.","items":{"type":["string","null"],"description":"Facets details."}},"paging":{"type":"object","description":"Pagination information.","required":["total","pages","currentPage","perPage"],"properties":{"total":{"type":"integer","description":"Total number of objects that exist for the `list` field, each corresponding to an order."},"pages":{"type":"integer","description":"Total number of pages."},"currentPage":{"type":"integer","description":"Number of the current page."},"perPage":{"type":"integer","description":"Number of objects per page that can be returned for the `list` field. The default value is `15` and the maximum value is `100`."}}},"stats":{"type":["object","null"],"description":"Information about stats.","required":["stats"],"properties":{"stats":{"type":"object","description":"Stats object.","required":["totalValue","totalItems"],"properties":{"totalValue":{"type":"object","description":"Stats total value.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count."},"Max":{"type":"integer","description":"Maximum value."},"Mean":{"type":"number","description":"Value mean."},"Min":{"type":"integer","description":"Minimum value."},"Missing":{"type":"integer","description":"Missing values."},"StdDev":{"type":"number","description":"Standard deviation."},"Sum":{"type":"integer","description":"Sum of values."},"SumOfSquares":{"type":"integer","format":"int64","description":"Value sum of squares."},"Facets":{"type":"object","description":"Facets related to total values.","required":["origin","currencyCode"],"properties":{"origin":{"type":"object","description":"Value facets origin.","required":["Fulfillment","Marketplace"],"properties":{"Fulfillment":{"type":"object","description":"Seller (fulfillment) facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to fulfillment."},"Max":{"type":"integer","description":"Maximum value related to fulfillment."},"Mean":{"type":"number","description":"Value mean related to fulfillment."},"Min":{"type":"integer","description":"Minimum related to fulfillment."},"Missing":{"type":"integer","description":"Missing values related to fulfillment."},"StdDev":{"type":"number","description":"Standard deviation related to fulfillment."},"Sum":{"type":"integer","description":"Value sum related to fulfillment."},"SumOfSquares":{"type":"integer","description":"Sum of squares related to fulfillment."},"Facets":{"type":["string","null"],"description":"Facets related to fulfillment."}}},"Marketplace":{"type":"object","description":"Marketplace facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to the marketplace."},"Max":{"type":"integer","description":"Maximum value related to the marketplace."},"Mean":{"type":"number","description":"Value mean related to the marketplace."},"Min":{"type":"integer","description":"Minimum value related to the marketplace."},"Missing":{"type":"integer","description":"Missing values related to the marketplace."},"StdDev":{"type":"number","description":"Standard deviation related to the marketplace."},"Sum":{"type":"integer","description":"Values sum related to the marketplace."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the marketplace."},"Facets":{"type":["string","null"],"description":"Facets related to the marketplace."}}}}},"currencyCode":{"type":"object","description":"Total value currency code in [ISO 4217](https://www.iban.com/currency-codes) format.","required":["BRL"],"properties":{"BRL":{"type":"object","description":"Currency code facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to the currency code."},"Max":{"type":"integer","description":"Maximum value related to the currency code."},"Mean":{"type":"number","description":"Value mean related to the currency code."},"Min":{"type":"integer","description":"Minimum value related to the currency code."},"Missing":{"type":"integer","description":"Missing values related to the currency code."},"StdDev":{"type":"number","description":"Standard deviation related to the currency code."},"Sum":{"type":"integer","description":"Sum of values related to the currency code."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the currency code."},"Facets":{"type":["string","null"],"description":"Facets related to the currency code."}}}}}}}}},"totalItems":{"type":"object","description":"Stats total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count."},"Max":{"type":"integer","description":"Maximum items."},"Mean":{"type":"number","description":"Total items mean."},"Min":{"type":"integer","description":"Minimum items."},"Missing":{"type":"integer","description":"Missing items."},"StdDev":{"type":"number","description":"Standard deviation."},"Sum":{"type":"integer","description":"Sum of items."},"SumOfSquares":{"type":"integer","format":"int64","description":"Items sum of squares."},"Facets":{"type":["object","null"],"description":"Facets related to total items.","required":["origin","currencyCode"],"properties":{"origin":{"type":"object","description":"Items facets origin.","required":["Fulfillment","Marketplace"],"properties":{"Fulfillment":{"type":"object","description":"Seller (fulfillment) facets information related to total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to fulfillment."},"Max":{"type":"integer","description":"Maximum of items related to fulfillment."},"Mean":{"type":"number","description":"Items mean related to fulfillment."},"Min":{"type":"integer","description":"Minimum of items related to fulfillment."},"Missing":{"type":"integer","description":"Missing items related to fulfillment."},"StdDev":{"type":"number","description":"Standard deviation related to fulfillment."},"Sum":{"type":"integer","description":"Sum of items related to fulfillment."},"SumOfSquares":{"type":"integer","description":"Items sum of squares related to fulfillment."},"Facets":{"type":["string","null"],"description":"Facets related to fulfillment."}}},"Marketplace":{"type":"object","description":"Marketplace facets information related to total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to the marketplace."},"Max":{"type":"integer","description":"Maximum of items related to the marketplace."},"Mean":{"type":"number","description":"Items mean related to the marketplace."},"Min":{"type":"integer","description":"Minimum of items related to the marketplace."},"Missing":{"type":"integer","description":"Missing items related to the marketplace."},"StdDev":{"type":"number","description":"Standard deviation related to the marketplace."},"Sum":{"type":"integer","description":"Sum of items related to the marketplace."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the marketplace."},"Facets":{"type":["string","null"],"description":"Facets related to the marketplace."}}}}},"currencyCode":{"type":"object","description":"Total items currency code in [ISO 4217](https://www.iban.com/currency-codes) format.","required":["BRL"],"properties":{"BRL":{"type":"object","description":"Currency code facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to the currency code."},"Max":{"type":"integer","description":"Maximum of items related to the currency code."},"Mean":{"type":"number","description":"Items mean related to the currency code."},"Min":{"type":"integer","description":"Minimum of items related to the currency code."},"Missing":{"type":"integer","description":"Missing items related to the currency code."},"StdDev":{"type":"number","description":"Standard deviation related to the currency code."},"Sum":{"type":"integer","description":"Sum of items related to the currency code."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the currency code."},"Facets":{"type":["string","null"],"description":"Facets related to the currency code."}}}}}}}}}}}}},"reportRecordsLimit":{"type":"integer","description":"Records limit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of orders according to the query parameters used. The response returns masked order data. + + >⚠️ Throttling: Each account can make up to 6000 requests per minute. + + ## Endpoint not meant for integrations + This request only retrieves orders that have been indexed, which takes aproximately four minutes. The information returned also may present inconsistencies or become unavailable in periods of peak order volume. + + Therefore, you must not use the List orders endpoint for integrations. + + >⚠️ To get up to date information and [build order integrations](https://developers.vtex.com/vtex-rest-api/docs/erp-integration-set-up-order-integration) use the [orders Feed or Hook](https://developers.vtex.com/vtex-rest-api/docs/feed-v3-1). + + > Check the [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **List Orders** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | List Orders | + | Checkout Admin | List Orders | + | IntegrationProfile - Fulfillment Oms | List Orders | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Orders/Start handling order.yml b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Start handling order.yml new file mode 100644 index 0000000000..f3b23f6b7c --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Orders/Start handling order.yml @@ -0,0 +1,69 @@ +info: + name: Start handling order + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/actions/start-handling" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/pvt/document/:orderId/actions/start-handling - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/actions/start-handling - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow to the `handling` status. + + >ℹ️ Successful requests receive a `204` status code with no content. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Change order workflow status** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Change order workflow status | + | IntegrationProfile - Fulfillment Gateway Oms | Change order workflow status | + | IntegrationProfile - Fulfillment Oms | Change order workflow status | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Orders/folder.yml b/BrunoCollections/VTEX - Orders API (PII version)/Orders/folder.yml new file mode 100644 index 0000000000..0591326f3b --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: Orders + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Payment/Send payment notification.yml b/BrunoCollections/VTEX - Orders API (PII version)/Payment/Send payment notification.yml new file mode 100644 index 0000000000..d68c8d1d87 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Payment/Send payment notification.yml @@ -0,0 +1,69 @@ +info: + name: Send payment notification + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/payment/:paymentId/notify-payment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + - name: paymentId + value: B075A551595A43B0AD48DCD8EB481C7F + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/pvt/document/:orderId/payment/:paymentId/notify-payment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends the payment notification of an order by searching by order ID and payment ID. + + > For more information about transaction details, check the article [Viewing the order's details in Orders](https://help.vtex.com/en/tutorial/viewing-the-orders-details-in-orders--tutorials_452). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify payment** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify payment | + | IntegrationProfile - Fulfillment Gateway | Notify payment | + | IntegrationProfile - Fulfillment Gateway Oms | Notify payment | + | IntegrationProfile - Fulfillment Oms | Notify payment | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `paymentId` | path | (Required) Payment ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API (PII version)/Payment/folder.yml b/BrunoCollections/VTEX - Orders API (PII version)/Payment/folder.yml new file mode 100644 index 0000000000..f33d1bf99d --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/Payment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Orders API (PII version)/environments/VTEX.yml b/BrunoCollections/VTEX - Orders API (PII version)/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Orders API (PII version)/opencollection.yml b/BrunoCollections/VTEX - Orders API (PII version)/opencollection.yml new file mode 100644 index 0000000000..ed1c634451 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API (PII version)/opencollection.yml @@ -0,0 +1,43 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Orders API (PII version) + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + VTEX stores using the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus) must use this adapted version of the Orders API. Learn more about the modified behavior at [Changes in VTEX features behavior to handle PII data](https://developers.vtex.com/docs/guides/changes-in-vtex-features-behavior-to-handle-pii-data). + + >⚠️ The **Orders API - PII data architecture** is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in selected regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Index + + ### Orders + + - `GET` [Get order](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#get-/api/orders/pvt/document/-orderId-) + - `POST` [List orders](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/extendsearch/orders) + - `POST` [Start handling order](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/actions/start-handling) + - `POST` [Cancel order](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/cancel) + + ### Invoice + + - `POST` [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/invoices) + + ### Payment + + - `POST` [Send payment notification](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/payment/-paymentId-/notify-payment) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Orders API PII version/Invoice/Order invoice notification.yml b/BrunoCollections/VTEX - Orders API PII version/Invoice/Order invoice notification.yml new file mode 100644 index 0000000000..3a2873ad56 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Invoice/Order invoice notification.yml @@ -0,0 +1,129 @@ +info: + name: Order invoice notification + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/invoices" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + body: + type: json + data: |- + { + "type": "Output", + "issuedDate": "2024-09-20", + "invoiceNumber": "000059579", + "invoiceValue": 2499, + "items": [ + { + "itemIndex": 0, + "price": 2499, + "quantity": 3 + }, + { + "itemIndex": 0, + "price": 2499, + "quantity": 3 + } + ], + "extraValue": 100, + "invoiceKey": "33240945242914001845550010004817221546274961", + "invoiceUrl": "https://ecommerce.str.com/logged/nf/v71021948str-01", + "courier": "OSAPLAG_EXPRESS", + "trackingNumber": "71021938", + "trackingUrl": "https://tracking.agj.com/order/v71021948str-01/status", + "cfop": "5100", + "volumes": 3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/pvt/document/:orderId/invoices - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Date and time when the order invoice notification was received in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID in the seller environment."},"receipt":{"type":["string","null"],"description":"Protocol code generated by the request."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Endpoint used by the seller after order invoicing to send the invoice information to the marketplace. + + Once the seller has the order tracking information, it is also possible to use this endpoint to send order tracking information to the marketplace. + + >⚠️ To avoid price rounding errors, we strongly recommend sending the object with the invoiced items in the request body. + + >❗ It is not allowed to use the same `invoiceNumber` in more than one request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify invoice | + | IntegrationProfile - Fulfillment Gateway Oms | Notify invoice | + | IntegrationProfile - Fulfillment Oms | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "date": "2024-09-25T18:03:19.7055982Z", + "orderId": "v71021948str-01", + "receipt": "38e0e47da2934847b489216d208cfd91" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API PII version/Invoice/folder.yml b/BrunoCollections/VTEX - Orders API PII version/Invoice/folder.yml new file mode 100644 index 0000000000..bcd813cd46 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Invoice/folder.yml @@ -0,0 +1,4 @@ +info: + name: Invoice + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Orders API PII version/Orders/Cancel order.yml b/BrunoCollections/VTEX - Orders API PII version/Orders/Cancel order.yml new file mode 100644 index 0000000000..1927618070 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Orders/Cancel order.yml @@ -0,0 +1,106 @@ +info: + name: Cancel order + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/cancel" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + body: + type: json + data: |- + { + "reason": "Unexpected stock shortage" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/pvt/document/:orderId/cancel - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Cancellation request date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID in the seller environment."},"receipt":{"type":["string","null"],"description":"Protocol code generated by the cancellation request."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Requests order cancelation by searching by order ID. + + It is possible for the seller to [decline an order cancelation request](https://help.vtex.com/en/tutorial/declining-order-cancelation--F2n0h1TeQ5td540Gjyff4), know more in [Order canceling improvements](https://developers.vtex.com/docs/guides/order-canceling-improvements). + + >⚠️ You can only cancel an order in the `invoiced` [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) if you send a return invoice first, using the [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api-pii-version#post-/api/orders/pvt/document/-orderId-/invoices) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Cancel order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Cancel order | + | Sales App - Sales Associate | Cancel order | + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms | Cancel order | + | IntegrationProfile - Fulfillment Oms | Cancel order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "orderId": "1417440051885-01", + "receipt": "38e0e47da2934847b489216d208cfd91", + "date": "2024-09-26T00:00:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API PII version/Orders/Get order.yml b/BrunoCollections/VTEX - Orders API PII version/Orders/Get order.yml new file mode 100644 index 0000000000..bb4a8e0539 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Orders/Get order.yml @@ -0,0 +1,105 @@ +info: + name: Get order + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/orders/pvt/document/:orderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + disabled: true + - name: orderId + value: v71021948str-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/orders/pvt/document/:orderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/orders/pvt/document/:orderId - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Order ID."},"sellerOrderId":{"type":"string","description":"Seller order ID."},"orderFormId":{"type":"string","description":"ID of the shopping cart from which the order was created."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196).","enum":["Marketplace","Fulfillment","Chain"]},"orderGroup":{"type":"string","description":"Order group ID."},"items":{"type":"array","description":"Information on order items.","items":{"type":"object","description":"Information on each order item.","properties":{"productCategories":{"type":"object","description":"Object containing product categories with the structure: `{CategoryID}: {CategoryName}`.","properties":{"additionalProperties":{"type":"string","description":"Product category corresponding to the ID in the field key."}}},"uniqueId":{"type":"string","description":"Order item unique ID."},"id":{"type":"string","description":"Item ID."},"productId":{"type":"string","description":"Product ID."},"lockId":{"type":["string","null"],"description":"[Reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) ID."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"quantity":{"type":"integer","description":"Item quantity."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"sellerSku":{"type":"string","description":"Seller SKU ID."},"priceValidUntil":{"type":"string","description":"Item price expiration date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"name":{"type":"string","description":"SKU name."},"additionalInfo":{"type":"object","description":"Item additional information.","properties":{"brandName":{"type":"string","description":"Item brand name."},"brandId":{"type":"string","description":"Item brand ID."},"categoriesIds":{"type":"string","description":"Categories IDs."},"dimension":{"type":"object","description":"Item dimensions.","properties":{"cubicweight":{"type":"number","description":"Item cubic weight."},"height":{"type":"number","description":"Item height."},"length":{"type":"number","description":"Item length."},"weight":{"type":"number","description":"Item weight."},"width":{"type":"number","description":"Item width."}}},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial condition ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categories":{"type":"array","description":"Item [categories](https://help.vtex.com/tracks/catalog-101--5AF0XfnjfWeopIFBgs3LIQ/2gkZDjXRqfsq62TlAkj4uf) information.","items":{"type":"object","description":"Information about a given category.","properties":{"id":{"type":"integer","description":"Category ID."},"name":{"type":"string","description":"Category name."}}}}}},"attachments":{"type":["array","null"],"description":"Information on [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"attachmentOfferings":{"type":["array","null"],"description":"Array containing attachments details.","items":{"type":["object","null"],"description":"Attachment details.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Schema of the content declared in the field `attachmentOfferings`."}}}},"assemblies":{"type":["array","null"],"description":"Information about the item customization, when applicable.","items":{"type":["string","null"],"description":"Customization information."}},"refId":{"type":"string","description":"Ref ID."},"shippingPrice":{"type":["integer","null"],"description":"Item shipping price in cents. This value does not account for the order total shipping price."},"price":{"type":"integer","description":"Item price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents. This field can present rounding discrepancies, so we recommend retrieving pricing information from the `priceDefinition` field."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) in cents."},"tax":{"type":"integer","description":"Tax value in cents."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"freightCommission":{"type":"integer","description":"Freight commission value in cents."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"priceTags":{"type":"array","description":"Information about price tags. A price tag is a price modifier, like s discount or a promotion applicable to the item in the order context.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":"string","description":"Price tag name."},"rawValue":{"type":"number","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"identifier":{"type":"string","description":"Price tag identifier."},"rate":{"type":["integer","null"],"description":"Price tag value."},"jurisCode":{"type":["string","null"],"description":"Juris code."},"jurisType":{"type":["string","null"],"description":"Juris type."},"jurisName":{"type":["string","null"],"description":"Juris name."}}}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"components":{"type":["array","null"],"description":"Item components.","items":{"type":["string","null"],"description":"Component name."}},"bundleItems":{"type":["array","null"],"description":"Information about services sold with the item. For example, a gift package.","items":{"type":"object","description":"Information about a given service.","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service ID."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"offerings":{"type":["array","null"],"description":"Information about offerings, which are services related to the item. For example, a warranty or installation.","items":{"type":["string","null"],"description":"Name of the service related to the item. For example, warranty or installation."}},"preSaleDate":{"type":["string","null"],"description":"Presale date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`) or not (`false`)."},"taxCode":{"type":["string","null"],"description":" Item tax code."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"marketingData":{"type":["object","null"],"description":"Information about marketing and promotions, such as coupon code and [Urchin Tracking Module (UTM)](https://help.vtex.com/en/tutorial/what-are-utm-source-utm-campaign-and-utm-medium--2wTz7QJ8KUG6skGAoAQuii).","properties":{"utmSource":{"type":["string","null"],"description":"A UTM is an Urchin Tracking Module used to track traffic related to your store. This field is an UTM for tracking the traffic source, to know from which site, advertiser, or publication the customer came before reaching your site."},"utmMedium":{"type":"string","description":"UTM for tracking the advertising or marketing media used to reach your site, such as banners and newsletters."},"utmCampaign":{"type":["string","null"],"description":"UTM for tracking the marketing campaign context."},"utmPartner":{"type":["string","null"],"description":"UTM for tracking the partner."},"utmipage":{"type":["string","null"],"description":"A `utmi` is an internal Urchin Tracking Module (UTM) used to track traffic inside your site. This field is an internal UTM for tracking pages."},"utmiPart":{"type":["string","null"],"description":"Internal UTM for tracking the partner."},"utmiCampaign":{"type":["string","null"],"description":"Internal UTM for tracking the marketing campaign context."},"coupon":{"type":["string","null"],"description":"Coupon code used by the customer."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the item.","items":{"type":"string","description":"Marketing tag name."}}}},"parentAssemblyBinding":{"type":["string","null"],"description":"When items are indexed in between each other, this field returns the assembly option ID. This response is `null` for items that are not [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)."},"parentItemIndex":{"type":["integer","null"],"description":"Ranking number that shows how related items are indexed in between each other. It starts at `0` as the primary item reference and counts up to `1`, `2`, and so on. For example, a customer bought sunglasses and hired a warranty service. Since the sunglasses are index `0`, the warranty service (the [assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)) is index `1` and has the `parentItemIndex` value `0`. This response is `null` for items that are not assembly options."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator that sold the item, when applicable."},"priceDefinition":{"type":"object","description":"Item price information.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item calculated selling price in cents."},"total":{"type":"integer","description":"Item total price in cents."},"sellingPrices":{"type":"array","description":"Item selling prices.","items":{"type":"object","description":"Price value per quantity.","properties":{"value":{"type":"integer","description":"Item selling price value in cents."},"quantity":{"type":"integer","description":"Item quantity."}}}},"reason":{"type":["string","null"],"description":"Item price definition reason."}}},"costPrice":{"type":["integer","null"],"description":"Item cost price in cents."}}}},"marketplaceItems":{"type":["array","null"],"description":"Marketplace items.","items":{"type":["string","null"],"description":"Marketplace item."}},"authorizedDate":{"type":"string","description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"subscriptionData":{"type":["object","null"],"description":"Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453), when applicable.","properties":{"subscriptionGroupId":{"type":["string","null"],"description":"Subscription group ID. If this field returns `null` and the `executionCount` is `0`, the order is the first subscription order."},"subscriptions":{"type":["array","null"],"description":"List with subscriptions details.","items":{"type":"object","description":"Subscription details.","properties":{"executionCount":{"type":"integer","description":"Position of the order in the subscription cycle. The first order will have the value `0`, the second will have the value `1`, and so on."},"priceAtSubscriptionDate":{"type":["number","null"],"description":"Value of the order when the customer subscribed. Subscriptions created via VTEX Admin or [Subscriptions API](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3) do not have an original order, so this field returns `0.0`."},"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"plan":{"type":"object","description":"Information about the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR).","properties":{"type":{"type":"string","description":"Plan type."},"frequency":{"type":"object","description":"Information about subscriptions' recurrence.","properties":{"periodicity":{"type":"string","description":"Defines the subscription recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the frequency. For a `DAY` frequency, the value will be days, for `MONTH` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription will be valid.","properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}}}}}},"taxData":{"type":["object","null"],"description":"Order taxes information.","required":["areTaxesDesignatedByMarketplace","taxInfoCollection"],"properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were applied by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Order taxes details.","items":{"type":"object","description":"Information about a given tax.","required":["itemIndex","sku","priceTags"],"properties":{"itemIndex":{"type":"integer","description":"Item indexing number."},"sku":{"type":"string","description":"SKU ID."},"priceTags":{"type":["object","null"],"description":"Information about order taxes.","properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were designated by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Array with taxes' details.","items":{"type":"object","description":"Details about a given tax.","properties":{"itemIndex":{"type":"integer","description":"Item index number."},"sku":{"type":"string","description":"Alphanumeric sequence that identifies a SKU."},"priceTags":{"type":"array","description":"Price tags information with the original taxes calculated at order placement.","items":{"type":"object","description":"Information about a given price tag.","properties":{"identifier":{"type":"string","description":"Price tag identifier code."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"name":{"type":"string","description":"Price tag name."},"value":{"type":"number","description":"Price tag value."},"rawValue":{"type":"number","description":"Price tag raw value that can contain up to five decimals, separated by a period."}}}}}}}}}}}}}},"invoicedDate":{"type":["string","null"],"description":"Order invoice date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"marketplaceOrderId":{"type":["string","null"],"description":"Order ID in the marketplace."},"marketplaceServicesEndpoint":{"type":["string","null"],"description":"Marketplace endpoint for post purchase communication."},"clientProfileData":{"type":"object","description":"Information about the client who created the order.","required":["id","email","firstName","lastName","documentType","document","phone","corporateName","tradeName","corporateDocument","stateInscription","corporatePhone","isCorporate","userProfileId","customerClass"],"properties":{"id":{"type":["string","null"],"description":"Client ID."},"userProfileId":{"type":"string","description":"User profile ID."},"userProfileVersion":{"type":["string","null"],"description":"User profile version."},"firstName":{"type":"string","description":"Client first name."},"lastName":{"type":"string","description":"Client last name."},"email":{"type":"string","description":"Client email address."},"document":{"type":"string","description":"Client document code."},"corporateDocument":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate document."},"corporateName":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate name."},"documentType":{"type":"string","description":"Client document type."},"phone":{"type":"string","description":"Client telephone number."},"tradeName":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the trade name."},"stateInscription":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate state inscription."},"corporatePhone":{"type":["string","null"],"description":"If the client is a legal entity, this field includes the corporate telephone number."},"isCorporate":{"type":"boolean","description":"Defines if the client is corporate and a legal entity (`true`) or not (`false`)."},"customerClass":{"type":["string","null"],"description":"Customer class identification."},"customerCode":{"type":["string","null"],"description":"Customer code."}}},"giftRegistryData":{"type":["object","null"],"description":"[Gift list](https://developers.vtex.com/docs/guides/creating-gift-lists) information.","properties":{"giftRegistryId":{"type":"string","description":"Gift list ID."},"giftRegistryType":{"type":"string","description":"[Gift list type](https://help.vtex.com/en/tutorial/creating-a-type-of-list)."},"giftRegistryTypeName":{"type":"string","description":"Gift list type name."},"addressId":{"type":"string","description":"Gift list shipping address ID."},"description":{"type":"string","description":"Gift list description."}}},"emailTracked":{"type":"string","description":"Customer email [tracked](https://help.vtex.com/en/tutorial/understanding-the-conversation-tracker--tutorials_195)."},"isCheckedIn":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"approvedBy":{"type":["string","null"],"description":"User who approved the order, in case of manual approval."},"cancelledBy":{"type":["string","null"],"description":"User that canceled the order."},"canceledBy":{"type":["string","null"],"description":"User that canceled the order."},"cancelReason":{"type":["string","null"],"description":"Order cancellation reason."},"callCenterOperatorData":{"type":["object","null"],"description":"Information about the call center operator responsible for the order.","properties":{"id":{"type":"string","description":"Call center operator identification code."},"email":{"type":"string","description":"Call center operator email."},"userName":{"type":"string","description":"Call center operator user name."}}},"allowCancellation":{"type":"boolean","description":"Defines if order cancellation is allowed (`true`) or not anymore (`false`)."},"allowEdition":{"type":"boolean","description":"Defines if the order can be edited (`true`) or not anymore (`false`)."},"roundingError":{"type":"integer","description":"Rounding error total amount in cents, when applicable. For example, in orders with a discount over non-integer multiplier items, the rounding price is performed per item, not after the sum of all items. That can cause a difference in the total discount amount, which is informed in this field."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) related to the order."},"salesChannelData":{"type":"object","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) information.","properties":{"countryCode":{"type":["string","null"],"description":"Three-digit country code, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":["string","null"],"description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":["object","null"],"description":"Currency format details.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Defines what currency decimal separator will be applied."},"CurrencyGroupSeparator":{"type":"string","description":"Defines what currency group separator will be applied."},"CurrencyGroupSize":{"type":"integer","description":"Defines how many characters will be grouped."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if all prices will be initiated with the currency symbol (`true`) or not (`false`)."}}},"cultureInfo":{"type":["string","null"],"description":"Information about the culture."},"currencyLocale":{"type":"integer","description":"Currency Locale Code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":["string","null"],"description":"Currency symbol."},"timeZone":{"type":["string","null"],"description":"Time zone where the order was created."},"id":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID."},"name":{"type":"string","description":"Store name."},"isActive":{"type":"boolean","description":"Defines if the sales channel is active (`true`) or inactive (`false`)."}}},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields. For example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}},"changesAttachment":{"type":["object","null"],"description":"Information about changes in the order.","required":["id","changesData"],"properties":{"id":{"type":"string","description":"Order changes ID."},"changesData":{"type":"array","description":"Order changes details.","items":{"required":["reason","discountValue","incrementValue","itemsAdded","itemsRemoved","receipt"],"type":"object","description":"Details about an order change.","properties":{"reason":{"type":"string","description":"Text explaining why the order was changed. This information may be shown to the customer in the storefront or transactional emails."},"discountValue":{"type":["integer","null"],"description":"Order change discount value in cents."},"incrementValue":{"type":["integer","null"],"description":"Order change increment value in cents."},"itemsAdded":{"type":["array","null"],"description":"Information about items added to the order, when applicable.","items":{"type":"object","description":"Information about an item added to the order.","properties":{"id":{"type":"string","description":"Added item SKU ID."},"name":{"type":"string","description":"Added item SKU name."},"quantity":{"type":"integer","description":"Quantity of items added."},"price":{"type":"integer","description":"Added item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Added item unit multiplier."}}}},"itemsRemoved":{"type":["array","null"],"description":"Information about items removed from the order, when applicable.","items":{"type":"object","description":"Information about an item removed from the order.","required":["id","name","quantity","price","unitMultiplier"],"properties":{"id":{"type":"string","description":"Removed item SKU ID."},"name":{"type":"string","description":"Removed item name."},"quantity":{"type":"integer","format":"int32","description":"Quantity of removed items."},"price":{"type":"integer","format":"int32","description":"Removed item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Removed item unit multiplier."}}}},"receipt":{"required":["date","orderId","receipt"],"type":"object","description":"Order changes receipt information.","properties":{"date":{"type":"string","description":"Receipt creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID."},"receipt":{"type":"string","description":"Receipt unique identifier code."}}}}}}}},"commercialConditionData":{"type":["string","null"],"description":"Commercial condition information."},"shippingData":{"type":"object","description":"Order shipping information.","required":["address","logisticsInfo","trackingHints","selectedAddresses"],"properties":{"address":{"type":"object","description":"Shipping address details.","required":["addressType","receiverName","addressId","postalCode","city","state","country","street","number","neighborhood","complement","reference","geoCoordinates"],"properties":{"addressType":{"type":"string","description":"Shipping address type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"postalCode":{"type":"string","description":"Shipping address postal code."},"city":{"type":"string","description":"Shipping address city."},"state":{"type":"string","description":"Shipping address state."},"country":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Shipping address street."},"number":{"type":"string","description":"Shipping address number."},"neighborhood":{"type":"string","description":"Shipping address neighborhood."},"complement":{"type":["string","null"],"description":"Shipping address complement."},"reference":{"type":["string","null"],"description":"Shipping address additional information."},"geoCoordinates":{"type":"array","description":"Shipping address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"logisticsInfo":{"type":"array","description":"Logistics information regarding order items.","items":{"type":"object","description":"Logistics information about an item.","properties":{"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, when applicable."},"sellingPrice":{"type":"integer","description":"Item selling price in cents."},"listPrice":{"type":"integer","description":"Item [list price](https://help.vtex.com/en/tracks/prices-101--6f8pwCns3PJHqMvQSugNfP/3XcXp0r5WrJvogB8KIX4Kx#list-price) in cents."},"price":{"type":"integer","description":"Item shipping price in cents. This value does not correspond to the order total shipping price."},"deliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or pickup.","enum":["delivery","pickup-in-point"]},"deliveryCompany":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company name."},"deliveryIds":{"type":"array","description":"Order delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"courierName":{"type":"string","description":"Carrier name."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"shippingEstimateDate":{"type":"string","description":"Shipping estimate date, defined after order confirmation, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"deliveryChannels":{"type":"array","description":"Delivery channels associated with the sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)).","items":{"type":"object","description":"Delivery channel information.","properties":{"id":{"type":"string","description":"Delivery channel shipping type.","enum":["delivery","pickup-in-point"]},"stockBalance":{"type":"integer","description":"Stock check for SKU availability."}}}},"itemId":{"type":"string","description":"SKU ID."},"shipsTo":{"type":"array","description":"List of shipping address countries.","items":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."}},"slas":{"type":"array","description":"Service Level Agreements (SLA) corresponding to [shipping policies](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).","items":{"type":"object","description":"Service Level Agreement (SLA) information.","properties":{"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"tax":{"type":"integer","description":"SLA tax information."},"listPrice":{"type":"integer","description":"SLA shipping list price in cents."},"price":{"type":"integer","description":"SLA shipping price in cents. Does not account for the order total shipping price."},"deliveryWindow":{"type":["string","null"],"description":"[Delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"availableDeliveryWindows":{"type":["array","null"],"description":"Available delivery windows information, when applicable.","items":{"type":"string","description":"Information about an available delivery window."}},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time related to the SLA."},"shippingEstimateDate":{"type":["string","null"],"description":"SLA shipping estimate date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"deliveryIds":{"type":"array","description":"SLA delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"courierName":{"type":"string","description":"Carrier name."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"name":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) name."},"deliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"id":{"type":"string","description":"ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."}}}},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"selectedDeliveryChannel":{"type":"string","description":"Delivery channel selected by the customer. This field is being deprecated and the information it retrieves can be found in the `deliveryChannel` field.","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time."},"selectedSla":{"type":"string","description":"Service Level Agreement (SLA), which corresponds to the shipping method selected by the customer, usually like normal or express."},"itemIndex":{"type":"integer","description":"Each item in the order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when applicable."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."}}}},"trackingHints":{"type":["array","null"],"description":"Order shipping label information.","items":{"type":"object","description":"Shipping label details.","properties":{"trackingId":{"type":"string","description":"Order tracking ID."},"courierName":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) name."},"trackingUrl":{"type":"string","description":"Order tracking URL."},"trackingLabel":{"type":"string","description":"Order tracking label."}}}},"selectedAddresses":{"type":"array","description":"Selected adresses information.","items":{"type":"object","description":"Details about a selected adress.","properties":{"addressType":{"type":"string","description":"Selected adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Selected address ID."},"versionId":{"type":["string","null"],"description":"Selected address version ID."},"entityId":{"type":["string","null"],"description":"Selected address entity ID."},"postalCode":{"type":"string","description":"Selected address postal code."},"city":{"type":"string","description":"Selected address city."},"state":{"type":"string","description":"Selected address state."},"country":{"type":"string","description":"Selected address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Selected address street."},"number":{"type":"string","description":"Selected address number."},"neighborhood":{"type":"string","description":"Selected address neighborhood."},"complement":{"type":["string","null"],"description":"Selected address complement."},"reference":{"type":["string","null"],"description":"Selected address additional information."},"geoCoordinates":{"type":"array","description":"Selected address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}}},"availableAddresses":{"type":"array","description":"Available adresses information.","items":{"type":"object","description":"Details about an available adress.","properties":{"addressType":{"type":"string","description":"Available adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Available address ID."},"versionId":{"type":["string","null"],"description":"Available address version ID."},"entityId":{"type":["string","null"],"description":"Available address entity ID."},"postalCode":{"type":"string","description":"Available address postal code."},"city":{"type":"string","description":"Available address city."},"state":{"type":"string","description":"Available address state."},"country":{"type":"string","description":"Available address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Available address street."},"number":{"type":"string","description":"Available address number."},"neighborhood":{"type":"string","description":"Available address neighborhood."},"complement":{"type":["string","null"],"description":"Available address complement."},"reference":{"type":["string","null"],"description":"Available address additional information."},"geoCoordinates":{"type":"array","description":"Available address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}}},"contactInformation":{"type":["array","null"],"description":"Order contact information.","items":{"type":"object","description":"Order contact details.","properties":{"id":{"type":"string","description":"Contact ID."},"email":{"type":"string","description":"Contact email."},"firstName":{"type":"string","description":"Contact first name."},"lastName":{"type":"string","description":"Contact last name."},"document":{"type":"string","description":"Contact document number."},"phone":{"type":"string","description":"Contact phone number."},"documentType":{"type":"string","description":"Contact document type."}}}}}},"packageAttachment":{"type":["object","null"],"description":"Information about shipping packages, which are created after order invoicing.","properties":{"packages":{"type":["array","null"],"description":"List with packages' information.","items":{"type":"object","description":"Package details.","properties":{"courier":{"type":"string","description":"Name of the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) responsible for the package shipping."},"description":{"type":["string","null"],"description":"Package description."},"invoiceNumber":{"type":"string","description":"Unique identification code of the package invoice."},"invoiceValue":{"type":"integer","description":"Package invoice value in cents."},"invoiceUrl":{"type":"string","description":"Package invoice URL."},"issuanceDate":{"type":"string","description":"Package invoice issuance date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"trackingNumber":{"type":"string","description":"Package [tracking number](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-)."},"invoiceKey":{"type":"string","description":"Package invoice key."},"trackingUrl":{"type":"string","description":"Package tracking URL."},"embeddedInvoice":{"type":"string","description":"Package invoice text in [xml format](https://help.vtex.com/en/tutorial/configuring-xml--tutorials_242). This field is important for stores integrated with [external marketplaces](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide)."},"type":{"type":"string","description":"Package invoice type, which can be:\r\n- `Output`: Selling order invoice.\r\n- `Input`: Returning items invoice.","enum":["Output","Input"]},"items":{"type":"array","description":"Information on each item in the package.","items":{"type":"object","description":"Package item details.","properties":{"itemIndex":{"type":"integer","description":"Item index of the item position whithin the `items` array. The count starts at `0`."},"id":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Package item quantity."},"price":{"type":"integer","description":"Package item price in cents."},"description":{"type":"string","description":"Package item description."},"unitMultiplier":{"type":"number","description":"Package item unit multiplier."}}}},"courierStatus":{"type":["object","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) shipping information.","properties":{"deliveredDate":{"type":"string","description":"Package delivery date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"status":{"type":["string","null"],"description":"Defines if a carrier was assigned for order shipping (`ok`) or not (`null`)."},"finished":{"type":"boolean","description":"Defines if the carrier has already delivered the package (`true`) or not (`false`)."},"data":{"type":"array","description":"Package tracking information.","items":{"type":"object","description":"Package tracking details.","properties":{"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"city":{"type":"string","description":"Package tracking city."},"state":{"type":"string","description":"Package tracking state in two-digit code format."},"description":{"type":"string","description":"Package tracking description."},"createDate":{"type":"string","description":"Package tracking creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"cfop":{"type":["string","null"],"description":"[CFOP](https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/facilitacao/anexo-ecf-cfop) (_Código Fiscal de Operação e Prestação_) is a Brazilian fiscal code of operations and services that classifies business transaction types."},"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"restitutions":{"type":["object","null"],"description":"Information about a value being returned to the customer. This field applies only to invoices with the `Input` type because it relates to returning items.","properties":{"refund":{"type":"object","description":"Customer refund details.","properties":{"value":{"type":"integer","description":"Refund value in cents."},"giftCardData":{"type":["string","null"],"description":"Refund involving a [gift card](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."},"items":{"type":["array","null"],"description":"Information about the items being returned.","items":{"type":"object","description":"Returned item details.","properties":{"useFreight":{"type":["boolean","null"],"description":"Defines if the refund includes freight values (`true`) or not (`false`)."},"isCompensation":{"type":"boolean","description":"Defines if there are compensated unit tags in the package (`true`) or not (`false`)."},"compensationValue":{"type":"integer","description":"Compensational refund value in cents."},"id":{"type":"string","description":"SKU ID of the returned item."},"quantity":{"type":"integer","description":"Number of items being returned."},"price":{"type":"integer","description":"Returned item price in cents."},"description":{"type":"string","description":"Customer reason for returning the item."}}}}}}}},"volumes":{"type":["integer","null"],"description":"Indicates the number of boxes (volumes) needed to contain the package items. For example, two refrigerators do not fit in a single volume, so this field would have value `2`."}}}}}},"marketplace":{"type":["object","null"],"description":"Information about the marketplace related to the order.","properties":{"baseURL":{"type":"string","description":"Marketplace base URL."},"isCertified":{"type":["boolean","null"],"description":"Defines if the marketplace is a [VTEX certified marketplace](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-certified-marketplaces) (`true`) or not (`false`)."},"name":{"type":"string","description":"Marketplace name."}}},"contextData":{"type":"object","description":"Information about the order context.","properties":{"loggedIn":{"type":"boolean","description":"Defines if the user was logged in the account or not (`true`) or not (`false`)."},"hasAccessToOrderFormEnabledByLicenseManager":{"type":"boolean","description":"Defines if in order placement the user had access to the order form enabled by the [License Manager](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) (`true`) or not (`false`)."},"userAgent":{"type":"string","description":"User agent name."},"userId":{"type":"string","description":"User ID."}}},"lastMessage":{"type":["string","null"],"description":"Last transactional message sent to the customer."},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"handlingData":{"type":["string","null"],"description":"Order handling information."},"documentVersion":{"type":"string","description":"Document version identification."},"appVersion":{"type":"string","description":"APP version identification."},"workflowData":{"type":"object","description":"Information about order processing and workflow.","properties":{"instances":{"type":"array","description":"Order processing details.","items":{"type":"object","description":"Order processing details for the marketplace and seller instances.","properties":{"id":{"type":"string","description":"Workflow instance ID."},"name":{"type":"string","description":"Workflow instance name, related to marketplace and fulfillment."},"currentStepName":{"type":"string","description":"Current [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"currentStepDescription":{"type":["string","null"],"description":"Current step description for the order status in the workflow."},"lastChange":{"type":"string","description":"Date of the order last change in the workflow in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isInError":{"type":"boolean","description":"Defines if the order processing in the workflow is in error (`true`) or not (`false`)."},"isInAutomaticRetry":{"type":"boolean","description":"Defines if the order is in automatic processing retry in the workflow (`true`) or not (`false`)."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"owner":{"type":["string","null"],"description":"Code that identifies the owner."},"version":{"type":["string","null"],"description":"Workflow version."},"timeLine":{"type":"array","description":"Workflow timeline steps.","items":{"type":"object","description":"Information about a given workflow timeline step.","properties":{"stepName":{"type":"string","description":"Name of the timeline step."},"date":{"type":"string","description":"Timeline step processing date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"parentStepName":{"type":"string","description":"Timeline parent step name."}}}},"logicTimeLine":{"type":"array","description":"Logical workflow timeline steps.","items":{"type":"object","description":"Information about a given logical workflow timeline step.","properties":{"stepName":{"type":"string","description":"Name of the logical timeline step."},"date":{"type":"string","description":"Logical timeline step processing date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}},"steps":{"type":"array","description":"Steps in the order processing in the workflow.","items":{"type":"object","description":"Details about a given step in the order processing.","properties":{"name":{"type":"string","description":"Order processing step name."},"next":{"type":["array","null"],"description":"Next order steps in the workflow.","items":{"type":"object","description":"Information about a given step in the workflow.","properties":{"name":{"type":"string","description":"Step status name."},"next":{"type":["string","null"],"description":"Next order status step."},"systemWillMove":{"type":"boolean","description":"Defines if the order can move to the next step (`true`) or not (`false`)."},"actionsAllowed":{"type":["object","null"],"description":"Type of actions allowed in the next steps.","properties":{"type":{"type":"string","description":"Name of the order action allowed."}}},"expectFlow":{"type":["boolean","null"],"description":"Defines if the order is progressing in the workflow as expected (`true`) or not (`false`)."}}}},"systemWillMove":{"type":"boolean","description":"Defines if the order can move to the next workflow status (`true`) or not (`false`)."},"actionsAllowed":{"type":["object","null"],"description":"Type of actions allowed for order processing in the workflow.","properties":{"type":{"type":"string","description":"Name of the order action allowed."}}},"start":{"type":"boolean","description":"Defines if the step corresponds to the order creation (`true`) or not (`false`)."}}}},"currentLogicalStep":{"type":"string","description":"Name of the order current logical step in the workflow."}}}},"mainFlowIndex":{"type":"integer","description":"Workflow processing index, starting from `0`."}}},"checkedInPickupPointId":{"type":["string","null"],"description":"When the order is created at a physical store which is configured as a pickup point, this field retrieves the pickup point ID."},"fingerPrint":{"type":"string","description":"Order finger print code."},"piiHidden":{"type":"boolean","description":"Defines if the VTEX account uses [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) (`true`) or not (`false`)."},"workflowIsInError":{"type":"boolean","description":"Indicates if the order workflow presents an error (`true`) or if there are no errors (`false`)."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator responsible for the order, when applicable."},"state":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"timeZoneCreationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"timeZoneLastChange":{"type":"string","description":"Date of the order processing last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"userType":{"type":["string","null"],"description":"User type."},"clientPreferencesData":{"type":"object","description":"Information about the customer preferences.","properties":{"locale":{"type":"string","description":"Language code of the customer preferred language while accessing the store."},"optinNewsLetter":{"type":"boolean","description":"Defines if the customer receives the store's newsletter (`true`) or not (`false`)."}}},"orderId":{"type":"string","description":"Order ID."},"workflowInstanceId":{"type":["string","null"],"description":"Workflow instance ID."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"totals":{"type":"array","description":"Information about the order totals.","items":{"type":"object","description":"Details about the order totals.","properties":{"id":{"type":"string","description":"Total ID, which defines what the total is about.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value in cents."},"alternativeTotals":{"type":["array","null"],"description":"Information about the order alternative totals, when applicable. For example, when there is a discount for items in the marketplace that results in a difference in the `Items` total value, the `alternativeTotals` can retrieve details about it.","items":{"type":"object","description":"Details about the order alternative totals.","properties":{"id":{"type":"string","description":"Alternative total ID, which can be related to items, discounts, shipping or taxes."},"name":{"type":"string","description":"Alternative total name."},"value":{"type":"integer","description":"Alternative total value in cents."}}}}}}},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v70530116str-01`, the sequence is `70530116`."},"receiptData":{"type":"object","description":"Receipts with information about transactions.","properties":{"receiptCollection":{"type":"array","description":"Collection of receipts.","items":{"type":"object","description":"Receipt with information about a given transaction.","properties":{"receiptType":{"type":"string","description":"Receipt transaction type."},"date":{"type":"string","description":"Receipt transaction date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"isCompleted":{"type":"boolean","description":"Defines if the order payment has been settled (`true`) or not (`false`)."},"openTextField":{"type":["object","null"],"description":"Optional field for additional information.","additionalProperties":{"type":"string","description":"Additional information."}},"affiliateId":{"type":["string","null"],"description":"Three-letter [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) code configured by the seller to identify a marketplace."},"value":{"type":"integer","description":"Order total value in cents."},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"followUpEmail":{"type":"string","description":"Email of the store employee responsible for managing the order."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"sellers":{"type":"array","description":"Information about the sellers associated with the order.","items":{"type":"object","description":"Information about a given seller.","properties":{"id":{"type":"string","description":"Seller identifier."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo URL."},"fulfillmentEndpoint":{"type":"string","description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace use to communicate with the seller."},"subSellerId":{"type":"string","description":"Sub seller ID. When the main account acts both as seller and marketplace, this field will return the value `1`."}}}},"marketingData":{"type":["object","null"],"description":"Information about marketing and promotions, such as coupon code and [Urchin Tracking Module (UTM)](https://help.vtex.com/en/tutorial/what-are-utm-source-utm-campaign-and-utm-medium--2wTz7QJ8KUG6skGAoAQuii).","properties":{"utmSource":{"type":["string","null"],"description":"A UTM is an Urchin Tracking Module used to track traffic related to your store. This field is an UTM for tracking the traffic source, to know from which site, advertiser, or publication the customer came before reaching your site."},"utmMedium":{"type":"string","description":"UTM for tracking the advertising or marketing media used to reach your site, such as banners and newsletters."},"utmCampaign":{"type":["string","null"],"description":"UTM for tracking the marketing campaign context."},"utmPartner":{"type":["string","null"],"description":"UTM for tracking the partner."},"utmipage":{"type":["string","null"],"description":"A `utmi` is an internal Urchin Tracking Module (UTM) used to track traffic inside your site. This field is an internal UTM for tracking pages."},"utmiPart":{"type":["string","null"],"description":"Internal UTM for tracking the partner."},"utmiCampaign":{"type":["string","null"],"description":"Internal UTM for tracking the marketing campaign context."},"coupon":{"type":["string","null"],"description":"Coupon code used by the customer."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the order.","items":{"type":"string","description":"Marketing tag name."}}}},"ratesAndBenefitsData":{"type":"object","description":"Information about promotions and taxes valid for the order.","properties":{"rateAndBenefitsIdentifiers":{"type":"array","description":"List of promotions and taxes.","items":{"type":"object","description":"Information about a given promotion or tax.","properties":{"id":{"type":"string","description":"Promotion or tax ID."},"name":{"type":"string","description":"Promotion or tax name."},"featured":{"type":"boolean","description":"Defines if the [target audience](https://help.vtex.com/en/tutorial/creating-a-campaign-audience--6cnuDZJzIkIeocewAQQK4K) is featured (`true`) or not (`false`)."},"description":{"type":["string","null"],"description":"Promotion or tax description."},"matchedParameters":{"type":["object","null"],"description":"Conditions met by the purchase for the promotion or tax to be applied.","additionalProperties":{"type":"string","description":"Promotion or tax condition."}},"additionalInfo":{"type":["object","null"],"description":"Object containing additional information about the promotion or tax.","additionalProperties":{"type":"string","description":"Promotion or tax additional information."}}}}},"teaser":{"type":["array","null"],"description":"List of promotion teasers.","items":{"type":"object","description":"Information about a promotion teaser.","properties":{"name":{"type":"string","description":"Promotion teaser name."},"description":{"type":"string","description":"Promotion teaser description."}}}}}},"paymentData":{"type":"object","description":"Payments information.","properties":{"giftCards":{"type":["array","null"],"description":"[Gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"object","description":"Gift card details.","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionCode":{"type":"string","description":"Gift card code used by the customer at checkout."},"name":{"type":["string","null"],"description":"Gift card name."},"caption":{"type":["string","null"],"description":"Gift card loyalty program, when applicable."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be `0.0`."},"provider":{"type":"string","description":"Gift card provider name."},"groupName":{"type":["string","null"],"description":"Gift card group name."},"inUse":{"type":"boolean","description":"Defines if the gift card is in use (`true`) or not (`false`)."},"isSpecialCard":{"type":"boolean","description":"Defines if the gift card is a special card (`true`) or not (`false`)."}}}},"transactions":{"type":"array","description":"Information about the order financial transactions.","items":{"type":"object","description":"Information about a given transaction.","properties":{"isActive":{"type":"boolean","description":"Defines of the transaction is active (`true`) or inactive (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Payments information.","items":{"type":"object","description":"Payment details.","properties":{"bankIssuedInvoiceIdentificationNumberFormatted":{"type":["string","null"],"description":"Bank issued invoice numeric sequence formatted as customers see."},"bankIssuedInvoiceIdentificationNumber":{"type":["string","null"],"description":"Bank issued invoice numeric sequence."},"parentAccountId":{"type":["string","null"],"description":"When the payment was made in a subaccount, this field retrieves the main account ID."},"accountId":{"type":"string","description":"Identification code of the account where the payment was made."},"dueDate":{"type":["string","null"],"description":"Payment due date in `MM/YY` format."},"group":{"type":"string","description":"Transaction payment method, which can be credit card, debid card, bank invoice, promissory, gift card or pix (`instantPayment`).","enum":["creditCard","debitCard","bankInvoice","promissory","giftCard","instantPayment"]},"isGiftCardDiscount":{"type":["boolean","null"],"description":"Defines if the payment has a gift card discount (`true`) or not (`false`)."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider ID."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"redemptionCode":{"type":["string","null"],"description":"Gift card code used by the customer at checkout."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"koinUrl":{"type":["string","null"],"description":"Koin connector URL."},"url":{"type":["string","null"],"description":"Payment URL."},"expireYear":{"type":["string","null"],"description":"Card expiration year in 4-digit format."},"expireMonth":{"type":["string","null"],"description":"Card expiration month in 2-digit format."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"lastDigits":{"type":["string","null"],"description":"Card last four digits."},"firstDigits":{"type":["string","null"],"description":"Card first four digits."},"cardNumber":{"type":["string","null"],"description":"Card number."},"cardHolder":{"type":["string","null"],"description":"Name of the card owner."},"referenceValue":{"type":"integer","description":"Total payment reference value in cents."},"connectorResponses":{"type":"object","description":"Payment provider (connector) responses. The fields within this object can vary according to the order payment provider.","properties":{"Message":{"type":"string","description":"Provider operational message or error to be logged."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"authorizationId":{"type":"string","description":"Provider authorization ID."},"status":{"type":"string","description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."},"delayToAutoSettle":{"type":"integer","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`, regardless if the payment was approved by the merchant's anti-fraud provider. The maximum value allowed is `604800` seconds (7 days)."},"ReturnCode":{"type":["string","null"],"description":"Provider operational return code or error to be logged."},"nsu":{"type":"string","description":"Provider unique sequential number for the transaction."},"code":{"type":"string","description":"Provider operational code or error to be logged."},"message":{"type":"string","description":"Provider operational message or error to be logged."},"Tid":{"type":"string","description":"Provider unique identifier for the transaction."},"acquirer":{"type":"string","description":"[Acquirer](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/kdPbEIWf8Xq8tESQvViMB#acquirer) name (mostly used for card payments)."},"authId":{"type":"string","description":"Authorization identification."},"paymentId":{"type":"string","description":"Payment ID."},"delayToAutoSettleAfterAntifraud":{"type":"string","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`. This happens only after the payment was approved by the merchant's anti-fraud provider."}}},"installments":{"type":"integer","description":"Number of payment installments."},"value":{"type":"integer","description":"Order total payment value in cents."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystem":{"type":"string","description":"Payment system ID."},"paymentOrigin":{"type":["string","null"],"description":"Type of [wallet](https://help.vtex.com/en/tutorial/what-is-an-e-wallet--4v5wcOe4A0SiaimWM2cU60) used in the payment."},"id":{"type":"string","description":"Payment unique identifier."},"bankIssuedInvoiceBarCodeNumber":{"type":["string","null"],"description":"Bank issued invoice bar code number."},"bankIssuedInvoiceBarCodeType":{"type":["string","null"],"description":"Bank issued invoice bar code type."},"billingAddress":{"type":["object","null"],"description":"Billing address information.","properties":{"addressType":{"type":"string","description":"Billing address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Billing address ID."},"versionId":{"type":["string","null"],"description":"Billing address version ID."},"entityId":{"type":["string","null"],"description":"Billing address entity ID."},"postalCode":{"type":"string","description":"Billing address postal code."},"city":{"type":"string","description":"Billing address city."},"state":{"type":"string","description":"Billing address state."},"country":{"type":"string","description":"Billing address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Billing address street."},"number":{"type":"string","description":"Billing address number."},"neighborhood":{"type":"string","description":"Billing address neighborhood."},"complement":{"type":["string","null"],"description":"Billing address complement."},"reference":{"type":["string","null"],"description":"Billing address additional information."},"geoCoordinates":{"type":"array","description":"Billing address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Billing contact unique identifier."}}}}}},"sharedTransaction":{"type":"boolean","description":"Defines if the transaction is shared (`true`) or not (`false`)."},"status":{"type":["string","null"],"description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."}}}}}},"invoiceData":{"type":["object","null"],"description":"Order invoices information.","properties":{"address":{"type":["object","null"],"description":"Invoice address information.","properties":{"addressType":{"type":["string","null"],"description":"Invoice address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":["string","null"],"description":"Full name of the order receiver."},"addressId":{"type":["string","null"],"description":"Invoice address ID."},"versionId":{"type":["string","null"],"description":"Invoice address version ID."},"entityId":{"type":["string","null"],"description":"Invoice address entity ID."},"postalCode":{"type":"string","description":"Invoice address postal code."},"city":{"type":"string","description":"Invoice address city."},"state":{"type":"string","description":"Invoice address state."},"country":{"type":"string","description":"Invoice address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Invoice address street."},"number":{"type":"string","description":"Invoice address number."},"neighborhood":{"type":"string","description":"Invoice address neighborhood."},"complement":{"type":["string","null"],"description":"Invoice address complement."},"reference":{"type":["string","null"],"description":"Invoice address additional information."},"geoCoordinates":{"type":"array","description":"Invoice address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"userPaymentInfo":{"type":["object","null"],"description":"Invoice information regarding payment method.","properties":{"paymentMethods":{"type":"array","description":"List of the payment methods used by the customer in the purchase.","items":{"type":"string","description":"Payment method name."}}}},"settleInvoices":{"type":["array","null"],"description":"List with the order settled invoices.","items":{"type":"string","description":"Settled invoice numeric identifier."}},"invoiceSubject":{"type":["object","null"],"description":"Information about the invoice subject.","properties":{"id":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject email address."},"firstName":{"type":"string","description":"Invoice subject first name."},"lastName":{"type":"string","description":"Invoice subject last name."},"phone":{"type":"string","description":"Invoice subject phone number."}}}}},"storePreferencesData":{"type":"object","description":"Store preferences in the [Account settings](https://help.vtex.com/en/tutorial/account-details-page--2vhUVOKfCaswqLguT2F9xq).","properties":{"countryCode":{"type":"string","description":"Country code in three-digit [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":"object","description":"Currency format settings.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Number of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Character for currency decimal separation."},"CurrencyGroupSeparator":{"type":"string","description":"Character for currency group separation."},"CurrencyGroupSize":{"type":"integer","description":"Limit of characters that can be grouped for currency groups."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if the prices displayed for customers start with the currency symbol (`true`) or not (`false`)."}}},"currencyLocale":{"type":"integer","description":"Currency locale code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":"string","description":"Currency symbol characters."},"timeZone":{"type":"string","description":"Time zone considered for the store orders."}}},"merchantName":{"type":["string","null"],"description":"Merchant name."},"itemMetadata":{"type":"object","description":"Metadata information about items.","properties":{"items":{"type":"array","description":"Metadata details about items.","items":{"type":"object","description":"Metadata details about a given item","properties":{"id":{"type":"string","description":"SKU ID."},"seller":{"type":"string","description":"Seller ID."},"name":{"type":"string","description":"Item name as displayed to customers in the storefront."},"skuName":{"type":"string","description":"SKU name."},"productId":{"type":"string","description":"Product ID."},"refId":{"type":"string","description":"SKU reference ID."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"imageUrl":{"type":"string","description":"SKU image URL."},"detailUrl":{"type":"string","description":"SKU slug."},"assemblyOptions":{"type":["array","null"],"description":"[Assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) information related to the item, when applicable.","items":{"type":"object","description":"[Assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) details.","properties":{"id":{"type":"string","description":"Assembly option ID."},"name":{"type":"string","description":"Assembly option name."},"required":{"type":"boolean","description":"Defines if sending the attachment for the item purchased is required(`true`) or optional (`false`)."},"inputValues":{"type":["object","null"],"description":"Assembly option content.","additionalProperties":{"type":["string","null"],"description":"Assembly option value."}},"composition":{"type":["object","null"],"description":"Assembly option composition.","additionalProperties":{"type":"string","description":"Assembly option composition value."}}}}}}}}}},"creationEnvironment":{"type":["string","null"],"description":"Order creation environment, which can be a [development workspace](https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-development-workspace) (`BETA`) or a [production workspace](https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-production-workspace) (`STABLE`).","enum":["BETA","STABLE",null]},"cancellationData":{"type":["object","null"],"description":"Information about [order cancellation](https://developers.vtex.com/docs/guides/order-canceling-improvements), when applicable.","properties":{"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"requestedBySystem":{"type":["boolean","null"],"description":"Defines if the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example."},"requestedBySellerNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the seller (`true`) or not (`false`)."},"requestedByPaymentNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the payment gateway (`true`) or not (`false`)."},"reason":{"type":"string","description":"Reason why the order was canceled."},"cancellationDate":{"type":"string","description":"Order cancellation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cancellationRequestId":{"type":"string","description":"ID that identifies the cancellation operation."}}},"cancellationRequests":{"type":["array","null"],"description":"Information about the [seller order cancellation denials](https://developers.vtex.com/docs/guides/order-canceling-improvements), regardless if the cancellation request was made by the marketplace or the customer.","items":{"type":"object","description":"Information about the seller denial to a given order cancellation request.","properties":{"id":{"type":"string","description":"ID that identifies the original cancellation operation made by the marketplaces or its customer care service using the [Cancel order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/cancel) endpoint."},"reason":{"type":"string","description":"Reason why there was a request to cancel the order."},"cancellationRequestDate":{"type":"string","description":"Date of when the order cancellation request was processed by the platform. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"deniedBySeller":{"type":"boolean","description":"Defines if the order cancellation request was [denied by the seller](https://developers.vtex.com/docs/guides/order-canceling-improvements) (`true`) or accepted by the seller (`false`)."},"deniedBySellerReason":{"type":["string","null"],"description":"Reason given by the seller for denying the order cancellation."},"cancellationRequestDenyDate":{"type":["string","null"],"description":"Date of when the platform processed the seller denial to an order cancellation request. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}},"authorizationPolicyData":{"type":"array","description":"Information about the order authorization policy. When the store doesn't have any policies, the status will always be `accepted`.","items":{"type":"object","description":"Details about the order authorization policy","properties":{"status":{"type":"string","description":"Status of the order's authorization policy.","enum":["accepted","denied","pending"]},"deniedPolicies":{"type":"array","description":"Information about the order's denied policies.","items":{"type":"object","description":"Details about the order's denied policies.","minItems":0,"properties":{"policyId":{"type":"string","description":"Unique identifier of the denied policy."},"policyName":{"type":"string","description":"Name of denied policy."},"requireAllPoliciesAcceptance":{"type":"boolean","description":"Defines whether all listed policies in the policy group must be accepted."},"policyGroupId":{"type":"string","description":"Unique identifier of the policy group."},"policyGroupName":{"type":"string","description":"Name of the policy group."},"policyGroupUnitId":{"type":"string","description":"Identifier of the business unit this policy group belongs to."},"authorizationData":{"type":["array","null"],"description":"Information about the order's authorization data.","items":{"type":"object","description":"Details about the order's authorization data.","properties":{"requireAllApprovals":{"type":"boolean","description":"Defines whether the policy requires approval by all authorizers."},"authorizers":{"type":["array","null"],"description":"Information about the order's authorizers.","items":{"type":"object","description":"Details about the order's authorizers.","properties":{"id":{"type":"string","description":"Unique identifier of the authorizer."},"type":{"type":"string","description":"Type of the authorizer.","enum":["User","Unit"]},"authorizationDate":{"type":["string","null"],"description":"Date of the authorization."}}}}}}}}}},"pendingPolicies":{"type":"array","description":"Information about the order's pending policies.","items":{"type":"object","description":"Details about the order's pending policies.","minItems":0,"properties":{"policyId":{"type":"string","description":"Unique identifier of the pending policy."},"policyName":{"type":"string","description":"Name of pending policy."},"requireAllPoliciesAcceptance":{"type":"boolean","description":"Defines whether all listed policies must be accepted."},"policyGroupId":{"type":"string","description":"Unique identifier of the policy group."},"policyGroupName":{"type":"string","description":"Name of the policy group."},"policyGroupUnitId":{"type":"string","description":"Identifier of the business unit this policy group belongs to."},"authorizationData":{"type":["array","null"],"description":"Information about the order's authorization data.","items":{"type":"object","description":"Details about the order's authorization data.","properties":{"requireAllApprovals":{"type":"boolean","description":"Defines whether the policy requires approval by all authorizers."},"authorizers":{"type":["array","null"],"description":"Information about the order's authorizers.","items":{"type":"object","description":"Details about the order's authorizers.","properties":{"id":{"type":"string","description":"Unique identifier of the authorizer."},"type":{"type":"string","description":"Type of the authorizer.","enum":["User","Unit"]},"authorizationDate":{"type":["string","null"],"description":"Date of the authorization."}}}}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves order details by searching by order ID. + + If you wish to retrieve unmasked data, use the `reason` query parameter. + + >⚠️ Throttling: Each VTEX account can make up to 6000 requests per minute. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + > Check the [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `reason` | query | Reason for requesting unmasked data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 29 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API PII version/Orders/List orders.yml b/BrunoCollections/VTEX - Orders API PII version/Orders/List orders.yml new file mode 100644 index 0000000000..ddbbde866c --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Orders/List orders.yml @@ -0,0 +1,129 @@ +info: + name: List orders + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/orders/extendsearch/orders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "f_status": "ready-for-handling", + "f_creationDate": "creationDate:[2024-07-01T00:00:00.000Z TO 2024-08-01T00:00:00.000Z]", + "incompleteOrders": true, + "filterError": "all", + "per_page": 30, + "page": 1, + "orderBy": "creationDate,asc", + "q": "customer@email.com", + "sku_Ids": "6178691,6099191", + "listId": "3098", + "f_authorizedDate": "authorizedDate:[2024-01-01T00:00:00.000Z TO 2024-03-01T00:00:00.000Z]", + "f_paymentNames": "Visa", + "paymentId": "CE7751558D574E3093989B5BB5248A5D", + "pci_tid": "Z424WMJ37ZN9SKF4", + "nsu": "027946189", + "f_hasInputInvoice": true, + "f_hasOutputInvoice": true, + "f_invoicedDate": "invoicedDate:[2024-01-01T00:00:00.000Z TO 2024-03-01T00:00:00.000Z]", + "f_shippingEstimate": "4.days", + "f_sellerNames": "Fashion SellerName", + "f_affiliateId": "CBS", + "f_callCenterOperatorName": "Operator%20Name", + "f_isInstore": true, + "f_RnB": "Free+Shipping", + "salesChannelId": "2", + "f_salesChannel": "Main" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/extendsearch/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/extendsearch/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/extendsearch/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/extendsearch/orders - Schema is valid", function () { + const schema = {"type":"object","properties":{"list":{"type":"array","description":"List with orders' information.","items":{"type":"object","description":"Information about an order.","properties":{"paymentNames":{"type":"string","description":"Payment system name."},"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v71041992str-01`, the sequence is `71041992`."},"clientEmail":{"description":"Customer email.","type":"string"},"clientDocument":{"type":"string","description":"Customer document number."},"clientCorporateDocument":{"type":["string","null"],"description":"Corporate document, if the customer is a legal entity."},"clientCorporateName":{"type":["string","null"],"description":"Corporate name, if the customer is a legal entity."},"clientName":{"type":"string","description":"Customer name."},"totalValue":{"type":"integer","description":"Order total value in cents."},"origin":{"type":"string","description":"Order's origin in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196).","enum":["Marketplace","Fulfillment","Chain"]},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"sellerNames":{"type":"array","description":"Names of the sellers responsible for order fuflillment.","items":{"type":"string","description":"Seller name."}},"sellerIds":{"type":"array","description":"IDs of the sellers responsible for order fuflillment.","items":{"type":"string","description":"Seller ID."}},"sellerOrderId":{"type":"string","description":"Seller order ID."},"totalItems":{"type":"integer","description":"Order total quantity of items."},"pciTransactionId":{"type":"array","description":"List with the PCI transaction ID.","items":{"type":"string","description":"PCI transaction ID."}},"paymentNSU":{"type":"array","description":"Unique sequence number that identifies a sales transaction using cards.","items":{"type":"string","description":"NSU sequence number."}},"ratesAndBenefitsNames":{"type":"array","description":"List of the promotions and taxes names valid for the purchase.","items":{"type":"string","description":"Promotion or tax name."}},"ratesAndBenefitsIds":{"type":"array","description":"List of the promotions and taxes IDs valid for the purchase.","items":{"type":"string","description":"Promotion or tax ID."}},"shippingEstimatedDateMax":{"type":"string","description":"Maximum shipping estimated date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"shippingEstimatedDateMin":{"type":"string","description":"Minimum shipping estimated date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"transactionIds":{"type":"array","description":"Array with payment transaction IDs information.","items":{"type":"string","description":"Payment transaction ID."}},"paymentIds":{"type":"array","description":"Array with payment IDs information.","items":{"type":"string","description":"Payment unique identifier."}},"isInstore":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"deliveryChannel":{"type":"array","description":"List of delivery channels, which can be delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","items":{"type":"string","description":"Delivery channel.","enum":["delivery","pickup-in-point"]}},"productIds":{"type":"array","description":"List of product IDs related to the orders items.","items":{"type":"string","description":"Product ID."}},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"invoicedDate":{"type":["string","null"],"description":"Order invoice date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"authorizedDate":{"type":"string","description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderIsComplete":{"type":"boolean","description":"Defines if the order is complete (`true`) or [incomplete](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294) (`false`)."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the order.","items":{"type":"string","description":"Marketing tag name."}},"invoicesOutput":{"type":["array","null"],"description":"Information about order invoice `Output` operation, when the store sells an item to the customer.","items":{"type":["string","null"],"description":"The `Output` invoice number."}},"invoicesInput":{"type":["array","null"],"description":"Information about order invoice `Input` operation, when the customer returnes an item to the store.","items":{"type":["string","null"],"description":"The `Input` invoice number."}},"workflowInErrorState":{"type":"boolean","description":"Defines if the order processing in the workflow is in error (`true`) or not (`false`)."},"workflowInRetry":{"type":"boolean","description":"Defines if the order is in automatic processing retry in the workflow (`true`) or not (`false`)."},"userProfileId":{"type":"string","description":"User profile ID."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"isAllDelivered":{"type":"boolean","description":"Defines if all order items have being delivered (`true`) or not (`false`)."},"isAnyDelivered":{"type":"boolean","description":"Defines if any order item has being delivered (`true`) or not (`false`)."},"giftCardProviders":{"type":["array","null"],"description":"Order [gift card](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"string","description":"Gift card name."}},"orderFormId":{"type":"string","description":"ID of the shopping cart from which the order was created."},"paymentApprovedDate":{"type":"string","description":"Payment approval date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"readyForHandlingDate":{"type":["string","null"],"description":"Order ready for handling date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"deliveryDates":{"type":["array","null"],"description":"Array with delivery date information.","items":{"type":"string","description":"Order delivey date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}},"ingestPipelineMetadata":{"type":"array","description":"Array with order processing metadata.","items":{"type":"string","description":"Metadata information."}},"marketplaceWorkflowInstanceId":{"type":["string","null"],"description":"Marketplace workflow instance ID."},"fulfillmentWorkflowInstanceId":{"type":["string","null"],"description":"Seller workflow instance ID."},"callCenterOperatorEmail":{"type":["string","null"],"description":"Email of the call center operator responsible for the order, when applicable."},"callCenterOperatorName":{"type":["string","null"],"description":"Name of the call center operator responsible for the order, when applicable."},"productNames":{"type":"array","description":"List of the order product names.","items":{"type":"string","description":"Product name."}}}}},"facets":{"type":["array","null"],"description":"Array of facets.","items":{"type":["string","null"],"description":"Facets details."}},"paging":{"type":"object","description":"Pagination information.","required":["total","pages","currentPage","perPage"],"properties":{"total":{"type":"integer","description":"Total number of objects that exist for the `list` field, each corresponding to an order."},"pages":{"type":"integer","description":"Total number of pages."},"currentPage":{"type":"integer","description":"Number of the current page."},"perPage":{"type":"integer","description":"Number of objects per page that can be returned for the `list` field. The default value is `15` and the maximum value is `100`."}}},"stats":{"type":["object","null"],"description":"Information about stats.","required":["stats"],"properties":{"stats":{"type":"object","description":"Stats object.","required":["totalValue","totalItems"],"properties":{"totalValue":{"type":"object","description":"Stats total value.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count."},"Max":{"type":"integer","description":"Maximum value."},"Mean":{"type":"number","description":"Value mean."},"Min":{"type":"integer","description":"Minimum value."},"Missing":{"type":"integer","description":"Missing values."},"StdDev":{"type":"number","description":"Standard deviation."},"Sum":{"type":"integer","description":"Sum of values."},"SumOfSquares":{"type":"integer","format":"int64","description":"Value sum of squares."},"Facets":{"type":"object","description":"Facets related to total values.","required":["origin","currencyCode"],"properties":{"origin":{"type":"object","description":"Value facets origin.","required":["Fulfillment","Marketplace"],"properties":{"Fulfillment":{"type":"object","description":"Seller (fulfillment) facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to fulfillment."},"Max":{"type":"integer","description":"Maximum value related to fulfillment."},"Mean":{"type":"number","description":"Value mean related to fulfillment."},"Min":{"type":"integer","description":"Minimum related to fulfillment."},"Missing":{"type":"integer","description":"Missing values related to fulfillment."},"StdDev":{"type":"number","description":"Standard deviation related to fulfillment."},"Sum":{"type":"integer","description":"Value sum related to fulfillment."},"SumOfSquares":{"type":"integer","description":"Sum of squares related to fulfillment."},"Facets":{"type":["string","null"],"description":"Facets related to fulfillment."}}},"Marketplace":{"type":"object","description":"Marketplace facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to the marketplace."},"Max":{"type":"integer","description":"Maximum value related to the marketplace."},"Mean":{"type":"number","description":"Value mean related to the marketplace."},"Min":{"type":"integer","description":"Minimum value related to the marketplace."},"Missing":{"type":"integer","description":"Missing values related to the marketplace."},"StdDev":{"type":"number","description":"Standard deviation related to the marketplace."},"Sum":{"type":"integer","description":"Values sum related to the marketplace."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the marketplace."},"Facets":{"type":["string","null"],"description":"Facets related to the marketplace."}}}}},"currencyCode":{"type":"object","description":"Total value currency code in [ISO 4217](https://www.iban.com/currency-codes) format.","required":["BRL"],"properties":{"BRL":{"type":"object","description":"Currency code facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Value count related to the currency code."},"Max":{"type":"integer","description":"Maximum value related to the currency code."},"Mean":{"type":"number","description":"Value mean related to the currency code."},"Min":{"type":"integer","description":"Minimum value related to the currency code."},"Missing":{"type":"integer","description":"Missing values related to the currency code."},"StdDev":{"type":"number","description":"Standard deviation related to the currency code."},"Sum":{"type":"integer","description":"Sum of values related to the currency code."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the currency code."},"Facets":{"type":["string","null"],"description":"Facets related to the currency code."}}}}}}}}},"totalItems":{"type":"object","description":"Stats total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count."},"Max":{"type":"integer","description":"Maximum items."},"Mean":{"type":"number","description":"Total items mean."},"Min":{"type":"integer","description":"Minimum items."},"Missing":{"type":"integer","description":"Missing items."},"StdDev":{"type":"number","description":"Standard deviation."},"Sum":{"type":"integer","description":"Sum of items."},"SumOfSquares":{"type":"integer","format":"int64","description":"Items sum of squares."},"Facets":{"type":["object","null"],"description":"Facets related to total items.","required":["origin","currencyCode"],"properties":{"origin":{"type":"object","description":"Items facets origin.","required":["Fulfillment","Marketplace"],"properties":{"Fulfillment":{"type":"object","description":"Seller (fulfillment) facets information related to total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to fulfillment."},"Max":{"type":"integer","description":"Maximum of items related to fulfillment."},"Mean":{"type":"number","description":"Items mean related to fulfillment."},"Min":{"type":"integer","description":"Minimum of items related to fulfillment."},"Missing":{"type":"integer","description":"Missing items related to fulfillment."},"StdDev":{"type":"number","description":"Standard deviation related to fulfillment."},"Sum":{"type":"integer","description":"Sum of items related to fulfillment."},"SumOfSquares":{"type":"integer","description":"Items sum of squares related to fulfillment."},"Facets":{"type":["string","null"],"description":"Facets related to fulfillment."}}},"Marketplace":{"type":"object","description":"Marketplace facets information related to total items.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to the marketplace."},"Max":{"type":"integer","description":"Maximum of items related to the marketplace."},"Mean":{"type":"number","description":"Items mean related to the marketplace."},"Min":{"type":"integer","description":"Minimum of items related to the marketplace."},"Missing":{"type":"integer","description":"Missing items related to the marketplace."},"StdDev":{"type":"number","description":"Standard deviation related to the marketplace."},"Sum":{"type":"integer","description":"Sum of items related to the marketplace."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the marketplace."},"Facets":{"type":["string","null"],"description":"Facets related to the marketplace."}}}}},"currencyCode":{"type":"object","description":"Total items currency code in [ISO 4217](https://www.iban.com/currency-codes) format.","required":["BRL"],"properties":{"BRL":{"type":"object","description":"Currency code facets information.","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"properties":{"Count":{"type":"integer","description":"Items count related to the currency code."},"Max":{"type":"integer","description":"Maximum of items related to the currency code."},"Mean":{"type":"number","description":"Items mean related to the currency code."},"Min":{"type":"integer","description":"Minimum of items related to the currency code."},"Missing":{"type":"integer","description":"Missing items related to the currency code."},"StdDev":{"type":"number","description":"Standard deviation related to the currency code."},"Sum":{"type":"integer","description":"Sum of items related to the currency code."},"SumOfSquares":{"type":"integer","format":"int64","description":"Sum of squares related to the currency code."},"Facets":{"type":["string","null"],"description":"Facets related to the currency code."}}}}}}}}}}}}},"reportRecordsLimit":{"type":"integer","description":"Records limit."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of orders according to the query parameters used. The response returns masked order data. + + >⚠️ Throttling: Each account can make up to 6000 requests per minute. + + ## Endpoint not meant for integrations + This request only retrieves orders that have been indexed, which takes aproximately four minutes. The information returned also may present inconsistencies or become unavailable in periods of peak order volume. + + Therefore, you must not use the List orders endpoint for integrations. + + >⚠️ To get up to date information and [build order integrations](https://developers.vtex.com/vtex-rest-api/docs/erp-integration-set-up-order-integration) use the [orders Feed or Hook](https://developers.vtex.com/vtex-rest-api/docs/feed-v3-1). + + > Check the [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **List Orders** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | List Orders | + | Checkout Admin | List Orders | + | IntegrationProfile - Fulfillment Oms | List Orders | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API PII version/Orders/Start handling order.yml b/BrunoCollections/VTEX - Orders API PII version/Orders/Start handling order.yml new file mode 100644 index 0000000000..f3b23f6b7c --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Orders/Start handling order.yml @@ -0,0 +1,69 @@ +info: + name: Start handling order + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/actions/start-handling" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/pvt/document/:orderId/actions/start-handling - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/pvt/document/:orderId/actions/start-handling - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow to the `handling` status. + + >ℹ️ Successful requests receive a `204` status code with no content. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Change order workflow status** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Change order workflow status | + | IntegrationProfile - Fulfillment Gateway Oms | Change order workflow status | + | IntegrationProfile - Fulfillment Oms | Change order workflow status | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API PII version/Orders/folder.yml b/BrunoCollections/VTEX - Orders API PII version/Orders/folder.yml new file mode 100644 index 0000000000..0591326f3b --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: Orders + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Orders API PII version/Payment/Send payment notification.yml b/BrunoCollections/VTEX - Orders API PII version/Payment/Send payment notification.yml new file mode 100644 index 0000000000..d68c8d1d87 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Payment/Send payment notification.yml @@ -0,0 +1,69 @@ +info: + name: Send payment notification + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/payment/:paymentId/notify-payment" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: v71021948str-01 + type: path + - name: paymentId + value: B075A551595A43B0AD48DCD8EB481C7F + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/pvt/document/:orderId/payment/:paymentId/notify-payment - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends the payment notification of an order by searching by order ID and payment ID. + + > For more information about transaction details, check the article [Viewing the order's details in Orders](https://help.vtex.com/en/tutorial/viewing-the-orders-details-in-orders--tutorials_452). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify payment** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify payment | + | IntegrationProfile - Fulfillment Gateway | Notify payment | + | IntegrationProfile - Fulfillment Gateway Oms | Notify payment | + | IntegrationProfile - Fulfillment Oms | Notify payment | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `paymentId` | path | (Required) Payment ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API PII version/Payment/folder.yml b/BrunoCollections/VTEX - Orders API PII version/Payment/folder.yml new file mode 100644 index 0000000000..f33d1bf99d --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/Payment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Orders API PII version/environments/VTEX.yml b/BrunoCollections/VTEX - Orders API PII version/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Orders API PII version/opencollection.yml b/BrunoCollections/VTEX - Orders API PII version/opencollection.yml new file mode 100644 index 0000000000..81fcaf802a --- /dev/null +++ b/BrunoCollections/VTEX - Orders API PII version/opencollection.yml @@ -0,0 +1,26 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Orders API PII version + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + VTEX stores using the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus) must use this adapted version of the Orders API. Learn more about the modified behavior at [Changes in VTEX features behavior to handle PII data](https://developers.vtex.com/docs/guides/changes-in-vtex-features-behavior-to-handle-pii-data). + + >⚠️ The **Orders API - PII data architecture** is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in selected regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Orders API/Change seller/Get window to change seller.yml b/BrunoCollections/VTEX - Orders API/Change seller/Get window to change seller.yml new file mode 100644 index 0000000000..09fb44d480 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Change seller/Get window to change seller.yml @@ -0,0 +1,70 @@ +info: + name: Get window to change seller + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/checkout/pvt/configuration/window-to-change-seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/checkout/pvt/configuration/window-to-change-seller - Schema is valid", function () { + const schema = {"type":"integer","description":"Successful requests return the window to change seller value measured in days."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a marketplace's window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. + + + The default period for this window is of 2 days, but it can be configured by the request Update window to change seller. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 2 + ``` diff --git a/BrunoCollections/VTEX - Orders API/Change seller/Update window to change seller.yml b/BrunoCollections/VTEX - Orders API/Change seller/Update window to change seller.yml new file mode 100644 index 0000000000..0b13e3c4ae --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Change seller/Update window to change seller.yml @@ -0,0 +1,48 @@ +info: + name: Update window to change seller + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/checkout/pvt/configuration/window-to-change-seller" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "waitingTime": 4 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/checkout/pvt/configuration/window-to-change-seller - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a marketplace's window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. + + + It is possible to check the current window using the request Get window to change seller. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Change seller/folder.yml b/BrunoCollections/VTEX - Orders API/Change seller/folder.yml new file mode 100644 index 0000000000..459b55a3f0 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Change seller/folder.yml @@ -0,0 +1,4 @@ +info: + name: Change seller + type: folder + seq: 11 diff --git a/BrunoCollections/VTEX - Orders API/Conversation/Retrieve order conversation.yml b/BrunoCollections/VTEX - Orders API/Conversation/Retrieve order conversation.yml new file mode 100644 index 0000000000..5f7927a5db --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Conversation/Retrieve order conversation.yml @@ -0,0 +1,82 @@ +info: + name: Retrieve order conversation + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/conversation-message" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/pvt/orders/:orderId/conversation-message - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/conversation-message - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/conversation-message - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/conversation-message - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"GetConversation","required":["id","from","to","subject","firstWords","body","hasAttachment","attachmentNames","date"],"type":"object","properties":{"id":{"type":"string","description":"Conversation ID."},"from":{"title":"From","description":"Conversation sender.","required":["conversationRelatedTo","conversationSubject","emailAlias","aliasMaskType","email","name","role"],"type":"object","properties":{"conversationRelatedTo":{"type":"string","description":"Related order ID."},"conversationSubject":{"type":"string","description":"Conversation subject."},"emailAlias":{"type":"string","description":"Sender transactional tracker email."},"aliasMaskType":{"type":"integer","description":"Conversation tracker mask type."},"email":{"type":"string","description":"Sender's email."},"name":{"type":"string","description":"Sender's name."},"role":{"type":["string","null"],"description":"If it is a client or null, for transactional emails."}}},"to":{"type":"array","items":{"title":"To","description":"Conversation receiver.","required":["conversationRelatedTo","conversationSubject","emailAlias","aliasMaskType","email","name","role"],"type":"object","properties":{"conversationRelatedTo":{"type":"string","description":"Related order ID."},"conversationSubject":{"type":"string","description":"Conversation subject."},"emailAlias":{"type":"string","description":"Sender transactional tracker email."},"aliasMaskType":{"type":"integer","description":"Conversation tracker mask type."},"email":{"type":"string","description":"Receiver's email."},"name":{"type":"string","description":"Receiver's name."},"role":{"type":"string","description":"If it is a customer or null, for transactional emails."}}},"description":"Conversation receiver."},"subject":{"type":"string","description":"Conversation content subject."},"firstWords":{"type":"string","description":"First words of Conversation content."},"body":{"type":"string","description":"Conversation content body."},"hasAttachment":{"type":"boolean","description":"When set as `true`, it means there are attachments, when set as `false`, there are not."},"attachmentNames":{"type":"array","items":{"type":"string","description":"Name of the attachment."},"description":"List with attachments' names, if there are any."},"date":{"type":"string","description":"Conversation date."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + List all order conversations of an order by its order ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Conversation/folder.yml b/BrunoCollections/VTEX - Orders API/Conversation/folder.yml new file mode 100644 index 0000000000..5fcebcbbad --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Conversation/folder.yml @@ -0,0 +1,4 @@ +info: + name: Conversation + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/Get feed order status.yml b/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/Get feed order status.yml new file mode 100644 index 0000000000..7e935ad966 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/Get feed order status.yml @@ -0,0 +1,44 @@ +info: + name: Get feed order status + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/feed/orders/status?maxLot={{maxLot}}" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: maxLot + value: "{{maxLot}}" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/oms/pvt/feed/orders/status - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Get feed order status (deprecated) + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `maxLot` | query | (Required) Maximum lot. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/folder.yml b/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/folder.yml new file mode 100644 index 0000000000..e6098ea49f --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v2 (deprecated)/folder.yml @@ -0,0 +1,4 @@ +info: + name: Feed v2 (deprecated) + type: folder + seq: 7 diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Commit feed items.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Commit feed items.yml new file mode 100644 index 0000000000..8b9f1db081 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Commit feed items.yml @@ -0,0 +1,47 @@ +info: + name: Commit feed items + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/orders/feed" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "handles": [ + "AQEBSM/bSqonHYtx+UrHdbuJ0i7M9yMbI2jtYwMIPdEc4BenuneaCTC9VEJ3dgAy1XtfQvHBvgwZTO8LvGObIKNqiKXDZiMKY25vK+pblZEqf1pWdLMugu5XoHA5ZAd4IcBcXrBcrlr1GU8uvPEBoVLOsVBP9IAxIZkkeEedIDg3K6GPyEXVuPlTEYb/0OCunEGxWF+AZ1frFdXh7ulORTcuqO5oDlBGbpD+QYzCmF4mUZtQ0VVWh9icM1QBVh6PlJ0D/lfwnJKWpBn3jf8c+DTm7sD7wb1Lcz9uWMLhDtPwvH9vue4MvKU9sCahEQe7K5jWuwwb54szGbFKdfcACsTSQ9WlyBfMdbV83c27k68G3cnaBFExkC1MLHHE9UzpQ6l4s43BT4k95ocgMXffnj/HMUYXn+OCvlvjytY59x1OCRE=" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/feed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Commit items in the [feed](https://developers.vtex.com/docs/guides/orders-feed) queue. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Create or update feed configuration.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Create or update feed configuration.yml new file mode 100644 index 0000000000..f2282b44ae --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Create or update feed configuration.yml @@ -0,0 +1,69 @@ +info: + name: Create or update feed configuration + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/orders/feed/config" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "filter": { + "type": "FromOrders", + "expression": "value > 100", + "disableSingleFire": false + }, + "queue": { + "visibilityTimeoutInSeconds": 250, + "MessageRetentionPeriodInSeconds": 345600 + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/orders/feed/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + The Orders Feed v3 is the best way to create order integrations. Below you can find details on the configuration API specification, and to know more see our [Feed v3 guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed) and our [order integration guide](https://developers.vtex.com/vtex-rest-api/docs/erp-integration-set-up-order-integration) + + + There are two types of filtering that can be used. The `FromWorkflow` type filters orders by status, whereas the `FromOrders` type uses JSONata expressions to filter orders according to any property in the orders JSON document. This enables stores to filter delivered orders and orders in which products have been added or removed, for example. To learn more, access the [JSONata documentation](https://docs.jsonata.org/overview.html) and test filtering JSONata expressions with our [Test JSONata expression](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/expressions/jsonata) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS Access | **Feed v3 and Hook view only** | + | OMS | OMS Access | **Feed v3 and Hook Admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Delete feed configuration.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Delete feed configuration.yml new file mode 100644 index 0000000000..131dadfd0e --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Delete feed configuration.yml @@ -0,0 +1,52 @@ +info: + name: Delete feed configuration + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/orders/feed/config" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/orders/feed/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the configuration set up in [Feed v3](https://developers.vtex.com/docs/guides/orders-feed). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS Access | **Feed v3 and Hook view only** | + | OMS | OMS Access | **Feed v3 and Hook Admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Get feed configuration.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Get feed configuration.yml new file mode 100644 index 0000000000..fb50f20a8a --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Get feed configuration.yml @@ -0,0 +1,96 @@ +info: + name: Get feed configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/orders/feed/config" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/orders/feed/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/orders/feed/config - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/orders/feed/config - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/orders/feed/config - Schema is valid", function () { + const schema = {"type":"object","properties":{"filter":{"type":"object","description":"Information on how orders are filtered to show on the feed.","properties":{"type":{"type":"string","description":"Determines what orders appear in the feed and how they are filtered. If a feed has the `FromWorkflow` type configuration, it will receive order updates only when order's statuses change and orders can be filtered by status, using the `status` field. A feed with the `FromOrders` type configuration gets updates whenever any change is made to an order. in this case, orders can be filtered by any property, according to JSONata expressions set in the `expression` field."},"status":{"type":"array","description":"List of order statuses that should be included in the feed. This should only be used in case `type` is `FromWorkflow`.","items":{"type":"string","description":"Order status to be filtered in the feed."}},"expression":{"type":"string","description":"JSONata query expression that defines what conditions must be met for an order to be included in the feed. This should only be used in case `type` is `FromOrders`."},"disableSingleFire":{"type":"boolean","description":"Sets a limit to how many times a specific order shows on the feed, after it first meets filtering conditions. Using the `FromOrders` type configuration with JSONata filtering expressions might cause orders to appear more than once on a feed, whenever changes are made to that order. If this field is `false` orders will appear in the feed only once."}}},"queue":{"type":"object","description":"Information that define the functioning of the queue.","properties":{"visibilityTimeoutInSeconds":{"type":"integer","description":"Period of time for which an item is not visible in the feed after it has been retrieved with the Get feed items request. Measured in seconds."},"MessageRetentionPeriodInSeconds":{"type":"integer","description":"Maximum life span of an order update after it gets to the feed. When a feed item is on the feed for this period of time, it is removed from the feed. Measured in seconds. The maximum number accepted in this field is `1209600` seconds."}}},"quantity":{"type":"integer","description":"Current number of messages in the feed, including messages that may not be visible due to time out after retrieval."},"approximateAgeOfOldestMessageInSeconds":{"type":"number","description":"Aproximate age of the oldest message in the feed, measured in seconds."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + The Orders Feed v3 is the best way to create order integrations. Below you can find details on the configuration API specification, and to know more see our [Feed v3 guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed) and our [order integration guide](https://developers.vtex.com/vtex-rest-api/docs/erp-integration-set-up-order-integration). + + > 📘 Onboarding guide + > + > Check the new [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS Access | **Feed v3 and Hook view only** | + | OMS | OMS Access | **Feed v3 and Hook Admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "filter": { + "type": "FromOrders", + "expression": "status = \"payment-pending\"", + "disableSingleFire": false + }, + "queue": { + "visibilityTimeoutInSeconds": 240, + "messageRetentionPeriodInSeconds": 345600 + }, + "quantity": 127, + "approximateAgeOfOldestMessageInSeconds": 78.91597222222222 + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Retrieve feed items.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Retrieve feed items.yml new file mode 100644 index 0000000000..b5514d9b05 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Retrieve feed items.yml @@ -0,0 +1,87 @@ +info: + name: Retrieve feed items + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/orders/feed?maxlot={{maxLot}}" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: maxlot + value: "{{maxLot}}" + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/orders/feed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/orders/feed - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/orders/feed - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/orders/feed - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Getfeedorderstatus","required":["eventId","handle","domain","state","lastState","orderId","lastChange","currentChange"],"type":"object","properties":{"eventId":{"type":"string"},"handle":{"type":"string"},"domain":{"type":"string"},"state":{"type":"string"},"lastState":{"type":"string"},"orderId":{"type":"string"},"lastChange":{"type":"string"},"currentChange":{"type":"string"}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve items from [feed](https://developers.vtex.com/docs/guides/orders-feed) queue. + + The event will be removed if the message `send retry` is equal to, or greater than the maximum retention period. + + > This API will return `404 Not Found` if there is no [Feed Configuration](https://developers.vtex.com/docs/guides/orders-feed) available for the given X-VTEX-API-AppKey. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `maxlot` | query | (Required) Lot quantity to retrieve. Maximum accepted value is 10. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "eventId": "ED423DDED4C1AE580CADAC1A4D02DA3F", + "handle": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoidnRleGFwcGtleS1wYXJ0bmVyc2xhdGFtLVJNQkpNUyIsIkFwcEtleSI6InZ0ZXhhcHBrZXktcGFydG5lcnNsYXRhbS1STUJKTVMiLCJBY2NvdW50IjoicGFydG5lcnNsYXRhbSIsIkhhbmRsZSI6IkFRRUIzbmtWR0piOXhhNGRjYlpkOTFVVWMyL2JObHc0Qnp3ZlNLV201Rjg2QXgrSGlRM053bEJkb2NwM2wvVytLdjFNQTZ4d3ZLcFYwYjlSeUttNVRpb3hrSVFMSG1Uck9xenB2aFlwU29uMzRrVmlNaWZHY2lnZFFqalBJdk00eWU4amVuaS9QKytaTmVxOFZWeFNGay81Yzg3YS84MTRjTFg2WGZPR2x2WitlTnVjTzA3S3UxK0xXaU5vQmJEY0cycGxKekxkRks3Qld3b1NTV3BmSWhrOGhmSFNkSzlzZVpJeG01QXFLbHFrUHNDNGk5emVaYVpBUVVrSi9aZWo3UjRrRDVRaXFjNmpjcnFheEdHc1lsNHMzUWM0ZmtWdmhYblJVQ2l2ZGdpMEtUYS8zcXlWWU9QTktIV2huTlZxMEZHNDNjME4vaWh6dDc0d1laNVl6aDFJRitHU2t1YTkrN1pCdnQ2VGs1cFRhZmVVclk0ckNPL2Fobnl1eXFLOG53ZkorVWxUTmt2ZVNFS29FdTNiUWQzSmc5R1lYWHlXOVVxRGo5dHJIZ1N5M3ZZa0dBWjd0MDZNZWUwQnBsdFBxWExaIiwiT3JkZXJJZCI6Ijk1MzcxMjAwNDEyNi0wMSIsIk1lc3NhZ2VJZCI6ImI5YjI4NDkwLTNjNzAtNDdjNi1hMTE3LWNhN2FjMTk2MDY1OSIsIkRvbWFpbiI6IkZ1bGZpbGxtZW50IiwiU3RhdGUiOiJyZWFkeS1mb3ItaGFuZGxpbmciLCJMYXN0U3RhdGUiOiJ3aW5kb3ctdG8tY2FuY2VsIiwiTGFzdENoYW5nZSI6IjA4LzEyLzIwMTkgMjA6NTQ6MDEiLCJDdXJyZW50Q2hhbmdlIjoiMDgvMTIvMjAxOSAyMDo1NDoyMyIsIkNyZWF0ZWRBdCI6IjA4LzEyLzIwMTkgMjE6MDE6MzAiLCJpc3MiOiJicm9hZGNhc3QtYXBpLnZ0ZXhjb21tZXJjZS5jb20uYnIiLCJhdWQiOiJwYXJ0bmVyc2xhdGFtX3Z0ZXhhcHBrZXktcGFydG5lcnNsYXRhbS1STUJKTVMifQ.7RQBZQb6pHhFhA_jMKTiSoJbDck7awgD3Xx7sdJcW6w", + "domain": "Fulfillment", + "state": "ready-for-handling", + "lastState": "window-to-cancel", + "orderId": "953712004126-01", + "lastChange": "2019-08-12T20:54:01.134057Z", + "currentChange": "2019-08-12T20:54:23.7153839Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/Test JSONata expression.yml b/BrunoCollections/VTEX - Orders API/Feed v3/Test JSONata expression.yml new file mode 100644 index 0000000000..8e3e4caae1 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/Test JSONata expression.yml @@ -0,0 +1,80 @@ +info: + name: Test JSONata expression + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/orders/expressions/jsonata" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "Expression": "status = \\\"canceled\\\"", + "Document": "{\\\"status\\\":\\\"canceled\\\"}" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/expressions/jsonata - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/expressions/jsonata - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/expressions/jsonata - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/expressions/jsonata - Schema is valid", function () { + const schema = {"type":"boolean","description":"Successful requests return the message `true`."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to test a JSON document with a JSONata expression, returning `true` if the document meets the criteria posed in the expression, or `false` if it does not. + + + Since JSONata expressions can be used to filter order updates in the [Orders API feed and hook](https://developers.vtex.com/docs/guides/orders-feed), this endpoint can be used to test an expression's results before configuring the [feed or hook](https://developers.vtex.com/docs/guides/orders-feed). + + + Learn more about how to use JSONata expressions, in the [JSONata documentation](https://docs.jsonata.org/overview.html). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Orders API/Feed v3/folder.yml b/BrunoCollections/VTEX - Orders API/Feed v3/folder.yml new file mode 100644 index 0000000000..2692d6c212 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Feed v3/folder.yml @@ -0,0 +1,4 @@ +info: + name: Feed v3 + type: folder + seq: 8 diff --git a/BrunoCollections/VTEX - Orders API/Invoice/Order invoice notification.yml b/BrunoCollections/VTEX - Orders API/Invoice/Order invoice notification.yml new file mode 100644 index 0000000000..16bb2b2a3c --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Invoice/Order invoice notification.yml @@ -0,0 +1,154 @@ +info: + name: Order invoice notification + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/invoice" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + body: + type: json + data: |- + { + "type": "Output", + "issuanceDate": "2024-01-31T18:25:43-05:00", + "invoiceNumber": "DFG-v7731485plzv-01", + "invoiceValue": "2499", + "invoiceKey": "CFe35201100063960001504590006629690333214542150", + "invoiceUrl": "https://luxstore.com/invoices/24382.pdf", + "embeddedInvoice": "\r\n\r\n\r\n37\r\n000005177\r\nVenda a vista\r\n0\r\n55\r\n1\r\n1\r\n2018-07-06\r\n2018-07-06\r\n0\r\n79950308\r\n1\r\n1\r\n3\r\n2\r\n1\r\n0\r\nNF-eletronica.com\r\n\r\n\r\n99999090998760\r\nNF-e Associacao NF-e\r\nNF-e\r\n\r\nRua Central\r\n100\r\nFundos\r\nDistrito Industrial\r\n0000000\r\nMunicípio\r\nSP\r\n0000000\r\n1058\r\nBrasil\r\n1733021717\r\n\r\n123456789012\r\n\r\n\r\n00000000000000\r\nDISTRIBUIDORA DE AGUAS MINERAIS\r\n\r\nAV DAS FONTES\r\n1777\r\n1001 ANDAR\r\nPARQUE\r\n0000000\r\nSao Paulo\r\nSP\r\n00000000\r\n1058\r\nBRASIL\r\n3900000000\r\n\r\n \r\n\r\n\r\n000000000004\r\nAV PAULISTA\r\n12345\r\nTERREO\r\nCERQUEIRA CESAR\r\n0000000\r\nSAO PAULO\r\nSP\r\n\r\n\r\n00000000299000194\r\nAV FARIA LIMA\r\n154400\r\n156 ANDAR\r\nPINHEIROS\r\n0000308\r\nSAO PAULO\r\nSP\r\n\r\n\r\n\r\n00001\r\n\r\nAgua Mineral\r\n5101\r\ndz\r\n1000000.0000\r\n1\r\n10000000.00\r\n\r\nund\r\n12000000.0000\r\n1\r\n\r\n\r\n\r\n\r\n0\r\n00\r\n0\r\n10000000.00\r\n18.00\r\n1800000.00\r\n\r\n\r\n\r\n\r\n01\r\n10000000.00\r\n0.65\r\n65000\r\n\r\n\r\n\r\n\r\n01\r\n10000000.00\r\n2.00\r\n200000.00\r\n\r\n\r\n\r\n\r\n\r\n\r\n00002\r\n\r\nAgua Mineral\r\n5101\r\npack\r\n5000000.0000\r\n2\r\n10000000.00\r\n\r\nund\r\n3000000.0000\r\n0.3333\r\n\r\n\r\n\r\n\r\n0\r\n00\r\n0\r\n10000000.00\r\n18.00\r\n1800000.00\r\n\r\n\r\n\r\n\r\n01\r\n10000000.00\r\n0.65\r\n65000\r\n\r\n\r\n\r\n\r\n01\r\n10000000.00\r\n2.00\r\n200000.00\r\n\r\n\r\n\r\n\r\n\r\n\r\n20000000.00\r\n18.00\r\n0\r\n0\r\n20000000.00\r\n0\r\n0\r\n0\r\n0\r\n0\r\n130000.00\r\n400000.00\r\n0\r\n20000000.00\r\n\r\n\r\n\r\n0\r\n\r\n00000000000000\r\nDistribuidora de Bebidas Fazenda de SP Ltda.\r\n00000000999119\r\nRua Central 100 - Fundos - Distrito Industrial\r\nSAO PAULO\r\nSP\r\n\r\n\r\nBXI1717\r\nSP\r\n123456789\r\n\r\n\r\nUUU0000\r\nSP\r\n123456789\r\n\r\n\r\n10000\r\nCAIXA\r\nLINDOYA\r\n500\r\n1000000000.000\r\n1200000000.000\r\n\r\nXYZ10231486\r\n\r\n\r\n\r\n\r\nNota Fiscal de exemplo NF-eletronica.com\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nxFzhgdgnhjSD1e9uqe04lnoHT4ZzLSY=\r\n\r\n\r\n\r\nIz5Z3PLQbzZt9jnBtr6xsmHZMOu/3plXG9xxfFjRCQYGnD1rjlhzBGrqt026Ca2VHHM/bHNepi6FuFkAi595GScKVuHREUotzifE2OIjgavvTOrMwbXG7+0LYgkwPFiPCao2S33UpZe7MneaxcmKQGKQZw1fP8fsWmaQ4cczZT8=\r\n\r\n\r\n\r\n\r\nMIIEuzCCA6OgAwIBAgIDMTMxMA0GasfFSDAGQUAMIGSMQswCQYDVQQGEwJCUjELMAkGA1UECBMCUlMxFTATBgNVBAcTDFBvcnRvIEFsZWdyZTEdMBsGA1UEChMUVGVzdGUgUHJvamV0byBORmUgUlMxHTAbBgNVBAsTFFRlc3RlIFByb2pldG8gTkZlIFJTMSEwHwYDVQQDExhORmUgLSBBQyBJbnRlcm1lZGlhcmlhIDEwHhcNMDgwNDI4MDkwMTAyWhcNMDkwNDMwMjM1OTU5WjCBnjELMAkGA1UECBMCUlMxHTAfvw4567DRhg76FByb2pldG8gTkZlIFJTMR0wGwYDVQQKExRUZXN0ZSBQcm9qZXRvIE5GZSBSUzEVMBMGA1UEBxMMUE9SVE8gQUxFR1JFMQswCQYDVQQGEwJCUjEtMCsGA1UEAxMkTkZlIC0gQXNzb2NpYWNhbyBORi1lOjk5OTk5MDkwOTEwMjcwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDh6RRv0bj4RYX+tDQrZRb5opa77LBVVs+6LphIfSF3TSWPfnKh0+xLlBFdmnB5YGgbbW9Uon6pZQTfaC8jZhRhI5eFRRofY/Ugoeo0NGt6PcIQNZQd6lLQ/ASd1qWwjqJoEa7udriKjy3h351Mf1bng1VxS1urqC3Dn39ZWIEwQIDAQABo4IBjjCCAYowIgYDVR0jAQEABBgwFoAUPT5TqhNWAm+ZpcVsvB7malDBjEQwDwYDVR0TAQH/BAUwAwEBADAPBgNVHQ8BAf8EBQMDAOAAMAwGA1UdIAEBAAQCMAAwgbwGA1UdEQEBAASBsTCBrqA4BgVgTAEDBKAvBC0wNzA4MTk1MTE1MTk0NTMxMDg3MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDCgHQYFYEwBAwKgFAQSRmVybmFuZG8gQ2FudG8gQWx0oBkGBWBMAQMDoBAEDjk5OTk5MDkwOTEwMjcwoBcGBWBMAQMHoA4EDDAwMDAwMDAwMDAwMIEfZmVybmFuZG8tYWx0QHByb2NlcmdzLnJzLmdvdi5icjAgBgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwUwYDVR0fAQEABEkwRzBFoEOgQYY/aHR0cDovL25mZWNlcnRpZmljYWRvLnNlZmF6LnJzLmdvdi5ici9MQ1IvQUNJbnRlcm1lZGlhcmlhMzguY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCNPpaZ3Byu3/70nObXE8NiM53j1ddIFXsb+v2ghCVd4ffExv3hYc+/a3lfgV8H/WfQsdSCTzS2cHrd4Aasr/eXfclVDmf2hcWz+R7iysOHuT6B6r+DvV3JcMdJJCDdynR5REa+zViMnVZo1G3KuceQ7/y5X3WFNVq4kwHvonJ9oExsWyw8rTwUK5bsjz0A2yEwXkmkJIngnF41sP31+9jCImiqkXcmsesFhxzX7iurAQAQCZOm7iwMWxQKcAjXCZrgSZWRQy6mU224sX3HTArHahmLJ9Iw+WYAua5qBJsiN6PC7v5tfhdsgGD46DHMnOecxvkkPolDUyBa7d7xwgm\r\n\r\n\r\n\r\n\r\n", + "courier": "carrierOne", + "trackingNumber": "87658", + "trackingUrl": "https://www.tracking.com/url", + "dispatchedDate": "2019-02-08T13:16:13.4617653+00:00", + "items": [ + { + "id": "123", + "price": 2499, + "description": "335", + "quantity": 2 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/oms/pvt/orders/:orderId/invoice - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/invoice - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/invoice - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/invoice - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Date and time when the notification was received."},"orderId":{"type":"string","description":"Identification of the order in the seller."},"receipt":{"type":"string","description":"Protocol code generated by the update that identifies the receipt. Every time this endpoint is called using the same `invoiceNumber`, a new `receipt` code is generated, and it overrides the previous one."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is used for [invoicing an order](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/2WgQrlHTyVo4hLjhUs1LMT). Entering the order's invoice means it was successfully completed, and the order status can be changed to `invoiced` in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). Once an order is `invoiced`, its status cannot be changed. + + After the insertion of the invoice, the order's total value will be updated, even in [partial invoice](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) scenarios. + + >❗ To avoid rounding errors, we recommend always sending the object of items being invoiced. + + ## Partial invoices + + After adding a [partial invoice](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe), the order's value will be updated, corresponding to a partial settled value in the VTEX payment gateway. + + Partially invoiced orders cannot be canceled, and cancellation attempts will result in a `400` status code error. If the customer wants to replace or remove items, it is possible to [change the order](https://developers.vtex.com/docs/guides/change-order). + + > The partial invoices feature is available for all VTEX stores. The partial settlement in the gateway is in Beta, and requires a connector with the Payment Provider Protocol. + + ## Returning items + + Besides using this endpoint for generating invoices for sold items, you can use it for generating invoices for returned items. You determine this in the request body `type` field by choosing one of the following values: + + - `Output`: selling order invoice. + + - `Input`: returning items invoice. + + Be aware of generating return invoices only after the full order amount was invoiced, otherwise, no refund will occur. + + >⚠️ Generating a return `(type: Input)` invoice with this endpoint will automatically create a refund without the need of additional API requests. + + ## Changing the receipt code + + Every time this endpoint is called using the same `invoiceNumber`, a new `receipt` code is generated, and it overrides the previous one. By doing this, you cannot change other information, only the `receipt` code. + + ## Integration with marketplaces + + The invoice should be pushed to the fulfillment account, not to the marketplace account. Once the order is invoiced, the seller should use this request to send the invoice information to the marketplace. + + This endpoint is also used by the seller to send the order tracking information. However, this only should be done after the seller has the tracking information. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + | OMS | OMS access | **Notify refund** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Cancel order | + | IntegrationProfile - Fulfillment Oms | Cancel order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Unique code that identifies the order whose invoice is being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2024-02-07T15:22:56.7612218-02:00", + "orderId": "123543123", + "receipt": "38e0e47da2934847b489216d208cfd91" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Invoice/Update order's partial invoice (send tracking number).yml b/BrunoCollections/VTEX - Orders API/Invoice/Update order's partial invoice (send tracking number).yml new file mode 100644 index 0000000000..bf7bee5345 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Invoice/Update order's partial invoice (send tracking number).yml @@ -0,0 +1,109 @@ +info: + name: Update order's partial invoice (send tracking number) + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + - name: invoiceNumber + value: "000030711" + type: path + body: + type: json + data: |- + { + "trackingNumber": "87658", + "trackingUrl": "https://www.tracking.com/url", + "courier": "carrierOne", + "dispatchedDate": "2022-02-08T13:16:13.4617653+00:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber - Schema is valid", function () { + const schema = {"title":"Updatepartialinvoice.SendTrackingNumber","required":["date","orderId","receipt"],"type":"object","properties":{"date":{"type":"string"},"orderId":{"type":"string"},"receipt":{"type":"string"}},"example":{"date":"2019-02-08T13:16:13.4617653+00:00","orderId":"00-v5195004lux-01","receipt":"527b1ae251264ef1b7a9b597cd8f16b9"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Update a given order, adding its tracking number to its [Partial invoice](https://help.vtex.com/en/tracks/pedidos--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe). + + + After using this call to add a tracking number to an order, you can use the [Update order tracking status](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-/tracking) API request to add tracking events. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify invoice | + | IntegrationProfile - Fulfillment Oms | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Unique code that identifies the order whose invoice is being sent. | + | `invoiceNumber` | path | (Required) Number that identifies the invoice. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "date": "2019-02-08T13:16:13.4617653+00:00", + "orderId": "00-v5195004lux-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Invoice/folder.yml b/BrunoCollections/VTEX - Orders API/Invoice/folder.yml new file mode 100644 index 0000000000..894bda8cd1 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Invoice/folder.yml @@ -0,0 +1,4 @@ +info: + name: Invoice + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Orders API/Order hook/Create or update hook configuration.yml b/BrunoCollections/VTEX - Orders API/Order hook/Create or update hook configuration.yml new file mode 100644 index 0000000000..e467131e32 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order hook/Create or update hook configuration.yml @@ -0,0 +1,109 @@ +info: + name: Create or update hook configuration + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/orders/hook/config" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "filter": { + "type": "FromOrders", + "expression": "value > 100", + "disableSingleFire": false + }, + "hook": { + "url": "https://endpoint.example/path", + "headers": { + "key": "value" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/orders/hook/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/orders/hook/config - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/orders/hook/config - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/orders/hook/config - Schema is valid", function () { + const schema = {"title":"HookConfiguration","required":["Domain","OrderId","State","LastState","LastChange","CurrentChange","Origin"],"type":"object","properties":{"Domain":{"type":"string"},"OrderId":{"type":"string"},"State":{"type":"string"},"LastState":{"type":"string"},"LastChange":{"type":"string"},"CurrentChange":{"type":"string"},"Origin":{"title":"Origin2","required":["Account","Key"],"type":"object","properties":{"Account":{"type":"string"},"Key":{"type":"string"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Configures filtering rules applied to orders hook. Learn more with the [orders hook guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed#hook). + + + There are two types of filtering that can be used: + + + - `FromWorkflow`: filters orders by status. + + + - `FromOrders`: uses JSONata expressions to filter orders according to any property in the orders JSON document. + + + This enables stores to filter delivered orders and orders in which products have been added or removed, for example. + + + To learn more, access the [JSONata documentation](https://docs.jsonata.org/overview.html) and test filtering JSONata expressions with our [expressions API](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/expressions/jsonata). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Domain": "Fulfillment", + "OrderId": "v52277740atmc-01", + "State": "ready-for-handling", + "LastState": "window-to-cancel", + "LastChange": "2019-08-14T17:11:39.2550122Z", + "CurrentChange": "2019-08-14T17:12:48.0965893Z", + "Origin": { + "Account": "automacaoqa", + "Key": "vtexappkey-appvtex" + } + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Order hook/Delete hook configuration.yml b/BrunoCollections/VTEX - Orders API/Order hook/Delete hook configuration.yml new file mode 100644 index 0000000000..4abfd51dfc --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order hook/Delete hook configuration.yml @@ -0,0 +1,42 @@ +info: + name: Delete hook configuration + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/orders/hook/config" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/orders/hook/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a given hook configuration. + + + Learn more with the [orders hook guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed#hook). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Order hook/Get hook configuration.yml b/BrunoCollections/VTEX - Orders API/Order hook/Get hook configuration.yml new file mode 100644 index 0000000000..df6e5ad84e --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order hook/Get hook configuration.yml @@ -0,0 +1,72 @@ +info: + name: Get hook configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/orders/hook/config" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: clientEmail + value: customer@mail.com + type: query + disabled: true + - name: page + value: "10" + type: query + disabled: true + - name: per_page + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/orders/hook/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a given hook's configuration details. Learn more with the [orders hook guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed#hook). + + > 📘 Onboarding guide + > + > Check the new [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS Access | **Feed v3 and Hook view only** | + | OMS | OMS Access | **Feed v3 and Hook Admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `clientEmail` | query | Customer email. | + | `page` | query | Page number for result pagination. | + | `per_page` | query | Page quantity for result pagination. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Order hook/folder.yml b/BrunoCollections/VTEX - Orders API/Order hook/folder.yml new file mode 100644 index 0000000000..6742988557 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order hook/folder.yml @@ -0,0 +1,4 @@ +info: + name: Order hook + type: folder + seq: 9 diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Cancel order modifications.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Cancel order modifications.yml new file mode 100644 index 0000000000..c6c0362cba --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Cancel order modifications.yml @@ -0,0 +1,85 @@ +info: + name: Cancel order modifications + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes/:changeRequestId/cancel?an=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + - name: changeRequestId + value: e8532a32-7f7e-434a-88ec-29609f0ede46 + type: path + body: + type: json + data: |- + { + "reason": "I want to cancel this order modification request because it's stopped on a blocking error." + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint cancels an [order modification](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes). It is meant for when, due to an error, a modification was not completely processed, and you do not wish to [retry](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/order-system/orders/-changeOrderId-/changes/-changeRequestId-/retry) it. For this request, you need the order's `changeRequestId`, the unique identification code generated by the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint. + + >⚠️ Once an order modification has been successfully processed, canceling it is no longer possible. If you wish to revert the modifications made to an order, you will have to [create a new order modification](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order with the modifications you wish to cancel. | + | `changeRequestId` | path | (Required) Once you make an order modification, you generate a `requestId` code that identifies the modifications made to that order. This field should be filled with that code. After cancelling an order modification, the `changeRequestId` will no longer be valid. | + | `an` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Create order modifications.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Create order modifications.yml new file mode 100644 index 0000000000..d7ef6a8f3e --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Create order modifications.yml @@ -0,0 +1,422 @@ +info: + name: Create order modifications + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes?accountName=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + body: + type: json + data: |- + { + "reason": "The client wants to change a weighable product.", + "replace": [ + { + "from": { + "items": [ + { + "id": "1", + "quantity": 1, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "price": 2499 + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B177D2F9F96DC711" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-OLD" + } + ] + } + ] + } + }, + "to": { + "items": [ + { + "id": "2", + "quantity": 1, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "measurementUnit": "kg", + "unitMultiplier": 3, + "manualDiscountValue": 0, + "manualIncrementValue": 0, + "clientProfileData": [ + { + "firstName": "Jane", + "lastName": "Earhart", + "documentType": "cpf", + "document": "123456789", + "phone": "55110988887777", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false + } + ] + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B133D2F9F96DC713" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-NEW" + } + ] + } + ] + }, + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "price": 1000 + } + ] + } + } + } + ], + "settings": { + "paymentConfiguration": { + "customPaymentSystemsAllowed": [ + "201" + ] + }, + "rolloutConfiguration": { + "enableApi": true, + "enableAdminOrders": { + "enabledWorkspaces": [ + "*" + ] + }, + "enableMyOrders": { + "enabledWorkspaces": [ + "storename" + ] + } + }, + "pipelineConfiguration": { + "enableTaxHubRecalculation": false, + "compensateShippingChanges": true, + "enablePromotionRecalculation": true, + "enableNativeTaxRecalculation": true + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/order-system/orders/:changeOrderId/changes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/order-system/orders/:changeOrderId/changes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/order-system/orders/:changeOrderId/changes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/order-system/orders/:changeOrderId/changes - Schema is valid", function () { + const schema = {"required":["requestId","workflowId","reason","manualDiscountValue","manualIncrementValue","totalChangeValue","totals","add","remove","replace","date","origin","settings"],"type":"object","properties":{"requestId":{"type":"string","description":"Unique code that identifies an order modification request."},"workflowId":{"type":"string","description":"Code that identifies the transaction of modifying the orders in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"reason":{"type":"string","description":"Reason that motivated the order modifications."},"manualDiscountValue":{"type":"integer","description":"This field shows if a manual price was applied to the total order amount. The value is in cents."},"manualIncrementValue":{"type":"integer","description":"This field shows if an increment value was applied to the total order amount. The value is in cents."},"totalChangeValue":{"type":"integer","description":"This field shows how much the order total price is considering that price modifications might have been made. The value is in cents."},"totals":{"type":"array","items":{"type":"string","description":"Item changing price details."},"description":"Array containing information about change prices per item."},"add":{"type":["array","null"],"description":"Array with information about the `add` operation, when applicable. The schema will correspond to the object `to` inside the `replace` array.","items":{"type":"string","description":"Adding details."}},"remove":{"type":["array","null"],"description":"Array with information about the `remove` operation, when applicable. The schema will correspond to the object `from` inside the `replace` array.","items":{"type":"string","description":"Removal details."}},"replace":{"type":["array","null"],"items":{"required":["from","to"],"type":"object","description":"Details about what will be replaced.","properties":{"from":{"required":["paymentData","items","shippingData"],"type":"object","properties":{"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"items":{"type":"array","description":"Array with items information.","items":{"required":["id","quantity","price","measurementUnit","unitMultiplier","sellingPrice","name","detailUrl","imageUrl"],"type":"object","description":"Details about a given item.","properties":{"id":{"type":"string","description":"SKU ID of the item being replaced."},"quantity":{"type":"integer","description":"Quantity of items been replaced."},"price":{"type":["integer","null"],"description":"Shipping price for the replaced item, in cents. It does not account for the whole order's shipping price."},"measurementUnit":{"type":["string","null"],"description":"Measurement unit of the item being replaced. For example, `kg` for kilograms or `un` for unitary items."},"unitMultiplier":{"type":"integer","description":"Unit multiplier for item being updated."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item being replaced."},"name":{"type":["string","null"],"description":"Name of the item being replaced."},"detailUrl":{"type":["string","null"],"description":"URL slug of the item being replaced."},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the item being replaced."}}}},"shippingData":{"description":"Shipping data object.","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","description":"Array with logistics information about the order been replaced. If not sent in the original request, it will be an empty array in the response.","items":{"type":"string","description":"Logistics details."}}}}},"description":"Information about what items were replaced."},"to":{"required":["items","paymentData","receiptData","shippingData"],"type":"object","description":"Information about items that replaced the previous one.","properties":{"items":{"type":"array","items":{"type":"object","description":"Object with item details.","required":["uniqueId","id","productId","productRefId","refId","ean","name","skuName","modalType","parentItemIndex","parentAssemblyBinding","assemblies","priceValidUntil","tax","price","listPrice","manualPrice","manualPriceAppliedBy","sellingPrice","rewardValue","isGift","additionalInfo","preSaleDate","productCategoryIds","productCategories","quantity","seller","sellerChain","imageUrl","detailUrl","components","bundleItems","attachments","attachmentOfferings","offerings","priceTags","availability","measurementUnit","unitMultiplier","manufacturerCode","priceDefinition"],"properties":{"uniqueId":{"type":"string","description":"Item's unique ID in the order modifications request."},"id":{"type":"string","description":"SKU ID of the item replacing the previous one."},"productId":{"type":["string","null"],"description":"Product ID of the item replacing the previous one."},"productRefId":{"type":["string","null"],"description":"Product Ref ID of the item replacing the previous one."},"refId":{"type":["string","null"],"description":"Reference ID of the item replacing the previous one."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item replacing the previous one."},"name":{"type":["string","null"],"description":"Name of the Product associated with the item replacing the previous one."},"skuName":{"type":["string","null"],"description":"Name of the SKU replacing the previous one."},"modalType":{"type":["string","null"],"description":"A [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) attaches an unusual product, such as meat or glass, to a carrier specialized in shipping it."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index of the item replacing the previous one."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding of the item replacing the previous one."},"assemblies":{"type":["array","null"],"description":"Array with information about services that may be offered for the item replacing the previous one. For example, the assembly of a piece of furniture or warranty.","items":{"type":"string","description":"Customization information."}},"priceValidUntil":{"type":["string","null"],"description":"Price expiration date of item replacing the previous one. The value is in the format `yyyy-mm-ddThh:mm:ss.sss`."},"tax":{"type":"integer","description":"Tax in cents of the item replacing the previous one, when applicable."},"price":{"type":["integer","null"],"description":"Final price of the item replacing the previous one, calculated in cents."},"listPrice":{"type":["integer","null"],"description":"Item's price list for the item replacing the previous one."},"manualPrice":{"type":["integer","null"],"description":"Manual price of the item replacing the previous one. It is calculated in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User ID or appKey that made the manual price modification of the item replacing the previous one."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item replacing the previous one. It is calculated in cents."},"rewardValue":{"type":"integer","description":"Reward value of the item replacing the previous one. It is calculated in cents."},"isGift":{"type":"boolean","description":"This field is `true` when the replacing item is a gift in the order context and `false` when it is not."},"additionalInfo":{"type":"object","description":"Additional information object.","required":["dimension","brandName","brandId","offeringInfo","offeringType","offeringTypeId","categoriesIds","productClusterId","commercialConditionId"],"properties":{"dimension":{"type":["string","null"],"description":"Replacing item's dimensions in the measure unit configured in the catalog."},"brandName":{"type":["string","null"],"description":"Replacing item's brand name."},"brandId":{"type":["string","null"],"description":"Replacing item's brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categoriesIds":{"type":["string","null"],"description":"ID of the replacing item product category."},"productClusterId":{"type":["string","null"],"description":"All product clusters related to the replacing item."},"commercialConditionId":{"type":["string","null"],"description":"Replacing item commercial conditions ID."}}},"preSaleDate":{"type":["string","null"],"description":"Pre sale date of the item replacing the previous one."},"productCategoryIds":{"type":["string","null"],"description":"Replacing item's category path composed of category IDs separated by `/`. For example: `/3/15/`."},"productCategories":{"type":"object","description":"Object containing product categories of the replacing item. Structure: `{CategoryID}: {CategoryName}`. Both the key and the value are strings."},"quantity":{"type":"integer","description":"Quantity of replacing items."},"seller":{"type":["string","null"],"description":"Seller ID that identifies the seller the replacing item belongs to."},"sellerChain":{"type":["array","null"],"description":"Array containing information about sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://developers.vtex.com/docs/guides/multilevel-omnichannel-inventory) order.","items":{"type":["string","null"],"description":"Seller identification."}},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the replacing item."},"detailUrl":{"type":["string","null"],"description":"URL slug of the replacing item."},"components":{"type":"array","items":{"type":"string","description":"Replacing item's component."},"description":"Array with information about replacing item's components."},"bundleItems":{"type":"array","items":{"type":"string","description":"Service sold with the replacing item."},"description":"Array with information about services sold along with the replacing item, such as a gift package."},"attachments":{"type":"array","items":{"type":"string","description":"Information about a given attachment."},"description":"Array containing information on attachments."},"attachmentOfferings":{"type":"array","items":{"type":"string","description":"Information about a given offering."},"description":"Array with the properties of the content declared in the field `attachments`."},"offerings":{"type":"array","items":{"type":"string","description":"Item's offering."},"description":"Array with replacing items Item's offerings."},"priceTags":{"type":"array","items":{"type":"string","description":"Item modifier."},"description":"Array containing objects with replacing item's price modifiers."},"availability":{"type":["string","null"],"description":"Availability to fulfill the order with the item."},"measurementUnit":{"type":"string","description":"Replacing item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Replacing item's unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Provided by the manufacturers to identify their product. This field must be completed if the replacing item has a manufacturer's code."},"priceDefinition":{"type":["string","null"],"description":"Replacing item's price information."}}},"description":"Array containing information about the item replacing the previous one."},"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"receiptData":{"type":["object","null"],"description":"Information about the receipt after order modifications."},"shippingData":{"type":"object","description":"Shipping data object.","required":["logisticsInfo"],"properties":{"logisticsInfo":{"type":"array","items":{"type":"object","description":"Logistics information object.","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID of the replacing item."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications shipping policy."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modification shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Replacing item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Replacing item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Replacing item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Replacing item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Change item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modification [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}},"clientProfileData":{"type":"array","items":{"type":"object","description":"Object with information on the client's profile.","properties":{"firstName":{"type":"string","description":"Customer's first name."},"lastName":{"type":"string","description":"Customer's last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document number informed by the customer."},"phone":{"type":"string","description":"Customer's phone number."},"corporateName":{"type":"string","description":"If it's a legal entity, here goes the company name."},"tradeName":{"type":"string","description":"If it's a legal entity, here goes the trade name."},"corporateDocument":{"type":"string","description":"If it's a legal entity, here goes the corporate document."},"stateInscription":{"type":"string","description":"If it's a legal entity, here goes the state inscription."},"corporatePhone":{"type":"string","description":"If it's a legal entity, here goes the company phone."},"isCorporate":{"type":"boolean","description":"It has the value `true` if it's a legal entity."}}}}}}}},"description":"Array with information about the `replace` operation, when applicable."},"date":{"type":"string","description":"Date and time of the request. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"origin":{"required":["account","orderId","component"],"type":"object","properties":{"account":{"type":"string","description":"Name of the account where the order was made."},"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"component":{"type":"string","description":"Component information."}},"description":"Object containing information about the order origin."},"settings":{"type":"object","description":"Object with all VTEX account settings related to the **Order modifications** feature.","properties":{"paymentConfiguration":{"type":"object","description":"[Order modifications](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ) payment configurations.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"List of custom payment system IDs configured for the VTEX account.","items":{"type":"string","description":"Payment system ID."}}}},"rolloutConfiguration":{"type":"object","description":"**Order modifications** settings regarding VTEX Admin, [Orders API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes?endpoint=patch-/api/order-system/orders/-changeOrderId-/changes) and **My Account** feature.","properties":{"usingDefaultBehavior":{"type":"boolean","description":"Defines if the **Order modifications** configurations are the default behaviour (`true`) or if the account made customizations to it (`false`). Subaccounts will have the same configurations as the main account.","default":false},"enableApi":{"type":"boolean","description":"Defines if the account enabled the [Order modifications API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) (`true`) or not (`false`). The account can only use the [Order modifications via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw) or [via API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) if this field is set to `true`.","default":false},"enableAdminOrders":{"type":"object","description":"Object about enabling the [Order modifications feature via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspaces' names that have the **Order modifications** feature enabled via VTEX Admin.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via VTEX Admin. The asterisk `*` value includes all of the account's workspaces."}}}},"enableMyOrders":{"type":"object","description":"Object about enabling the **Order modifications** feature via [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspace names that have the **Order modifications** feature enabled via **My Account**.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via **My Account**. The asterisk `*` value includes all of the account's workspaces."}}}}}},"pipelineConfiguration":{"type":"object","description":"**Order modifications** settings related to taxes and shipping calculation.","properties":{"enableTaxHubRecalculation":{"type":"boolean","description":"Defines if the tax calculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"compensateShippingChanges":{"type":"boolean","description":"Defines if orders changed will have zero shipping cost (`true`) or not (`false`). Merchants usually enable this configuration to change only items and prices, without impacting the orders original freight costs.","default":false},"enablePromotionRecalculation":{"type":"boolean","description":"Defines if the promotion recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"enableNativeTaxRecalculation":{"type":"boolean","description":"Defines if the native tax recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + [Order modifications](https://help.vtex.com/docs/tutorials/how-order-modification-works) feature allows you to modify an order, whether the modification is motivated by customer mistakes, product unavailability, or others. Both sellers and marketplaces can use this endpoint and modify orders in multiple scenarios, and it is possible to make a single modification or combine multiple ones in the same request. + The possible order modifications operations you can perform are the following: + - **Add:** Adding items, quantity, or product weight. + - **Remove:** Removing a part of items or the total quantity. + - **Replace:** Changing items' quantity, weight, or price. You can also replace one or more items with different ones, including weighable products. In addition, you can change your clients's data. + + >❗ When removing or adding items to an order, your [inventory](https://help.vtex.com/en/tutorial/inventory-management--tutorials_139) is not automatically updated. You can use the [Update inventory by SKU and warehouse](https://developers.vtex.com/docs/api-reference/logistics-api#put-/api/logistics/pvt/inventory/skus/-skuId-/warehouses/-warehouseId-) endpoint. + + >⚠️ The Order modifications feature isn't applicable to the Catalog API - Seller Portal. + + >❗ If the order you are modifying has more than one shipping address, you cannot add products that were not in the original order. You can only increase or decrease the quantity of the existing items, or remove items. + + The next sections are listed below: + - Number of modifications per order + - Acceptable order status for modifications + - Order modifications and price + - Combining multiple operations + + ## Number of modifications per order + Besides being able to combine multiple modification operations - add, remove, and replace - in a single request, you can make different modification requests, and there is no limit to how many times an order can be modified. + + Each order has its modifications history, you can retrieve it using the [Get order modifications history](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes) endpoint. + + ## Acceptable order status for modifications + You can only modify an order when it is one of the following [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) status: + - `handling` + - `waiting-for-fulfillment` + - `ready for invoicing` + + It is not possible to modify an order when the payment transaction is complete. + + ## Order modifications and price + When you add, remove or replace items using this endpoint, the order and payment transaction values are automatically updated. Order modifications calculates the update of the following values: + - Item value + - Total value + + **Example:** If you send the request body for replacing items without the unit multiplier (`unitMultiplier`) or measurement (`measurementUnit`), Order modifications will get this information on your store's Catalog, Pricing and Payment systems. + >⚠️ Increasing the price of an order is allowed only when the order was paid by credit card, [payable notes](https:/help.vtex.com/en/tutorial/setting-up-payments-with-promissory--5pW7avTwtyQcMu4uiW8quQ), cash, or [credit control](https:/help.vtex.com/en/tutorial/customer-credit-overview--1uIqTjWxIIIEW0COMg4uE0). In addition, the [acquirer](https:/help.vtex.com/en/tutorial/what-is-an-acquirer--7N1oRTG8dGmOiIugC0cs4E) must allow transactions without the CVV code and two charging transactions in the same order. + + For order modifications with discounts, Order Management System (OMS) considers that you still can modify the order's transactional value, as long as its status in Transaction Details is not `Finished`. + + ## Order modifications and payment transaction flow + + An order's [transaction flow](https://help.vtex.com/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y) goes through various payment statuses before its conclusion. Within certain conditions, it is possible to modify settled orders. The requirements are the following: + + - The order's [payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) is a credit card. + - The settlement occurs before the order is invoiced. + - The payment connector is configured to allow partial refunds. + + > Currently, [Adyen](https://help.vtex.com/en/tutorial/configuring-payment-with-adyenv3--7xAz67E2Eg63LWCQNjVdwv) is the only payment connector that supports that operation. + + If the order modification increases or decreases the cost for the customer, the platform has the following behavior: + + - **Smaller price after order modification:** + - If the payment is marked as `settled` in the [transaction flow](https://help.vtex.com/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y), an automatic notification is sent to the payment [gateway](https://help.vtex.com/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/kdPbEIWf8Xq8tESQvViMB#gateway) to reimburse the customer for the difference. + - If the payment hasn't been settled, an automatic notification is sent to the payment gateway to change the order's total amount. + - **Higher price after order modification:** An automatic notification is sent to the payment gateway to require the customer to pay for the additional cost. + + ## Order modifications settings + + The Order modifications settings allow you to customize your account's behavior when receiving a modification request, such as configuring the order payments, defining tax recalculation, and compensating shipping costs. Before or during the API integration, you can consult and, if necessary, adjust the settings of the modifications. + + * If you wish to consult the current settings, run the [Get Order modifications settings](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/changes/settings) endpoint. + * If you wish to alter the current settings, run the [Update Order modifications settings](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/order-system/orders/changes/settings) endpoint. + + ## Combining multiple operations + + You can use this endpoint to make a single change operation or combine them in the same request. See some examples below. + + ### Adding request body example: + + ```json + { + "add": { + "items": [ + { + "id": "8", + "quantity": 1, + "measurementUnit": "un", + "unitMultiplier": 1 + } + ] + } + } + ``` + + ### Removing request body example: + + ```json + { + "reason": "The client wants to remove a product.", + "remove": { + "items": [ + { + "id": "8", + "quantity": 2, + "measurementUnit": "un", + "unitMultiplier": 1 + } + ] + } + } + ``` + + ### Replacing request body example: + ```json + { + "reason": "The client wants to increase the product weight.", + "replace": [ + { + "from": { + "items": [ + { + "id": "1", + "quantity": 1 + } + ] + }, + "to": { + "items": [ + { + "id": "2", + "quantity": 1, + "measurementUnit": "kg", + "unitMultiplier": 1.0 + } + ], + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "addressId": "12334048475146857", + "price": 1000 + } + ] + } + } + } + ] + } + ``` + + + ### Adding, removing and replacing request body example: + + + ```json + { + "reason": "The client wants to add, remove and replace a weighable product.", + "manualDiscountValue": 0, + "add": { + "items": [ + { + "id": "8", + "quantity": 1, + "measurementUnit": "un", + "unitMultiplier": 1 + } + ] + }, + "remove": { + "items": [ + { + "id": "31", + "quantity": 1, + "measurementUnit": "un", + "unitMultiplier": 1 + } + ] + }, + "replace": [ + { + "from": { + "items": [ + { + "id": "1", + "quantity": 1 + } + ] + }, + "to": { + "items": [ + { + "id": "2", + "quantity": 1, + "measurementUnit": "kg", + "unitMultiplier": 1.0 + } + ], + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "addressId": "12334048475146857", + "price": 1000 + } + ] + } + } + } + ] + } + ``` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order you wish to modify. | + | `accountName` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`202`) + + _Omitted here: 5 KB. See `Accepted` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Get Order modifications settings.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Get Order modifications settings.yml new file mode 100644 index 0000000000..b11d624741 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Get Order modifications settings.yml @@ -0,0 +1,123 @@ +info: + name: Get Order modifications settings + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/api/order-system/orders/changes/settings?an=mystore" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: mystore + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/order-system/orders/changes/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/order-system/orders/changes/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/order-system/orders/changes/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/order-system/orders/changes/settings - Schema is valid", function () { + const schema = {"type":"object","description":"Object with all VTEX account settings related to the **Order modifications** feature.","properties":{"paymentConfiguration":{"type":"object","description":"[Order modifications](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ) payment configurations.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"List of custom payment system IDs configured for the VTEX account.","items":{"type":"string","description":"Payment system ID."}}}},"rolloutConfiguration":{"type":"object","description":"**Order modifications** settings regarding VTEX Admin, [Orders API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes?endpoint=patch-/api/order-system/orders/-changeOrderId-/changes) and **My Account** feature.","properties":{"usingDefaultBehavior":{"type":"boolean","description":"Defines if the **Order modifications** configurations are the default behaviour (`true`) or if the account made customizations to it (`false`). Subaccounts will have the same configurations as the main account.","default":false},"enableApi":{"type":"boolean","description":"Defines if the account enabled the [Order modifications API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) (`true`) or not (`false`). The account can only use the [Order modifications via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw) or [via API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) if this field is set to `true`.","default":false},"enableAdminOrders":{"type":"object","description":"Object about enabling the [Order modifications feature via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspaces' names that have the **Order modifications** feature enabled via VTEX Admin.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via VTEX Admin. The asterisk `*` value includes all of the account's workspaces."}}}},"enableMyOrders":{"type":"object","description":"Object about enabling the **Order modifications** feature via [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspace names that have the **Order modifications** feature enabled via **My Account**.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via **My Account**. The asterisk `*` value includes all of the account's workspaces."}}}}}},"pipelineConfiguration":{"type":"object","description":"**Order modifications** settings related to taxes and shipping calculation.","properties":{"enableTaxHubRecalculation":{"type":"boolean","description":"Defines if the tax calculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"compensateShippingChanges":{"type":"boolean","description":"Defines if orders changed will have zero shipping cost (`true`) or not (`false`). Merchants usually enable this configuration to change only items and prices, without impacting the orders original freight costs.","default":false},"enablePromotionRecalculation":{"type":"boolean","description":"Defines if the promotion recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"enableNativeTaxRecalculation":{"type":"boolean","description":"Defines if the native tax recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the [Order modifications settings](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/order-system/orders/changes/settings) from a store. + + >ℹ️ To know more about **Order modifications**, see [How Order modifications works](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentConfiguration": { + "customPaymentSystemsAllowed": [ + "201", + "125" + ] + }, + "rolloutConfiguration": { + "usingDefaultBehavior": false, + "enableApi": true, + "enableAdminOrders": { + "enabledWorkspaces": [ + "*" + ] + }, + "enableMyOrders": { + "enabledWorkspaces": [ + "*" + ] + } + }, + "pipelineConfiguration": { + "enableTaxHubRecalculation": false, + "compensateShippingChanges": true, + "enablePromotionRecalculation": false, + "enableNativeTaxRecalculation": false + } + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications details.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications details.yml new file mode 100644 index 0000000000..872ebe8d0e --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications details.yml @@ -0,0 +1,117 @@ +info: + name: Get order modifications details + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes/:changeRequestId?an=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + - name: changeRequestId + value: e8532a32-7f7e-434a-88ec-29609f0ede46 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId - Schema is valid", function () { + const schema = {"required":["requestId","workflowId","status","inProgress","reason","manualDiscountValue","manualIncrementValue","totalChangeValue","totals","add","remove","replace","date","origin","settings"],"type":"object","properties":{"requestId":{"type":"string","description":"Unique code that identifies an order modification request."},"workflowId":{"type":"string","description":"Code that identifies the transaction of changing the orders in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"status":{"type":"string","description":"Order status in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"inProgress":{"type":"boolean","description":"When set as `true`, the order is still progressing in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196), when set as `false`, it is complete, whether by cancellation or because the customer received it."},"reason":{"type":"string","description":"Reason that motivated the order modifications."},"manualDiscountValue":{"type":"integer","description":"This field shows if a manual price was applied to the total order amount. The value is in cents."},"manualIncrementValue":{"type":"integer","description":"This field shows if an increment value was applied to the total order amount. The value is in cents."},"totalChangeValue":{"type":"integer","description":"This field shows how much is the order total price considering that price modifications might have been made. The value is in cents."},"totals":{"type":"array","description":"Array containing total costs information.","items":{"type":"object","description":"Total changing price details for a given type of cost.","properties":{"id":{"type":"string","description":"Changing price type, for example the item price or shipping costs."},"name":{"type":"string","description":"Changing price name."},"value":{"type":"number","description":"Changing price value in cents."}}}},"add":{"type":["array","null"],"description":"Array with information about the `add` operation, when applicable. The schema will correspond to the object `to` inside the `replace` array.","items":{"type":"string","description":"Adding operation information, when applicable."}},"remove":{"type":["array","null"],"description":"Array with information about the `remove` operation, when applicable. The schema will correspond to the object `from` inside the `replace` array.","items":{"type":"string","description":"Removing operation information, when applicable."}},"replace":{"type":"array","description":"Array with information about the `replace` operation, when applicable.","items":{"required":["from","to"],"type":"object","description":"Details about what will be replaced.","properties":{"from":{"required":["paymentData","items","shippingData"],"type":"object","properties":{"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"items":{"type":"array","description":"Array with items information.","items":{"required":["id","quantity","price","measurementUnit","unitMultiplier","sellingPrice","name","detailUrl","imageUrl"],"type":"object","description":"Details about a given item.","properties":{"id":{"type":"string","description":"SKU ID of the item being replaced."},"quantity":{"type":"integer","description":"Quantity of items been replaced."},"price":{"type":["integer","null"],"description":"Shipping price for the replaced item, in cents. It does not account for the whole order's shipping price."},"measurementUnit":{"type":["string","null"],"description":"Measurement unit of the item being replaced. For example, `kg` for kilograms or `un` for unitary items."},"unitMultiplier":{"type":"integer","description":"Unit multiplier for item being updated."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item being replaced."},"name":{"type":["string","null"],"description":"Name of the item being replaced."},"detailUrl":{"type":["string","null"],"description":"URL slug of the item being replaced."},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the item being replaced."}}}},"shippingData":{"description":"Shipping data object.","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","description":"Array with logistics information about the order been replaced. If not sent in the original request, it will be an empty array in the response.","items":{"type":"string","description":"Logistics details."}}}}},"description":"Information about what items were replaced."},"to":{"required":["items","paymentData","receiptData","shippingData"],"type":"object","description":"Information about items that replaced the previous one.","properties":{"items":{"type":"array","items":{"type":"object","description":"Object with item details.","required":["uniqueId","id","productId","productRefId","refId","ean","name","skuName","modalType","parentItemIndex","parentAssemblyBinding","assemblies","priceValidUntil","tax","price","listPrice","manualPrice","manualPriceAppliedBy","sellingPrice","rewardValue","isGift","additionalInfo","preSaleDate","productCategoryIds","productCategories","quantity","seller","sellerChain","imageUrl","detailUrl","components","bundleItems","attachments","attachmentOfferings","offerings","priceTags","availability","measurementUnit","unitMultiplier","manufacturerCode","priceDefinition"],"properties":{"uniqueId":{"type":"string","description":"Item's unique ID in the order modifications request."},"id":{"type":"string","description":"SKU ID of the item replacing the previous one."},"productId":{"type":["string","null"],"description":"Product ID of the item replacing the previous one."},"productRefId":{"type":["string","null"],"description":"Product Ref ID of the item replacing the previous one."},"refId":{"type":["string","null"],"description":"Reference ID of the item replacing the previous one."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item replacing the previous one."},"name":{"type":["string","null"],"description":"Name of the Product associated with the item replacing the previous one."},"skuName":{"type":["string","null"],"description":"Name of the SKU replacing the previous one."},"modalType":{"type":["string","null"],"description":"A [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) attaches an unusual product, such as meat or glass, to a carrier specialized in shipping it."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index of the item replacing the previous one."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding of the item replacing the previous one."},"assemblies":{"type":["array","null"],"description":"Array with information about services that may be offered for the item replacing the previous one. For example, the assembly of a piece of furniture or warranty.","items":{"type":"string","description":"Customization information."}},"priceValidUntil":{"type":["string","null"],"description":"Price expiration date of item replacing the previous one. The value is in the format `yyyy-mm-ddThh:mm:ss.sss`."},"tax":{"type":"integer","description":"Tax in cents of the item replacing the previous one, when applicable."},"price":{"type":["integer","null"],"description":"Final price of the item replacing the previous one, calculated in cents."},"listPrice":{"type":["integer","null"],"description":"Item's price list for the item replacing the previous one."},"manualPrice":{"type":["integer","null"],"description":"Manual price of the item replacing the previous one. It is calculated in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User ID or appKey that made the manual price modification of the item replacing the previous one."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item replacing the previous one. It is calculated in cents."},"rewardValue":{"type":"integer","description":"Reward value of the item replacing the previous one. It is calculated in cents."},"isGift":{"type":"boolean","description":"This field is `true` when the replacing item is a gift in the order context and `false` when it is not."},"additionalInfo":{"type":"object","description":"Additional information object.","required":["dimension","brandName","brandId","offeringInfo","offeringType","offeringTypeId","categoriesIds","productClusterId","commercialConditionId"],"properties":{"dimension":{"type":["string","null"],"description":"Replacing item's dimensions in the measure unit configured in the catalog."},"brandName":{"type":["string","null"],"description":"Replacing item's brand name."},"brandId":{"type":["string","null"],"description":"Replacing item's brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categoriesIds":{"type":["string","null"],"description":"ID of the replacing item product category."},"productClusterId":{"type":["string","null"],"description":"All product clusters related to the replacing item."},"commercialConditionId":{"type":["string","null"],"description":"Replacing item commercial conditions ID."}}},"preSaleDate":{"type":["string","null"],"description":"Pre sale date of the item replacing the previous one."},"productCategoryIds":{"type":["string","null"],"description":"Replacing item's category path composed of category IDs separated by `/`. For example: `/3/15/`."},"productCategories":{"type":"object","description":"Object containing product categories of the replacing item. Structure: `{CategoryID}: {CategoryName}`. Both the key and the value are strings."},"quantity":{"type":"integer","description":"Quantity of replacing items."},"seller":{"type":["string","null"],"description":"Seller ID that identifies the seller the replacing item belongs to."},"sellerChain":{"type":["array","null"],"description":"Array containing information about sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://developers.vtex.com/docs/guides/multilevel-omnichannel-inventory) order.","items":{"type":["string","null"],"description":"Seller identification."}},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the replacing item."},"detailUrl":{"type":["string","null"],"description":"URL slug of the replacing item."},"components":{"type":"array","items":{"type":"string","description":"Replacing item's component."},"description":"Array with information about replacing item's components."},"bundleItems":{"type":"array","items":{"type":"string","description":"Service sold with the replacing item."},"description":"Array with information about services sold along with the replacing item, such as a gift package."},"attachments":{"type":"array","items":{"type":"string","description":"Information about a given attachment."},"description":"Array containing information on attachments."},"attachmentOfferings":{"type":"array","items":{"type":"string","description":"Information about a given offering."},"description":"Array with the properties of the content declared in the field `attachments`."},"offerings":{"type":"array","items":{"type":"string","description":"Item's offering."},"description":"Array with replacing items Item's offerings."},"priceTags":{"type":"array","items":{"type":"string","description":"Item modifier."},"description":"Array containing objects with replacing item's price modifiers."},"availability":{"type":["string","null"],"description":"Availability to fulfill the order with the item."},"measurementUnit":{"type":"string","description":"Replacing item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Replacing item's unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Provided by the manufacturers to identify their product. This field must be completed if the replacing item has a manufacturer's code."},"priceDefinition":{"type":["string","null"],"description":"Replacing item's price information."}}},"description":"Array containing information about the item replacing the previous one."},"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"receiptData":{"type":["object","null"],"description":"Information about the receipt after order modifications."},"shippingData":{"type":"object","description":"Shipping data object.","required":["logisticsInfo"],"properties":{"logisticsInfo":{"type":"array","items":{"type":"object","description":"Logistics information object.","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID of the replacing item."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications shipping policy."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modification shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Replacing item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Replacing item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Replacing item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Replacing item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Change item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modification [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}},"clientProfileData":{"type":"array","items":{"type":"object","description":"Object with information on the client's profile.","properties":{"firstName":{"type":"string","description":"Customer's first name."},"lastName":{"type":"string","description":"Customer's last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document number informed by the customer."},"phone":{"type":"string","description":"Customer's phone number."},"corporateName":{"type":"string","description":"If it's a legal entity, here goes the company name."},"tradeName":{"type":"string","description":"If it's a legal entity, here goes the trade name."},"corporateDocument":{"type":"string","description":"If it's a legal entity, here goes the corporate document."},"stateInscription":{"type":"string","description":"If it's a legal entity, here goes the state inscription."},"corporatePhone":{"type":"string","description":"If it's a legal entity, here goes the company phone."},"isCorporate":{"type":"boolean","description":"It has the value `true` if it's a legal entity."}}}}}}}}},"date":{"type":"string","description":"Date and time of the request in UTC ISO 8601 format, as in `yyyy-mm-ddThh:mm:ss.sssZ`."},"origin":{"required":["account","orderId","component"],"type":"object","properties":{"account":{"type":"string","description":"Name of the account where the order was made."},"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"component":{"type":"string","description":"Component information."}},"description":"Object containing information about the order origin."},"settings":{"required":["customPaymentSystemsAllowed"],"type":"object","description":"Object with account settings information, such as custom payment.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"Store's [custom payment](https://help.vtex.com/tutorial/how-to-configure-a-custom-payment--tutorials_451) information. Applicable only for stores that configured custom payment options.","items":{"type":"string","description":"Custom payment code."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves detailed information about a specific order modification. So after creating multiple modifications, you can get information on each one of them by its `changeRequestId`, the unique identification code generated by the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint. + + The successful status code is `200 OK`, and its response body schema is very similar to the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint, with some additional fields: + + - `status`: The modification request status in the workflow, which progresses in the following order: + - `waiting-acknowledgement` + - `waiting-confirmation` + - `done` + - `canceled` + + - `inProgress`: When set as `true`, the order is still progressing in the order flow, when set as `false`, it is complete, whether by cancellation or because the customer received it. + + - `logs`: Lists the workflow processing logs. + + > If you want information about all the modifications made to an order, use the [Get order modifications history](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes) endpoint. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order you wish to get the modification detail. | + | `changeRequestId` | path | (Required) Once you make an order modification, you generate a `requestId` code that identifies the modifications made to that order. This field should be filled with that code. There are no limits to modifications you can perform using the same `changeRequestId`, and we recommend keeping all modifications of a given order grouped by the same `changeRequestId`, so you will have a unified modification history. | + | `an` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 14 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications history.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications history.yml new file mode 100644 index 0000000000..d70a44cd63 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications history.yml @@ -0,0 +1,103 @@ +info: + name: Get order modifications history + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes?an=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/order-system/orders/:changeOrderId/changes - Schema is valid", function () { + const schema = {"type":"object","required":["requests","actions"],"properties":{"requests":{"type":"array","description":"Array with order modifications requests details.","items":{"required":["requestId","workflowId","reason","manualDiscountValue","manualIncrementValue","totalChangeValue","totals","add","remove","replace","date","origin","settings"],"type":"object","description":"Information about each order modification request.","properties":{"requestId":{"type":"string","description":"Unique code that identifies an order modification."},"workflowId":{"type":"string","description":"Code that identifies the transaction of modifying the orders in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"reason":{"type":"string","description":"Reason that motivated the order modifications."},"manualDiscountValue":{"type":"integer","description":"This field shows if it was applied a manual price for the total order amount. The value is in cents."},"manualIncrementValue":{"type":"integer","description":"This field shows if an increment value was applied to the total order amount. The value is in cents."},"totalChangeValue":{"type":"integer","description":"This field shows how much the order total price is, considering that price modifications might have been made. The value is in cents."},"totals":{"type":"array","description":"Array containing total costs information.","items":{"type":"object","description":"Total changing price details for a given type of cost.","properties":{"id":{"type":"string","description":"Changing price type, for example the item price or shipping costs."},"name":{"type":"string","description":"Changing price name."},"value":{"type":"number","description":"Changing price value in cents."}}}},"add":{"type":["object","null"],"description":"Information about an `add` operation, when there was one. It will have the same schema of `request.replace.to`."},"remove":{"type":["object","null"],"description":"Information about a `remove` operation, when there was one. It will have the same schema of `request.replace.from`."},"replace":{"type":"array","description":"Array with information about the replacement operation performed.","items":{"type":"object","description":"Replacing operation object.","required":["from","to"],"properties":{"from":{"type":"object","description":"What the order is changing from.","required":["paymentData","items","shippingData"],"properties":{"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"items":{"type":"array","description":"Items information from before the order change.","items":{"title":"Item4","required":["id","quantity","price","measurementUnit","unitMultiplier","sellingPrice","name","detailUrl","imageUrl"],"type":"object","properties":{"id":{"type":"string","description":"SKU ID of the item."},"quantity":{"type":"integer","description":"Quantity of items been replaced."},"price":{"type":["string","null"],"description":"Item's shipping price. It does not account for the whole order's shipping price and is presented in cents."},"measurementUnit":{"type":["string","null"],"description":"Item's measurement unit. For example, `kg` for kilograms or `un` for unitary items."},"unitMultiplier":{"type":"integer","description":"Item's unit multiplier."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"name":{"type":["string","null"],"description":"Item's name."},"detailUrl":{"type":["string","null"],"description":"Item's URL slug."},"imageUrl":{"type":["string","null"],"description":"Item's image URL slug."}}}},"shippingData":{"title":"ShippingData3","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","items":{"title":"LogisticsInfo2","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"type":"object","properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modifications shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modifications [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}}}},"to":{"title":"To2","required":["items","paymentData","receiptData","shippingData"],"type":"object","properties":{"items":{"type":"array","items":{"type":"object","description":"Object with item details.","required":["uniqueId","id","productId","productRefId","refId","ean","name","skuName","modalType","parentItemIndex","parentAssemblyBinding","assemblies","priceValidUntil","tax","price","listPrice","manualPrice","manualPriceAppliedBy","sellingPrice","rewardValue","isGift","additionalInfo","preSaleDate","productCategoryIds","productCategories","quantity","seller","sellerChain","imageUrl","detailUrl","components","bundleItems","attachments","attachmentOfferings","offerings","priceTags","availability","measurementUnit","unitMultiplier","manufacturerCode","priceDefinition"],"properties":{"uniqueId":{"type":"string","description":"Item's unique ID in the order modifications request."},"id":{"type":"string","description":"SKU ID of the item replacing the previous one."},"productId":{"type":["string","null"],"description":"Product ID of the item replacing the previous one."},"productRefId":{"type":["string","null"],"description":"Product Ref ID of the item replacing the previous one."},"refId":{"type":["string","null"],"description":"Reference ID of the item replacing the previous one."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item replacing the previous one."},"name":{"type":["string","null"],"description":"Name of the Product associated with the item replacing the previous one."},"skuName":{"type":["string","null"],"description":"Name of the SKU replacing the previous one."},"modalType":{"type":["string","null"],"description":"A [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) attaches an unusual product, such as meat or glass, to a carrier specialized in shipping it."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index of the item replacing the previous one."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding of the item replacing the previous one."},"assemblies":{"type":["array","null"],"description":"Array with information about services that may be offered for the item replacing the previous one. For example, the assembly of a piece of furniture or warranty.","items":{"type":"string","description":"Customization information."}},"priceValidUntil":{"type":["string","null"],"description":"Price expiration date of item replacing the previous one. The value is in the format `yyyy-mm-ddThh:mm:ss.sss`."},"tax":{"type":"integer","description":"Tax in cents of the item replacing the previous one, when applicable."},"price":{"type":["integer","null"],"description":"Final price of the item replacing the previous one, calculated in cents."},"listPrice":{"type":["integer","null"],"description":"Item's price list for the item replacing the previous one."},"manualPrice":{"type":["integer","null"],"description":"Manual price of the item replacing the previous one. It is calculated in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User ID or appKey that made the manual price modification of the item replacing the previous one."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item replacing the previous one. It is calculated in cents."},"rewardValue":{"type":"integer","description":"Reward value of the item replacing the previous one. It is calculated in cents."},"isGift":{"type":"boolean","description":"This field is `true` when the replacing item is a gift in the order context and `false` when it is not."},"additionalInfo":{"type":"object","description":"Additional information object.","required":["dimension","brandName","brandId","offeringInfo","offeringType","offeringTypeId","categoriesIds","productClusterId","commercialConditionId"],"properties":{"dimension":{"type":["string","null"],"description":"Replacing item's dimensions in the measure unit configured in the catalog."},"brandName":{"type":["string","null"],"description":"Replacing item's brand name."},"brandId":{"type":["string","null"],"description":"Replacing item's brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categoriesIds":{"type":["string","null"],"description":"ID of the replacing item product category."},"productClusterId":{"type":["string","null"],"description":"All product clusters related to the replacing item."},"commercialConditionId":{"type":["string","null"],"description":"Replacing item commercial conditions ID."}}},"preSaleDate":{"type":["string","null"],"description":"Pre sale date of the item replacing the previous one."},"productCategoryIds":{"type":["string","null"],"description":"Replacing item's category path composed of category IDs separated by `/`. For example: `/3/15/`."},"productCategories":{"type":"object","description":"Object containing product categories of the replacing item. Structure: `{CategoryID}: {CategoryName}`. Both the key and the value are strings."},"quantity":{"type":"integer","description":"Quantity of replacing items."},"seller":{"type":["string","null"],"description":"Seller ID that identifies the seller the replacing item belongs to."},"sellerChain":{"type":["array","null"],"description":"Array containing information about sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://developers.vtex.com/docs/guides/multilevel-omnichannel-inventory) order.","items":{"type":["string","null"],"description":"Seller identification."}},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the replacing item."},"detailUrl":{"type":["string","null"],"description":"URL slug of the replacing item."},"components":{"type":"array","items":{"type":"string","description":"Replacing item's component."},"description":"Array with information about replacing item's components."},"bundleItems":{"type":"array","items":{"type":"string","description":"Service sold with the replacing item."},"description":"Array with information about services sold along with the replacing item, such as a gift package."},"attachments":{"type":"array","items":{"type":"string","description":"Information about a given attachment."},"description":"Array containing information on attachments."},"attachmentOfferings":{"type":"array","items":{"type":"string","description":"Information about a given offering."},"description":"Array with the properties of the content declared in the field `attachments`."},"offerings":{"type":"array","items":{"type":"string","description":"Item's offering."},"description":"Array with replacing items Item's offerings."},"priceTags":{"type":"array","items":{"type":"string","description":"Item modifier."},"description":"Array containing objects with replacing item's price modifiers."},"availability":{"type":["string","null"],"description":"Availability to fulfill the order with the item."},"measurementUnit":{"type":"string","description":"Replacing item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Replacing item's unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Provided by the manufacturers to identify their product. This field must be completed if the replacing item has a manufacturer's code."},"priceDefinition":{"type":["string","null"],"description":"Replacing item's price information."}}},"description":"Array containing information about the item replacing the previous one."},"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"receiptData":{"type":["object","null"],"description":"Information about the receipt after order modifications."},"shippingData":{"title":"ShippingData3","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","items":{"title":"LogisticsInfo2","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"type":"object","properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modifications shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modifications [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}}}}}}},"date":{"type":"string","description":"Date and time of the request. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"origin":{"required":["account","orderId","component"],"type":"object","properties":{"account":{"type":"string","description":"Name of the account where the order was made."},"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"component":{"type":"string","description":"Component information."}},"description":"Object containing information about the order origin."},"settings":{"required":["customPaymentSystemsAllowed"],"type":"object","description":"Object with account settings information, such as custom payment.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"Store's [custom payment](https://help.vtex.com/tutorial/how-to-configure-a-custom-payment--tutorials_451) information. Applicable only for stores that configured custom payment options.","items":{"type":"string","description":"Custom payment code."}}}}}}},"actions":{"type":"array","description":"Array containing previous changing order actions history.","items":{"type":["object","null"],"description":"Changing order action details, with a schema like the `requests` property."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a history of every successful [Create order modifications request](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) made to an order and provides detailed information about each request. + + You can access an order's history using the `changeOrderId`, which corresponds to its `orderId`. + + > If you want detailed information about a single modification request, you can use the endpoint [Get order modifications details](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes/-changeRequestId-). + + ## Permissions + + Any user or [API key](https:/developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order you wish to get the modifications history. | + | `an` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 16 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications summary.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications summary.yml new file mode 100644 index 0000000000..c9a60d4c64 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Get order modifications summary.yml @@ -0,0 +1,81 @@ +info: + name: Get order modifications summary + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/orders/pvt/document/:orderId/change-summary" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: v12772213qst-02 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/orders/pvt/document/:orderId/change-summary - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/orders/pvt/document/:orderId/change-summary - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/orders/pvt/document/:orderId/change-summary - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/orders/pvt/document/:orderId/change-summary - Schema is valid", function () { + const schema = {"type":"object","description":"Summary of modifications made to an order.","properties":{"original":{"type":"array","description":"Summary of the original items in the order before modifications.","items":{"type":"object","properties":{"totalQuantity":{"type":"integer","description":"Total quantity of the item."},"quantity":{"type":"integer","description":"Quantity of the item."},"deliveryIds":{"type":["array","null"],"items":{"title":"DeliveryIdResponse","type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items in the warehouse or dock."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"itemIndex":{"type":"integer","description":"Each item in the order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"uniqueId":{"type":"string","description":"Alphanumeric sequence that identifies an SKU in a given order."},"id":{"type":"string","description":"Unique identifier of the SKU."},"productId":{"type":"string","description":"ID of the product associated with the item."},"lockId":{"type":"string","description":"Reservation ID."},"ean":{"type":["string","null"],"description":"EAN of the SKU."},"seller":{"type":"string","description":"Seller related to the order."},"sellerSku":{"type":"string","description":"SKU ID from the seller perspective."},"priceValidUntil":{"type":["string","null"],"description":"Date until when the price is going to be valid if there is a promotion. The date uses [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"name":{"type":"string","description":"Name of the item as displayed to customers in the storefront."},"additionalInfo":{"type":"object","description":"Additional information about the item.","properties":{"brandName":{"type":"string","description":"Item's brand name."},"brandId":{"type":"string","description":"Item's brand ID."},"categoriesIds":{"type":"string","description":"Item's category ID."},"dimension":{"type":"object","description":"Item's dimension.","properties":{"cubicweight":{"type":"number","description":"Item's cubic weight."},"height":{"type":"number","description":"Item's height."},"length":{"type":"number","description":"Item's length."},"weight":{"type":"number","description":"Item's weight."},"width":{"type":"number","description":"Item's width."}}},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial conditions ID."},"offeringInfo":{"type":["object","null"],"description":"Information about services related to the item. For example: guarantee or installation."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":"string","description":"Offering type ID."},"categories":{"type":"array","description":"Items categories information.","items":{"type":"object","description":"Category information.","properties":{"id":{"type":"number","description":"Category ID."},"name":{"type":"string","description":"Category name."}}}}}},"attachments":{"type":"array","description":"Array containing information on attachments.","items":{"type":"string","description":"Attachments information."}},"attachmentOfferings":{"type":["array","null"],"description":"Array containing attachments details.","items":{"type":"object","description":"Attachments details.","properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."}}}},"assemblies":{"type":["array","null"],"description":"Information about items customization.","items":{"type":"string","description":"Customization information."}},"refId":{"type":"string","description":"SKU reference ID."},"shippingPrice":{"type":["integer","null"],"description":"Item's shipping price."},"price":{"type":"integer","description":"Item's price."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"manualPrice":{"type":["integer","null"],"description":"Item's [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User ID or appKey that made the manual price modification."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"customTax":{"type":["number","null"],"description":"Custom tax in cents, when applicable."},"rewardValue":{"type":"integer","description":"Item's reward value."},"freightCommission":{"type":"integer","description":"Value of the freight commission."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"priceTags":{"type":"array","description":"List of objects with item's price modifiers.","items":{"type":"object","description":"Price modifiers."}},"imageUrl":{"type":"string","description":"SKU image URL."},"detailUrl":{"type":"string","description":"SKU slug."},"components":{"type":"array","description":"Item's components.","items":{"type":"string","description":"Components."}},"bundleItems":{"type":"array","description":"This field groups offerings (services) related to the item and displays their ID and quantity. A gift package is an example of an offering.","items":{"type":"object","description":"Item's offering details.","properties":{"id":{"type":"integer","description":"Offering ID."},"quantity":{"type":"integer","description":"Offering quantity."}}}},"offerings":{"type":"array","description":"Item's offerings, which are services related to the item. For example, guarantee or installation.","items":{"type":"string","description":"Service name related to the item."}},"preSaleDate":{"type":["string","null"],"description":"Item's pre sale date."},"isGift":{"type":"boolean","description":"This field is `true` when the item is a gift in order context and `false` when it is not."},"taxCode":{"type":["string","null"],"description":"Item's tax code."},"measurementUnit":{"type":"string","description":"Item's measurement unit."},"unitMultiplier":{"type":"number","description":"Item's unit multiplier."},"marketingData":{"type":["object","null"],"description":"Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs.","properties":{"id":{"type":"string","description":"Object ID. The expected value is `marketingData`."},"utmSource":{"type":"string","description":"Value of the `utm_source` parameter of the URL that led to the request."},"utmPartner":{"type":"string","description":"UTM Source Parameters."},"utmMedium":{"type":"string","description":"Value of the `utm_medium` parameter of the URL that led to the request."},"utmCampaign":{"type":"string","description":"Value of the `utm_campaign` parameter of the URL that led to the request."},"coupon":{"type":"string","description":"Coupon code."},"utmiCampaign":{"type":"string","description":"Internal UTM value `utmi_cp`."},"utmipage":{"type":"string","description":"Internal UTM value `utmi_p`."},"utmiPart":{"type":"string","description":"Internal UTM value `utmi_pc`."},"marketingTags":{"type":"string","description":"Marketing tags information. This field can be used to register campaign data or informative tags regarding promotions.","items":{"type":"string","description":"Marketing tag."}}}},"parentAssemblyBinding":{"type":["string","null"],"description":"When items are indexed in between each other, this field returns the assembly option ID. This response is `null` for items that are not [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)."},"parentItemIndex":{"type":["integer","null"],"description":"Ranking number that shows how related items are indexed in between each other. It starts at `0` as the primary item reference and counts up to `1`, `2`, and so on. For example, a customer bought sunglasses and hired a warranty service. Since the sunglasses are index `0`, the warranty service (the [assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)) is index `1` and has the `parentItemIndex` value `0`. This response is `null` for items that are not assembly options."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator responsible for the order."},"priceDefinition":{"type":"object","description":"Item's price information.","properties":{"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value of all item's units in cents."},"sellingPrices":{"type":"array","description":"Details on item's selling price.","items":{"type":"object","description":"Selling price.","properties":{"value":{"type":"integer","description":"Total value of items in cents."},"quantity":{"type":"integer","description":"Quantity of items."}}}},"reason":{"type":"string","description":"Reason for the price change."}}},"costPrice":{"type":"integer","description":"Item's cost price in cents."}}}},"added":{"type":"array","description":"Array containing information on added items of order modification.","items":{"type":"object","description":"Information about added items.","properties":{"id":{"type":"string","description":"SKU ID of the item being added."},"uniqueId":{"type":"string","description":"Unique ID of the item being added."},"totalQuantity":{"type":"integer","description":"Total quantity of the item being added."},"quantity":{"type":"integer","description":"Quantity of the item being added."},"price":{"type":"integer","description":"Price of the item being added."},"measurementUnit":{"type":"string","description":"Measurement unit of the item being added."},"unitMultiplier":{"type":"number","description":"Unit multiplier of the item being added."},"imageUrl":{"type":"string","description":"Image URL of the item being added."},"sellingPrice":{"type":"integer","description":"Selling price of the item being added."},"priceTags":{"type":"array","description":"List of objects with item's price modifiers.","items":{"type":"string","description":"Price modifiers."}},"detailUrl":{"type":"string","description":"Slug of the SKU being added."},"name":{"type":"string","description":"Name of the item being added."},"refId":{"type":"string","description":"SKU reference ID of the item being added."},"deliveryIds":{"type":["array","null"],"description":"Array containing information about the delivery IDs of the item being added.","items":{"title":"DeliveryIdResponse","type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items in the warehouse or dock."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}}}}},"removed":{"type":"array","description":"Array containing information on removed items of order modification.","items":{"type":"object","properties":{"id":{"type":"string","description":"SKU ID of the item being removed."},"uniqueId":{"type":"string","description":"Unique ID of the item being removed."},"quantity":{"type":"integer","description":"Quantity of the item being removed."},"price":{"type":"integer","description":"Price of the item being removed."},"measurementUnit":{"type":"string","description":"Measurement unit of the item being removed."},"unitMultiplier":{"type":"number","description":"Unit multiplier of the item being removed."},"imageUrl":{"type":"string","description":"Image URL of the item being removed."},"sellingPrice":{"type":"integer","description":"Selling price of the item being removed."},"priceTags":{"type":"array","description":"List of objects with item's price modifiers.","items":{"type":"string","description":"Price modifiers."}},"detailUrl":{"type":"string","description":"Slug of the SKU being removed."},"name":{"type":"string","description":"Name of the item being removed."},"refId":{"type":"string","description":"SKU reference ID of the item being removed."},"deliveryIds":{"type":["array","null"],"description":"Array containing information about the delivery IDs of the item being removed.","items":{"title":"DeliveryIdResponse","type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items in the warehouse or dock."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}}}}},"replaced":{"type":"array","description":"Array containing information on replaced items of order modification.","items":{"type":"object","properties":{"replaceType":{"type":"string","description":"Type of replacement operation.","enum":["ItemReplacement","WeightChange","PriceChange","QuantityChange"]},"userInputType":{"type":"string","description":"Type of replacement operation.","enum":["ItemReplacement","WeightChange","PriceChange","QuantityChange"]},"from":{"type":"object","description":"Information about item being replaced.","properties":{"items":{"type":"array","items":{"type":"object","description":"Details about the item being replaced.","properties":{"id":{"type":"string","description":"SKU ID of the item being replaced."},"uniqueId":{"type":"string","description":"Unique ID of the item being replaced."},"quantity":{"type":"integer","description":"Quantity of the item being replaced."},"price":{"type":"integer","description":"Price of the item being replaced."},"measurementUnit":{"type":"string","description":"Measurement unit of the item being replaced."},"unitMultiplier":{"type":"number","description":"Unit multiplier of the item being replaced."},"imageUrl":{"type":"string","description":"Image URL of the item being replaced."},"sellingPrice":{"type":"integer","description":"Selling price of the item being replaced."},"priceTags":{"type":"array","description":"List of objects with item's price modifiers.","items":{"type":"string","description":"Price modifiers."}},"detailUrl":{"type":"string","description":"URL slug of the item being replaced."},"name":{"type":"string","description":"Name of the item being replaced."},"refId":{"type":"string","description":"SKU reference ID of the item being replaced."},"deliveryIds":{"type":["array","null"],"description":"Array containing information about the delivery IDs of the item being replaced.","items":{"title":"DeliveryIdResponse","type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items in the warehouse or dock."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}}}}},"shippingData":{"type":["object","null"],"description":"Shipping data object.","properties":{"logisticsInfo":{"type":"array","items":{"type":"object","description":"Logistics information object.","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID of the replacing item."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications shipping policy."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modification shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Replacing item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Replacing item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Replacing item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Replacing item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Change item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modification [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}}}}}}},"to":{"type":"object","description":"Information about item replacing the previous one.","properties":{"items":{"type":"array","items":{"type":"object","description":"Details about the item replacing the previous one.","properties":{"id":{"type":"string","description":"SKU ID of the item being replaced."},"uniqueId":{"type":"string","description":"Unique ID of the item replacing the previous one."},"quantity":{"type":"integer","description":"Quantity of the item replacing the previous one."},"price":{"type":"integer","description":"Price of the item replacing the previous one."},"measurementUnit":{"type":"string","description":"Measurement unit of the item replacing the previous one."},"unitMultiplier":{"type":"number","description":"Unit multiplier of the item replacing the previous one."},"imageUrl":{"type":"string","description":"Image URL of the item replacing the previous one."},"sellingPrice":{"type":"integer","description":"Selling price of the item replacing the previous one."},"priceTags":{"type":"array","description":"List of objects with item's price modifiers.","items":{"type":"string","description":"Price modifiers."}},"detailUrl":{"type":"string","description":"URL slug of the item being replaced."},"name":{"type":"string","description":"Name of the item replacing the previous one."},"refId":{"type":"string","description":"SKU reference ID of the item replacing the previous one."},"deliveryIds":{"type":["array","null"],"description":"Array containing information about the delivery IDs of the item being replaced.","items":{"title":"DeliveryIdResponse","type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items in the warehouse or dock."},"totalListPrice":{"type":["integer","null"],"description":"Total list price in cents."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}}}}},"shippingData":{"type":["object","null"],"description":"Shipping data object.","properties":{"logisticsInfo":{"type":"array","description":"Array with shipping information.","items":{"type":"object","description":"Logistics information object.","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID of the replacing item."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications shipping policy."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modification shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Replacing item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Replacing item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Replacing item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Replacing item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Change item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modification [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}}}}}}},"type":{"type":"string","description":"Type of replacement operation.","enum":["UserInput","System"]}}}},"manualDiscountValueAggregated":{"type":"integer","description":"This field shows if a manual price was applied to the total order amount. The value is in cents."},"manualIncrementValueAggregated":{"type":"integer","description":"This field shows if an increment value was applied to the total order amount. The value is in cents."},"totalChangeValueAggregated":{"type":"integer","description":"This field shows how much the order total price is, considering that price modifications might have been made. The value is in cents."},"totals":{"items":{"type":"array","description":"Information about the order totals.","items":{"type":"object","description":"Details about the order totals.","properties":{"id":{"type":"string","description":"Total ID, which defines what the total is about.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value in cents."},"alternativeTotals":{"type":["array","null"],"description":"Information about the order alternative totals, when applicable. For example, when there is a discount for items in the marketplace that results in a difference in the `Items` total value, the `alternativeTotals` can retrieve details about it.","items":{"type":"object","description":"Details about the order alternative totals.","properties":{"id":{"type":"string","description":"Alternative total ID, which can be related to items, discounts, shipping or taxes."},"name":{"type":"string","description":"Alternative total name."},"value":{"type":"integer","description":"Alternative total value in cents."}}}}}}}},"lastChange":{"type":"string","description":"Date and time of the last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}},"example":{"original":[{"totalQuantity":3,"quantity":3,"deliveryIds":[{"courierId":"1","warehouseId":"1_1","dockId":"1","courierName":"Transportadora","quantity":4,"totalListPrice":null,"accountCarrierName":"Store Name","kitItemDetails":[]}],"itemIndex":0,"uniqueId":"368A04D405BE40F9888D23920ACA17EC","id":"4","productId":"4","lockId":"00-1537351038731-01","ean":"7896025801879","seller":"1","sellerSku":"4","priceValidUntil":"2026-06-05T15:01:17Z","name":"Banana","additionalInfo":{"brandName":"Brand name","brandId":"20000","categoriesIds":"/1/","dimension":{"cubicweight":1,"height":10,"length":10,"weight":5,"width":10},"productClusterId":"","commercialConditionId":"1","offeringInfo":null,"offeringType":null,"offeringTypeId":null,"categories":[{"id":1,"name":"Grocery"}]},"attachments":[],"attachmentOfferings":null,"assemblies":null,"refId":"151762","shippingPrice":null,"price":1199,"sellingPrice":599,"listPrice":1199,"manualPrice":null,"manualPriceAppliedBy":null,"tax":215,"customTax":null,"rewardValue":0,"freightCommission":0,"commission":0,"priceTags":[{"name":"tax@price-ecc63e22-47ba-4f6c-843b-cfce4f06995e#bf555b6a-3049-4242-9f34-24a5bbb2a6ca","rawValue":0.275,"isPercentual":true,"identifier":"ecc63e22-47ba-4f6c-843b-cfce4f06995e","rate":null,"jurisCode":null,"jurisType":null,"jurisName":null},{"name":"tax@price-45ef7f98-c05d-4d23-a867-593e1b8eecb7#3e134d5e-2e9b-4117-9f53-6a2ad41f8885","rawValue":1.5,"isPercentual":false,"identifier":"45ef7f98-c05d-4d23-a867-593e1b8eecb7","rate":null,"jurisCode":null,"jurisType":null,"jurisName":null}],"imageUrl":"https://example.com/image.jpg","detailUrl":"/banana/p","components":[],"bundleItems":[],"offerings":[],"preSaleDate":null,"isGift":false,"taxCode":"","measurementUnit":"kg","unitMultiplier":1,"marketingData":null,"parentAssemblyBinding":null,"parentItemIndex":null,"callCenterOperator":null,"priceDefinition":{"calculatedSellingPrice":599,"total":1797,"sellingPrices":[{"value":599,"quantity":3}],"reason":null},"costPrice":599}],"added":[{"id":"11","uniqueId":"DF6E5BB06ED84724A29A68ED392F99CE","totalQuantity":1,"quantity":1,"price":749,"measurementUnit":"un","unitMultiplier":1,"imageUrl":"https://example.com/image.jpg","sellingPrice":749,"priceTags":[],"detailUrl":"/nuggets/p","name":"Nuggets","refId":"XX00021","deliveryIds":[{"courierId":"1","warehouseId":"1_1","dockId":"1","courierName":"Transportadora","quantity":5,"totalListPrice":null,"accountCarrierName":"Store Name","kitItemDetails":[]}]}],"removed":[{"id":"17","uniqueId":"8A6A0E3F26DE4F479F9017A60784DF2F","quantity":7,"price":5500,"measurementUnit":"un","unitMultiplier":1,"imageUrl":"https://example.com/image.jpg","sellingPrice":5500,"priceTags":[],"detailUrl":"/plush-shark-18/p","name":"Plush shark","refId":null,"deliveryIds":[{"courierId":"1","warehouseId":"1_1","dockId":"1","courierName":"Transportadora","quantity":7,"totalListPrice":null,"accountCarrierName":"Store Name","kitItemDetails":[]}]}],"replaced":[{"replaceType":"WeightChange","userInputType":"WeightChange","from":{"items":[{"id":"1","uniqueId":"6024FC8687884BC3B9AA9A8630C52804","quantity":1,"price":765,"measurementUnit":"kg","unitMultiplier":1,"imageUrl":"https://example.com/image.jpg","sellingPrice":765,"priceTags":[],"detailUrl":"/apple/p","name":"Apple","refId":"197326","deliveryIds":[{"courierId":"1","warehouseId":"1_1","dockId":"1","courierName":"Transportadora","quantity":5,"totalListPrice":null,"accountCarrierName":"recorrenciacharlie","kitItemDetails":[]}]}],"shippingData":null},"to":{"items":[{"id":"1","uniqueId":"6024FC8687884BC3B9AA9A8630C52804","totalQuantity":1,"quantity":1,"price":765,"measurementUnit":"kg","unitMultiplier":2,"imageUrl":"https://example.com/image.jpg","sellingPrice":1530,"priceTags":[],"detailUrl":"/apple/p","name":"Apple","refId":"197326","deliveryIds":[{"courierId":"1","warehouseId":"1_1","dockId":"1","courierName":"Transportadora","quantity":5,"totalListPrice":null,"accountCarrierName":"Store Name","kitItemDetails":[]}]}],"shippingData":null},"type":"UserInput"}],"manualDiscountValueAggregated":0,"manualIncrementValueAggregated":0,"totalChangesValueAggregated":-37393,"totals":[{"id":"Items","name":"Items Total","value":-37684,"alternativeTotals":null},{"id":"Discounts","name":"Discounts Total","value":600,"alternativeTotals":null},{"id":"Shipping","name":"Shipping Total","value":-94,"alternativeTotals":null},{"id":"Tax","name":"Tax Total","value":-215,"alternativeTotals":null}],"lastChange":"2025-06-05T17:03:41.3219923Z"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a summary of modifications of every successful [Create order modifications request](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) made to an order and provides an overview of each request. + > ⚠️ If you want information about all the modifications made to an order, use the [Get order modifications history endpoint](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes). + ## Permissions + Any user or API key must have the appropriate License Manager resource to successfully run this request: + | Product | Category | Resource | + |---------|----------|----------| + | OMS | OMS access | **OMS Viewer** | + You can create a custom role with this resource or use one of the following predefined roles: + - **OMS - Full access** (OMS Viewer) + - **Checkout Admin** (OMS Viewer) + - **IntegrationProfile - Fulfillment Oms** (OMS Viewer) + For more information about security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Preview order modifications.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Preview order modifications.yml new file mode 100644 index 0000000000..78404946e1 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Preview order modifications.yml @@ -0,0 +1,222 @@ +info: + name: Preview order modifications + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes/preview?an=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + body: + type: json + data: |- + { + "reason": "The client wants to change a weighable product.", + "replace": [ + { + "from": { + "items": [ + { + "id": "12345", + "quantity": 2, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "price": 2499 + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B177D2F9F96DC711" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-OLD" + } + ] + } + ] + } + }, + "to": { + "items": [ + { + "id": "2", + "quantity": 1, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "measurementUnit": "kg", + "unitMultiplier": 3, + "manualDiscountValue": 0, + "manualIncrementValue": 0, + "clientProfileData": [ + { + "firstName": "Jane", + "lastName": "Earhart", + "documentType": "cpf", + "document": "123456789", + "phone": "55110988887777", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false + } + ] + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B133D2F9F96DC713" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-NEW" + } + ] + } + ] + }, + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "price": 1000 + } + ] + } + } + } + ], + "settings": { + "paymentConfiguration": { + "customPaymentSystemsAllowed": [ + "201" + ] + }, + "rolloutConfiguration": { + "enableApi": true, + "enableAdminOrders": { + "enabledWorkspaces": [ + "*" + ] + }, + "enableMyOrders": { + "enabledWorkspaces": [ + "storename" + ] + } + }, + "pipelineConfiguration": { + "enableTaxHubRecalculation": false, + "compensateShippingChanges": true, + "enablePromotionRecalculation": true, + "enableNativeTaxRecalculation": true + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/order-system/orders/:changeOrderId/changes/preview - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/order-system/orders/:changeOrderId/changes/preview - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/order-system/orders/:changeOrderId/changes/preview - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/order-system/orders/:changeOrderId/changes/preview - Schema is valid", function () { + const schema = {"type":"object","required":["reason","manualDiscountValue","manualIncrementValue","totalChangeValue","totals","add","remove","replace","date","origin","settings"],"properties":{"reason":{"type":"string","description":"Reason why you wish to modify the order. Since you can make several modifications to an order, filling this field with a clear explanation helps organize the order modifications history. The shopper can view this field value in [transactional emails](https://help.vtex.com/en/tutorial/order-transactional-email-templates--3g2S2kqBOoSGcCaqMYK2my) and [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh)."},"manualDiscountValue":{"type":"integer","description":"This field shows if a manual price was applied to the total order amount. The value is in cents."},"manualIncrementValue":{"type":"integer","description":"This field shows if an increment value was applied to the total order amount. The value is in cents."},"totalChangeValue":{"type":"integer","description":"This field shows how much is the order total price considering that price modifications might have been made. The value is in cents."},"totals":{"type":"array","description":"Array containing total costs information.","items":{"type":"object","description":"Total changing price details for a given type of cost.","properties":{"id":{"type":"string","description":"Changing price type, for example the item price or shipping costs."},"name":{"type":"string","description":"Changing price name."},"value":{"type":"number","description":"Changing price value in cents."}}}},"add":{"type":["array","null"],"description":"Array with information about the `add` operation, when applicable. The schema will correspond to the object `to` inside the `replace` array.","items":{"type":"string","description":"Adding operation information, when applicable."}},"remove":{"type":["array","null"],"description":"Array with information about the `remove` operation, when applicable. The schema will correspond to the object `from` inside the `replace` array.","items":{"type":"string","description":"Removing operation information, when applicable."}},"replace":{"type":"array","description":"Array with information about the `replace` operation, when applicable.","items":{"type":"object","description":"Replacing operation object.","required":["from","to"],"properties":{"from":{"type":"object","description":"What the order is changing from.","required":["paymentData","items","shippingData"],"properties":{"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"items":{"type":"array","description":"Items information from before the order change.","items":{"title":"Item4","required":["id","quantity","price","measurementUnit","unitMultiplier","sellingPrice","name","detailUrl","imageUrl"],"type":"object","properties":{"id":{"type":"string","description":"SKU ID of the item."},"quantity":{"type":"integer","description":"Quantity of items been replaced."},"price":{"type":["string","null"],"description":"Item's shipping price. It does not account for the whole order's shipping price and is presented in cents."},"measurementUnit":{"type":["string","null"],"description":"Item's measurement unit. For example, `kg` for kilograms or `un` for unitary items."},"unitMultiplier":{"type":"integer","description":"Item's unit multiplier."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"name":{"type":["string","null"],"description":"Item's name."},"detailUrl":{"type":["string","null"],"description":"Item's URL slug."},"imageUrl":{"type":["string","null"],"description":"Item's image URL slug."}}}},"shippingData":{"title":"ShippingData3","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","items":{"title":"LogisticsInfo2","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"type":"object","properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modifications shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modifications [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}}}},"to":{"title":"To2","required":["items","paymentData","receiptData","shippingData"],"type":"object","properties":{"items":{"type":"array","items":{"type":"object","description":"Object with item details.","required":["uniqueId","id","productId","productRefId","refId","ean","name","skuName","modalType","parentItemIndex","parentAssemblyBinding","assemblies","priceValidUntil","tax","price","listPrice","manualPrice","manualPriceAppliedBy","sellingPrice","rewardValue","isGift","additionalInfo","preSaleDate","productCategoryIds","productCategories","quantity","seller","sellerChain","imageUrl","detailUrl","components","bundleItems","attachments","attachmentOfferings","offerings","priceTags","availability","measurementUnit","unitMultiplier","manufacturerCode","priceDefinition"],"properties":{"uniqueId":{"type":"string","description":"Item's unique ID in the order modifications request."},"id":{"type":"string","description":"SKU ID of the item replacing the previous one."},"productId":{"type":["string","null"],"description":"Product ID of the item replacing the previous one."},"productRefId":{"type":["string","null"],"description":"Product Ref ID of the item replacing the previous one."},"refId":{"type":["string","null"],"description":"Reference ID of the item replacing the previous one."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item replacing the previous one."},"name":{"type":["string","null"],"description":"Name of the Product associated with the item replacing the previous one."},"skuName":{"type":["string","null"],"description":"Name of the SKU replacing the previous one."},"modalType":{"type":["string","null"],"description":"A [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) attaches an unusual product, such as meat or glass, to a carrier specialized in shipping it."},"parentItemIndex":{"type":["integer","null"],"description":"Parent item index of the item replacing the previous one."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding of the item replacing the previous one."},"assemblies":{"type":["array","null"],"description":"Array with information about services that may be offered for the item replacing the previous one. For example, the assembly of a piece of furniture or warranty.","items":{"type":"string","description":"Customization information."}},"priceValidUntil":{"type":["string","null"],"description":"Price expiration date of item replacing the previous one. The value is in the format `yyyy-mm-ddThh:mm:ss.sss`."},"tax":{"type":"integer","description":"Tax in cents of the item replacing the previous one, when applicable."},"price":{"type":["integer","null"],"description":"Final price of the item replacing the previous one, calculated in cents."},"listPrice":{"type":["integer","null"],"description":"Item's price list for the item replacing the previous one."},"manualPrice":{"type":["integer","null"],"description":"Manual price of the item replacing the previous one. It is calculated in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"User ID or appKey that made the manual price modification of the item replacing the previous one."},"sellingPrice":{"type":["integer","null"],"description":"Selling price of the item replacing the previous one. It is calculated in cents."},"rewardValue":{"type":"integer","description":"Reward value of the item replacing the previous one. It is calculated in cents."},"isGift":{"type":"boolean","description":"This field is `true` when the replacing item is a gift in the order context and `false` when it is not."},"additionalInfo":{"type":"object","description":"Additional information object.","required":["dimension","brandName","brandId","offeringInfo","offeringType","offeringTypeId","categoriesIds","productClusterId","commercialConditionId"],"properties":{"dimension":{"type":["string","null"],"description":"Replacing item's dimensions in the measure unit configured in the catalog."},"brandName":{"type":["string","null"],"description":"Replacing item's brand name."},"brandId":{"type":["string","null"],"description":"Replacing item's brand ID."},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."},"categoriesIds":{"type":["string","null"],"description":"ID of the replacing item product category."},"productClusterId":{"type":["string","null"],"description":"All product clusters related to the replacing item."},"commercialConditionId":{"type":["string","null"],"description":"Replacing item commercial conditions ID."}}},"preSaleDate":{"type":["string","null"],"description":"Pre sale date of the item replacing the previous one."},"productCategoryIds":{"type":["string","null"],"description":"Replacing item's category path composed of category IDs separated by `/`. For example: `/3/15/`."},"productCategories":{"type":"object","description":"Object containing product categories of the replacing item. Structure: `{CategoryID}: {CategoryName}`. Both the key and the value are strings."},"quantity":{"type":"integer","description":"Quantity of replacing items."},"seller":{"type":["string","null"],"description":"Seller ID that identifies the seller the replacing item belongs to."},"sellerChain":{"type":["array","null"],"description":"Array containing information about sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://developers.vtex.com/docs/guides/multilevel-omnichannel-inventory) order.","items":{"type":["string","null"],"description":"Seller identification."}},"imageUrl":{"type":["string","null"],"description":"Image URL slug of the replacing item."},"detailUrl":{"type":["string","null"],"description":"URL slug of the replacing item."},"components":{"type":"array","items":{"type":"string","description":"Replacing item's component."},"description":"Array with information about replacing item's components."},"bundleItems":{"type":"array","items":{"type":"string","description":"Service sold with the replacing item."},"description":"Array with information about services sold along with the replacing item, such as a gift package."},"attachments":{"type":"array","items":{"type":"string","description":"Information about a given attachment."},"description":"Array containing information on attachments."},"attachmentOfferings":{"type":"array","items":{"type":"string","description":"Information about a given offering."},"description":"Array with the properties of the content declared in the field `attachments`."},"offerings":{"type":"array","items":{"type":"string","description":"Item's offering."},"description":"Array with replacing items Item's offerings."},"priceTags":{"type":"array","items":{"type":"string","description":"Item modifier."},"description":"Array containing objects with replacing item's price modifiers."},"availability":{"type":["string","null"],"description":"Availability to fulfill the order with the item."},"measurementUnit":{"type":"string","description":"Replacing item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Replacing item's unit multiplier."},"manufacturerCode":{"type":["string","null"],"description":"Provided by the manufacturers to identify their product. This field must be completed if the replacing item has a manufacturer's code."},"priceDefinition":{"type":["string","null"],"description":"Replacing item's price information."}}},"description":"Array containing information about the item replacing the previous one."},"paymentData":{"type":"object","description":"Payment data object.","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Information about financial transactions.","items":{"type":"string","description":"Array containing financial information. This is an optional field."}}}},"receiptData":{"type":["object","null"],"description":"Information about the receipt after order modifications."},"shippingData":{"title":"ShippingData3","required":["logisticsInfo"],"type":"object","properties":{"logisticsInfo":{"type":"array","items":{"title":"LogisticsInfo2","required":["itemIndex","selectedSla","addressId","slas","shipsTo","itemId","deliveryChannels","price","listPrice","shippingEstimate","dockEstimate","shippingEstimateDate","lockTTL","deliveryCompany","polygonName","transitTime","sellingPrice","deliveryIds","deliveryWindow","pickupPointId","pickupStoreInfo","pickupDistance"],"type":"object","properties":{"itemIndex":{"type":"integer","description":"Index that identifies the position of the replacing item in the array, starting from `0`."},"selectedSla":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order."},"addressId":{"type":"string","description":"Shipping address ID."},"slas":{"type":"array","items":{"description":"Service Level Agreement (SLA) object.","required":["id","deliveryChannel","name","deliveryIds","shippingEstimate","shippingEstimateDate","lockTTL","availableDeliveryWindows","deliveryWindow","price","listPrice","tax","pickupStoreInfo","pickupPointId","pickupDistance","polygonName","transitTime"],"type":"object","properties":{"id":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup."},"deliveryChannel":{"type":"string","description":"Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."},"name":{"type":"string","description":"Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Information about delivery IDs."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping duration estimated in days. For instance, three business days is represented as `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"availableDeliveryWindows":{"type":"array","items":{"type":"string","description":"Delivery window."},"description":"Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations."},"deliveryWindow":{"type":["object","null"],"description":"[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.","properties":{"startDateUtc":{"type":"string","description":"Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":"string","description":"Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Item's price list for a specific trade policy."},"tax":{"type":"integer","description":"Tax in cents, when applicable."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupPointId":{"type":["string","null"],"description":"Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`."}}},"description":"Information on Service Level Agreement (SLA) of the order modifications."},"shipsTo":{"type":"array","items":{"type":"string","description":"Country name represented in a three letters code ISO 3166 ALPHA-3."},"description":"List of countries of the order modifications shipping address."},"itemId":{"type":"string","description":"Replacing item's SKU ID, which is a unique numerical identifier."},"deliveryChannels":{"type":"array","items":{"title":"DeliveryChannel","required":["id"],"type":"object","properties":{"id":{"type":"string","description":"Order modifications shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery."}}},"description":"Array with the delivery channels associated with the trade policy."},"price":{"type":"integer","description":"Item's final price, calculated in cents."},"listPrice":{"type":"integer","description":"Item's price list, calculated in cents."},"shippingEstimate":{"type":["string","null"],"description":"Item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`."},"dockEstimate":{"type":["string","null"],"description":"Item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`."},"deliveryCompany":{"type":["string","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryIds":{"type":"array","items":{"title":"DeliveryIdV2","required":["courierId","warehouseId","dockId","courierName","quantity","kitItemDetails","accountCarrierName"],"type":"object","properties":{"courierId":{"type":"string","description":"ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"courierName":{"type":"string","description":"Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"quantity":{"type":"integer","description":"Quantity of items."},"kitItemDetails":{"type":"array","items":{"type":["string","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order."}},"accountCarrierName":{"type":["string","null"],"description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)."}}},"description":"Array with delivery information."},"deliveryWindow":{"type":["string","null"],"description":"Order modifications [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"pickupPointId":{"type":["string","null"],"description":"ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"pickupStoreInfo":{"type":"object","description":"Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["isPickupStore","friendlyName","address","additionalInfo","dockId"],"properties":{"isPickupStore":{"type":["boolean","null"],"description":"This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated."},"friendlyName":{"type":["string","null"],"description":"Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated."},"address":{"type":["string","null"],"description":"Address of the loading dock converted to pickup point. This field has been deprecated."},"additionalInfo":{"type":["string","null"],"description":"Additional information about the loading dock converted to pickup point. This field has been deprecated."},"dockId":{"type":["string","null"],"description":"ID of the loading dock converted to pickup point. This field has been deprecated."}}},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Array with shipping information."}}}}}}}},"date":{"type":"string","description":"Date and time of the request in UTC ISO 8601 format, as in `yyyy-mm-ddThh:mm:ss.sssZ`."},"origin":{"required":["account","orderId","component"],"type":"object","properties":{"account":{"type":"string","description":"Name of the account where the order was made."},"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"component":{"type":"string","description":"Component information."}},"description":"Object containing information about the order origin."},"settings":{"type":"object","description":"Object with all VTEX account settings related to the **Order modifications** feature.","properties":{"paymentConfiguration":{"type":"object","description":"[Order modifications](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ) payment configurations.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"List of custom payment system IDs configured for the VTEX account.","items":{"type":"string","description":"Payment system ID."}}}},"rolloutConfiguration":{"type":"object","description":"**Order modifications** settings regarding VTEX Admin, [Orders API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes?endpoint=patch-/api/order-system/orders/-changeOrderId-/changes) and **My Account** feature.","properties":{"usingDefaultBehavior":{"type":"boolean","description":"Defines if the **Order modifications** configurations are the default behaviour (`true`) or if the account made customizations to it (`false`). Subaccounts will have the same configurations as the main account.","default":false},"enableApi":{"type":"boolean","description":"Defines if the account enabled the [Order modifications API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) (`true`) or not (`false`). The account can only use the [Order modifications via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw) or [via API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) if this field is set to `true`.","default":false},"enableAdminOrders":{"type":"object","description":"Object about enabling the [Order modifications feature via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspaces' names that have the **Order modifications** feature enabled via VTEX Admin.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via VTEX Admin. The asterisk `*` value includes all of the account's workspaces."}}}},"enableMyOrders":{"type":"object","description":"Object about enabling the **Order modifications** feature via [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspace names that have the **Order modifications** feature enabled via **My Account**.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via **My Account**. The asterisk `*` value includes all of the account's workspaces."}}}}}},"pipelineConfiguration":{"type":"object","description":"**Order modifications** settings related to taxes and shipping calculation.","properties":{"enableTaxHubRecalculation":{"type":"boolean","description":"Defines if the tax calculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"compensateShippingChanges":{"type":"boolean","description":"Defines if orders changed will have zero shipping cost (`true`) or not (`false`). Merchants usually enable this configuration to change only items and prices, without impacting the orders original freight costs.","default":false},"enablePromotionRecalculation":{"type":"boolean","description":"Defines if the promotion recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"enableNativeTaxRecalculation":{"type":"boolean","description":"Defines if the native tax recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to simulate an order modification and preview what the real modification will look like if you use the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint. A preview is especially useful for more complex scenarios, such as orders with multiple items and combinations of change operations — add, remove, and replace. Ensuring you get the desired results before making the actual modification helps prevent mistakes. + + ## Tax and promotion recalculation + + We recommend using this endpoint to preview an order modification for items with promotions or tax recalculation. You can use the fields in the `pipelineConfiguration` object to preview an order's discount and native taxes for rates and benefits. This way, you can validate the financial impact before modifying an order. + + The request body is the same one to be used in the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint, and the response body of a successful request provides a preview of the order modifications effect. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order you wish to preview modification. | + | `an` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 14 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Retry order modifications.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Retry order modifications.yml new file mode 100644 index 0000000000..2b2ed81496 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Retry order modifications.yml @@ -0,0 +1,177 @@ +info: + name: Retry order modifications + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/order-system/orders/:changeOrderId/changes/:changeRequestId/retry?an=storeName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storeName + type: query + - name: changeOrderId + value: v12772213qst-02 + type: path + - name: changeRequestId + value: e8532a32-7f7e-434a-88ec-29609f0ede46 + type: path + body: + type: json + data: |- + { + "reason": "The client wants to change a weighable product.", + "replace": [ + { + "from": { + "items": [ + { + "id": "1", + "quantity": 1, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "price": 2499 + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B177D2F9F96DC711" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-OLD" + } + ] + } + ] + } + }, + "to": { + "items": [ + { + "id": "2", + "quantity": 1, + "uniqueId": "1D6A12BD177140B2BAF0C042D2FAEE54", + "measurementUnit": "kg", + "unitMultiplier": 3, + "manualDiscountValue": 0, + "manualIncrementValue": 0, + "clientProfileData": [ + { + "firstName": "Jane", + "lastName": "Earhart", + "documentType": "cpf", + "document": "123456789", + "phone": "55110988887777", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false + } + ] + } + ], + "customData": { + "customFields": [ + { + "linkedEntity": { + "type": "item", + "id": "B2949D0A45244825B133D2F9F96DC713" + }, + "fields": [ + { + "name": "desktop", + "value": "DSK-NEW" + } + ] + } + ] + }, + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "price": 1000 + } + ] + } + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId/retry - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/order-system/orders/:changeOrderId/changes/:changeRequestId/retry - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint makes a new attempt to perform an order modification previously made using the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint that, for some reason, was not completely processed. + + To make this request, you need the `changeRequestId`, a unique change identification code that you get when you make a [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) request. When you retry to modify an order using the `changeRequestId`, instead of creating a new modification, you avoid duplications. + + This endpoint's successful response status code is `204 No Content`, therefore with no response body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `changeOrderId` | path | (Required) Order ID of the order you wish to retry modification. | + | `changeRequestId` | path | (Required) Once you make an order modification, you generate a `requestId` code that identifies the modifications made to that order. This field should be filled with that code. There are no limits to modifications you can perform using the same `changeRequestId`, and we recommend keeping all modifications of a given order grouped by the same `changeRequestId`, so you will have a unified modification history. | + | `an` | query | (Required) Name of the VTEX account that created the order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/Update Order modifications settings.yml b/BrunoCollections/VTEX - Orders API/Order modifications/Update Order modifications settings.yml new file mode 100644 index 0000000000..ce95816fcd --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/Update Order modifications settings.yml @@ -0,0 +1,153 @@ +info: + name: Update Order modifications settings + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/order-system/orders/changes/settings?an=storename" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: storename + type: query + body: + type: json + data: |- + { + "paymentConfiguration": { + "customPaymentSystemsAllowed": [ + "201" + ] + }, + "rolloutConfiguration": { + "enableApi": true, + "enableAdminOrders": { + "enabledWorkspaces": [ + "*" + ] + }, + "enableMyOrders": { + "enabledWorkspaces": [ + "storename" + ] + } + }, + "pipelineConfiguration": { + "enableTaxHubRecalculation": false, + "compensateShippingChanges": true, + "enablePromotionRecalculation": false, + "enableNativeTaxRecalculation": false + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/order-system/orders/changes/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/order-system/orders/changes/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/order-system/orders/changes/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/order-system/orders/changes/settings - Schema is valid", function () { + const schema = {"type":"object","description":"Object with all VTEX account settings related to the **Order modifications** feature.","properties":{"paymentConfiguration":{"type":"object","description":"[Order modifications](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ) payment configurations.","properties":{"customPaymentSystemsAllowed":{"type":"array","description":"List of custom payment system IDs configured for the VTEX account.","items":{"type":"string","description":"Payment system ID."}}}},"rolloutConfiguration":{"type":"object","description":"**Order modifications** settings regarding VTEX Admin, [Orders API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes?endpoint=patch-/api/order-system/orders/-changeOrderId-/changes) and **My Account** feature.","properties":{"usingDefaultBehavior":{"type":"boolean","description":"Defines if the **Order modifications** configurations are the default behaviour (`true`) or if the account made customizations to it (`false`). Subaccounts will have the same configurations as the main account.","default":false},"enableApi":{"type":"boolean","description":"Defines if the account enabled the [Order modifications API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) (`true`) or not (`false`). The account can only use the [Order modifications via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw) or [via API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) if this field is set to `true`.","default":false},"enableAdminOrders":{"type":"object","description":"Object about enabling the [Order modifications feature via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspaces' names that have the **Order modifications** feature enabled via VTEX Admin.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via VTEX Admin. The asterisk `*` value includes all of the account's workspaces."}}}},"enableMyOrders":{"type":"object","description":"Object about enabling the **Order modifications** feature via [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).","properties":{"enabledWorkspaces":{"type":"array","description":"List with the workspace names that have the **Order modifications** feature enabled via **My Account**.","items":{"type":"string","description":"Name of the workspace with **Order modifications** enabled via **My Account**. The asterisk `*` value includes all of the account's workspaces."}}}}}},"pipelineConfiguration":{"type":"object","description":"**Order modifications** settings related to taxes and shipping calculation.","properties":{"enableTaxHubRecalculation":{"type":"boolean","description":"Defines if the tax calculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"compensateShippingChanges":{"type":"boolean","description":"Defines if orders changed will have zero shipping cost (`true`) or not (`false`). Merchants usually enable this configuration to change only items and prices, without impacting the orders original freight costs.","default":false},"enablePromotionRecalculation":{"type":"boolean","description":"Defines if the promotion recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false},"enableNativeTaxRecalculation":{"type":"boolean","description":"Defines if the native tax recalculation is enabled for **Order modifications** (`true`) or not (`false`).","default":false}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the [Order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) settings from a store. + + >ℹ️ To know more about **Order modifications**, see [How Order modifications works](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentConfiguration": { + "customPaymentSystemsAllowed": [ + "201", + "125" + ] + }, + "rolloutConfiguration": { + "usingDefaultBehavior": false, + "enableApi": true, + "enableAdminOrders": { + "enabledWorkspaces": [ + "*" + ] + }, + "enableMyOrders": { + "enabledWorkspaces": [ + "*" + ] + } + }, + "pipelineConfiguration": { + "enableTaxHubRecalculation": false, + "compensateShippingChanges": true, + "enablePromotionRecalculation": false, + "enableNativeTaxRecalculation": false + } + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Order modifications/folder.yml b/BrunoCollections/VTEX - Orders API/Order modifications/folder.yml new file mode 100644 index 0000000000..5e58af9c9f --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Order modifications/folder.yml @@ -0,0 +1,4 @@ +info: + name: Order modifications + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Orders API/Orders/Add log in orders.yml b/BrunoCollections/VTEX - Orders API/Orders/Add log in orders.yml new file mode 100644 index 0000000000..88766d9d42 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Add log in orders.yml @@ -0,0 +1,63 @@ +info: + name: Add log in orders + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/interactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + body: + type: json + data: |- + { + "source": "Postman", + "message": "Add interactions" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/oms/pvt/orders/:orderId/interactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Add a Log in Interactions Order Array. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Unique code that identifies an order. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Orders API/Orders/Cancel order.yml b/BrunoCollections/VTEX - Orders API/Orders/Cancel order.yml new file mode 100644 index 0000000000..1d99ab17bf --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Cancel order.yml @@ -0,0 +1,117 @@ +info: + name: Cancel order + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/cancel" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + body: + type: json + data: |- + { + "reason": "Unexpected stock shortage" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/oms/pvt/orders/:orderId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/cancel - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/cancel - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/cancel - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Date and time when the notification was received."},"orderId":{"type":"string","description":"Identification of the order in the seller."},"receipt":{"type":"string","description":"Protocol code generated by the update. It may be `null`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels an order using its identification code (`orderId`). A common scenario is when the seller has a problem fulfilling the order and requests the marketplace to cancel it. + + ## Orders that cannot be canceled + + The following situations do not allow order cancellation: + + - **Partial invoices:** [Partially invoiced](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) orders cannot be canceled. However, the customer can [change the order](https://developers.vtex.com/docs/guides/change-order) to replace or remove items from it. + + - **Invoiced status:** Orders with `invoiced` [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) cannot be canceled. If the order has already been invoiced, you can use the [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/invoice) endpoint to generate a return invoice. + + - **Incomplete orders:** [Incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294) cannot be canceled. + + ## Declining order cancelation + + The order flow has a cancellation window (grace period) in which the customer can automatically cancel the order. Except for that period, the seller can [decline an order cancellation request](https://help.vtex.com/en/tutorial/declining-order-cancelation--F2n0h1TeQ5td540Gjyff4), regardless of whether the customer or the marketplace initiated it. + + For more information, see [Order canceling improvements](https://developers.vtex.com/docs/guides/order-canceling-improvements). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Cancel order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Cancel order | + | IntegrationProfile - Fulfillment Oms | Cancel order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) ID that identifies the order in the seller. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "date": "2024-02-07T15:22:56.7612218-02:00", + "orderId": "123543123", + "receipt": "38e0e47da2934847b489216d208cfd91" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Orders/Get order.yml b/BrunoCollections/VTEX - Orders API/Orders/Get order.yml new file mode 100644 index 0000000000..bedf2dda31 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Get order.yml @@ -0,0 +1,98 @@ +info: + name: Get order + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 or seq501456 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/pvt/orders/:orderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/pvt/orders/:orderId - Schema is valid", function () { + const schema = {"type":"object","properties":{"orderId":{"type":"string","description":"Order ID."},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v70530116str-01`, the sequence is `70530116`."},"marketplaceOrderId":{"type":"string","description":"Marketplace order ID."},"marketplaceServicesEndpoint":{"type":"string","description":"Endpoint provided by the marketplace for post purchase communication."},"sellerOrderId":{"type":"string","description":"Seller order ID."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types).","enum":["Marketplace","Fulfillment","Chain"]},"affiliateId":{"type":"string","description":"Three-letter [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) code configured by the seller to identify a marketplace."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order."},"merchantName":{"type":["string","null"],"description":"For a VTEX store, the merchant's name will be the same as the account name. An external seller can have a `merchantName`, but it will not be an account name."},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"workflowIsInError":{"type":"boolean","description":"Indicates if the order processing in the workflow presents an error that cannot be solved by automatic retry (`true`), or if there are no processing errors (`false`)."},"statusDescription":{"type":"string","description":"Status description displayed on the VTEX Admin. This field is obsolete and may not return any value."},"value":{"type":"integer","description":"Order total value in cents."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderGroup":{"type":"string","description":"Order group ID, a segment of the order ID that groups all orders related to the same purchase. For example, in the order ID `v71021570str-02`), the order group ID is `v71021570str`."},"followUpEmail":{"type":"string","description":"Email of the store employee responsible for managing the order."},"lastMessage":{"type":["string","null"],"description":"Last transactional message sent to the customer."},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"isCompleted":{"type":"boolean","description":"Defines if the order payment has been settled (`true`) or not (`false`)."},"roundingError":{"type":"integer","description":"Rounding error total value in cents, when applicable. For example, in orders with discounts on non-integer multiplier items, rounding is applied per item, not after the sum of all items, which can result in a difference in the total discount value."},"orderFormId":{"type":"string","description":"Unique identifier of the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields)."},"allowCancellation":{"type":"boolean","description":"Defines if order cancellation is allowed (`true`) or not anymore (`false`)."},"allowEdition":{"type":"boolean","description":"Defines if the order can be edited (`true`) or not anymore (`false`)."},"isCheckedIn":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"authorizedDate":{"type":["string","null"],"description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"invoicedDate":{"type":["string","null"],"description":"Order invoice date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cancelReason":{"type":["string","null"],"description":"Reason for order cancellation."},"checkedInPickupPointId":{"type":["string","null"],"description":"When the order is created at a physical store which is configured as a pickup point, this field retrieves the pickup point ID."},"totals":{"type":"array","description":"Information about the order totals.","items":{"type":"object","description":"Details about the order totals.","properties":{"id":{"type":"string","description":"Total ID, which defines what the total is about.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value in cents."},"alternativeTotals":{"type":["array","null"],"description":"Information about the order alternative totals, when applicable. For example, when there is a discount for items in the marketplace that results in a difference in the `Items` total value, the `alternativeTotals` can retrieve details about it.","items":{"type":"object","description":"Details about the order alternative totals.","properties":{"id":{"type":"string","description":"Alternative total ID, which can be related to items, discounts, shipping or taxes."},"name":{"type":"string","description":"Alternative total name."},"value":{"type":"integer","description":"Alternative total value in cents."}}}}}}},"sellers":{"type":"array","description":"Information about the sellers associated with the order.","items":{"type":"object","description":"Information about a given seller.","properties":{"id":{"type":"string","description":"Seller identifier."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo URL."},"fulfillmentEndpoint":{"type":"string","description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace use to communicate with the seller."}}}},"clientPreferencesData":{"type":"object","description":"Information about the customer preferences.","properties":{"locale":{"type":"string","description":"Language code of the customer preferred language while accessing the store."},"optinNewsLetter":{"type":"boolean","description":"Defines if the customer receives the store's newsletter (`true`) or not (`false`)."}}},"cancellationData":{"type":["object","null"],"description":"Information about [order cancellation](https://developers.vtex.com/docs/guides/order-canceling-improvements), when applicable.","properties":{"RequestedByUser":{"type":["boolean","null"],"description":"Indicates if the order cancellation was requested by the customer (`true`) or not (`false`)."},"RequestedBySystem":{"type":["boolean","null"],"description":"Indicates if the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example."},"RequestedBySellerNotification":{"type":["boolean","null"],"description":"Indicates if the order cancellation was requested by the seller (`true`) or not (`false`)."},"RequestedByPaymentNotification":{"type":["boolean","null"],"description":"Indicates if the order cancellation was requested by the payment gateway (`true`) or not (`false`)."},"Reason":{"type":["string","null"],"description":"Reason why the order was canceled."},"CancellationDate":{"type":["string","null"],"description":"Order cancellation date in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"taxData":{"type":["object","null"],"description":"Order taxes information.","required":["areTaxesDesignatedByMarketplace","taxInfoCollection"],"properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were applied by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Order taxes details.","items":{"type":"object","description":"Information about a given tax.","required":["itemIndex","sku","priceTags"],"properties":{"itemIndex":{"type":"integer","description":"Item indexing number."},"sku":{"type":"string","description":"SKU ID."},"priceTags":{"type":["array","null"],"description":"Price tags information.","items":{"type":"object","description":"Information about a given price tag.","properties":{"identifier":{"type":"string","description":"Price tag identifier code."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"name":{"type":"string","description":"Price tag name."},"value":{"type":"integer","description":"Price tag value in cents."},"rawValue":{"type":"number","description":"Price tag raw value that can contain up to five decimals, separated by a period."}}}}}}}}},"subscriptionData":{"type":["object","null"],"description":"Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453), when applicable.","properties":{"SubscriptionGroupId":{"type":["string","null"],"description":"ID of the subscription group. If this field returns `null` and the `ExecutionCount` is `0`, the order is the first creating the subscription."},"Subscriptions":{"type":["array","null"],"description":"List with subscriptions details.","items":{"type":"object","description":"Subscription details.","properties":{"ExecutionCount":{"type":"integer","description":"Position of the order in the subscription cycle. The first order will have the value `0`, the second will have the value `1`, and so on."},"PriceAtSubscriptionDate":{"type":["number","null"],"description":"Value of the order when the customer signed up for subscriptions. Subscriptions created via Admin or APIs do not have an original order, so the field returns `0.0`. This field was valid only for Subscriptions v2 and is deprecated in Subscriptions v3."},"ItemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"Plan":{"type":"object","description":"Information about the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR).","properties":{"type":{"type":"string","description":"Type of plan."},"frequency":{"type":"object","description":"Information about the subscription recurrence.","properties":{"periodicity":{"type":"string","description":"Defines the subscription recurrence period.","enum":["DAY","WEEK","MONTH","YEAR"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the `periodicity` field. For a `DAY` periodicity, this value will correspond to days, for `MONTH` to months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription will be valid.","properties":{"begin":{"type":"string","description":"Subscription beginning date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription end date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}}}}}},"itemMetadata":{"type":"object","description":"Metadata information about the order's items.","properties":{"Items":{"type":"array","description":"List of order items' metadata.","items":{"type":"object","description":"Order item metadata.","properties":{"Id":{"type":"string","description":"Unique numerical identifier of the SKU."},"Seller":{"type":"string","description":"Unique identifier of the SKU seller."},"Name":{"type":"string","description":"Name of the item as displayed to customers in the storefront."},"SkuName":{"type":"string","description":"Name of the SKU corresponding to the item."},"ProductId":{"type":"string","description":"ID of the product associated with the item."},"RefId":{"type":"string","description":"SKU reference ID."},"Ean":{"type":"string","description":"SKU EAN."},"ImageUrl":{"type":"string","description":"SKU image URL."},"DetailUrl":{"type":"string","description":"SKU slug."},"AssemblyOptions":{"type":["array","null"],"description":"[Assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) information related to the item, if there are any.","items":{"type":"object","description":"[Assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) details.","properties":{"Id":{"type":"string","description":"Assembly option ID."},"Name":{"type":"string","description":"Assembly option name."},"Required":{"type":"boolean","description":"If this field is set as `true`, when the customer purchases the item sending the attachment is required, and when set as `false`, sending the attachment is optional."},"InputValues":{"type":["object","null"],"description":"Assembly option content.","additionalProperties":true},"Composition":{"type":["object","null"],"description":"Assembly option composition.","additionalProperties":true}}}}}}}}},"marketplace":{"type":["object","null"],"description":"Information about the marketplace related to the order.","properties":{"baseURL":{"type":"string","description":"Marketplace base URL."},"isCertified":{"type":["boolean","null"],"description":"Defines if the marketplace is a [VTEX certified marketplace](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-certified-marketplaces) (`true`) or not (`false`)."},"name":{"type":"string","description":"Marketplace name."}}},"storePreferencesData":{"type":"object","description":"Store preferences in the [Account settings](https://help.vtex.com/en/tutorial/account-details-page--2vhUVOKfCaswqLguT2F9xq) page.","properties":{"countryCode":{"type":"string","description":"Country code in three-digit [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":"object","description":"Currency format settings.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Number of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Character for currency decimal separation."},"CurrencyGroupSeparator":{"type":"string","description":"Character for currency group separation."},"CurrencyGroupSize":{"type":"integer","description":"Limit of characters that can be grouped for currency groups."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if the prices displayed for customers start with the currency symbol (`true`) or not (`false`)."}}},"currencyLocale":{"type":"integer","description":"Currency locale code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":"string","description":"Currency symbol characters."},"timeZone":{"type":"string","description":"Time zone considered for the store orders."}}},"customData":{"type":["object","null"],"description":"[Customizable fields](https://developers.vtex.com/docs/guides/add-and-handle-custom-information-in-the-order) created by the store for the shopping cart. This field is useful for storing data not included in other fields. For example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["object","null"],"description":"Customizable apps details.","properties":{"id":{"type":"string","description":"Integration marketplace identifier."},"major":{"type":"integer","description":"Major version of the app."},"fields":{"type":"object","description":"Fields related to the marketplace payment.","properties":{"marketplacePaymentCnpjAcquirers":{"type":"string","description":"CNPJ of the marketplace payment acquirers."},"marketplacePaymentAuthorizationCodes":{"type":"string","description":"Authorization codes for marketplace payment."},"marketplacePaymentCreditCardBrands":{"type":"string","description":"Credit card brands for marketplace payment."},"marketplacePaymentMethods":{"type":"string","description":"Payment methods for marketplace payment."}}}}}},"customFields":{"type":"array","description":"Array with information about the custom fields.","items":{"type":"object","description":"Object with information about the custom fields.","properties":{"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"type":{"type":"string","description":"Type of the linked entity such as `cart`, `item`, `address`."},"id":{"type":"string","description":"ID of the linked entity."}}},"fields":{"type":"array","description":"Array with information about the custom field's name and value.","items":{"type":"object","description":"Custom field's name and value.","properties":{"name":{"type":"string","description":"Name of the custom field."},"value":{"type":"string","description":"Value of the custom field."}}}}}}}}},"commercialConditionData":{"type":["string","null"],"description":"Information about commercial conditions."},"openTextField":{"type":["object","null"],"description":"Optional field for additional information.","additionalProperties":{"type":"string","description":"Additional information."}},"invoiceData":{"type":["object","null"],"description":"Order invoices information.","properties":{"address":{"type":["object","null"],"description":"Invoice address information.","properties":{"addressType":{"type":["string","null"],"description":"Invoice address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":["string","null"],"description":"Full name of the order receiver."},"addressId":{"type":["string","null"],"description":"Invoice address ID."},"versionId":{"type":["string","null"],"description":"Invoice address version ID."},"entityId":{"type":["string","null"],"description":"Invoice address entity ID."},"postalCode":{"type":"string","description":"Invoice address postal code."},"city":{"type":"string","description":"Invoice address city."},"state":{"type":"string","description":"Invoice address state."},"country":{"type":"string","description":"Invoice address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Invoice address street."},"number":{"type":"string","description":"Invoice address number."},"neighborhood":{"type":"string","description":"Invoice address neighborhood."},"complement":{"type":["string","null"],"description":"Invoice address complement."},"reference":{"type":["string","null"],"description":"Invoice address additional information."},"geoCoordinates":{"type":"array","description":"Invoice address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"userPaymentInfo":{"type":["object","null"],"description":"Invoice information regarding payment method.","properties":{"paymentMethods":{"type":"array","description":"List of the payment methods used by the customer in the purchase.","items":{"type":"string","description":"Payment method name."}}}},"invoiceSubject":{"type":["object","null"],"description":"Information about the invoice subject.","properties":{"id":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject email address."},"firstName":{"type":"string","description":"Invoice subject first name."},"lastName":{"type":"string","description":"Invoice subject last name."},"phone":{"type":"string","description":"Invoice subject phone number."}}}}},"changesAttachment":{"type":["object","null"],"description":"Information about changes in the order.","required":["id","changesData"],"properties":{"id":{"type":"string","description":"Order changes ID."},"changesData":{"type":"array","description":"Information about changes in the order.","items":{"required":["reason","discountValue","incrementValue","itemsAdded","itemsRemoved","receipt"],"type":"object","description":"Details about an order change.","properties":{"reason":{"type":"string","description":"Text explaining why the order was changed. This information may be shown to the customer in the storefront or transactional emails."},"discountValue":{"type":["integer","null"],"description":"Order change discount value in cents."},"incrementValue":{"type":["integer","null"],"description":"Order change increment value in cents."},"itemsAdded":{"type":["array","null"],"description":"Information about items added to the order, when applicable.","items":{"type":"object","description":"Information about an item added to the order.","properties":{"id":{"type":"string","description":"Added item SKU ID."},"name":{"type":"string","description":"Added item SKU name."},"quantity":{"type":"integer","description":"Quantity of items added."},"price":{"type":"integer","description":"Added item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Added item unit multiplier."}}}},"itemsRemoved":{"type":["array","null"],"description":"Information about items removed from the order, when applicable.","items":{"type":"object","description":"Information about an item removed from the order.","required":["id","name","quantity","price","unitMultiplier"],"properties":{"id":{"type":"string","description":"Removed item SKU ID."},"name":{"type":"string","description":"Removed item name."},"quantity":{"type":"integer","format":"int32","description":"Quantity of removed items."},"price":{"type":"integer","format":"int32","description":"Removed item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Removed item unit multiplier."}}}},"receipt":{"required":["date","orderId","receipt"],"type":"object","description":"Order changes receipt information.","properties":{"date":{"type":"string","description":"Receipt creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID."},"receipt":{"type":"string","description":"Receipt unique identifier code."}}}}}}}},"callCenterOperatorData":{"type":["object","null"],"description":"Information about the call center operator responsible for the order.","properties":{"id":{"type":"string","description":"Call center operator identification code."},"email":{"type":"string","description":"Call center operator email."},"userName":{"type":"string","description":"Call center operator user name."}}},"packageAttachment":{"type":["object","null"],"description":"Information about shipping packages, created after order invoicing.","properties":{"packages":{"type":"array","description":"List with packages' information.","items":{"type":"object","description":"Package details.","properties":{"items":{"type":"array","description":"Information about package items.","items":{"type":"object","description":"Package item details.","properties":{"itemIndex":{"type":"integer","description":"Package item index nunmber."},"quantity":{"type":"integer","description":"Package item quantity."},"price":{"type":"integer","description":"Package item price in cents."},"description":{"type":["string","null"],"description":"Package item description."},"unitMultiplier":{"type":["number","null"],"description":"Package item unit multiplier."}}}},"courier":{"type":["string","null"],"description":"Name of the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) responsible for the package shipping."},"invoiceNumber":{"type":"string","description":"Unique identification code of the package invoice."},"invoiceValue":{"type":"integer","description":"Package invoice value in cents."},"invoiceUrl":{"type":["string","null"],"description":"Package invoice URL."},"issuanceDate":{"type":"string","description":"Package invoice issuance date in [ISO 8601 time zone offset format](https://learn.microsoft.com/pt-br/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."},"trackingNumber":{"type":["string","null"],"description":"Package [tracking number](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-)."},"invoiceKey":{"type":["string","null"],"description":"Package invoice key."},"trackingUrl":{"type":["string","null"],"description":"Package tracking URL."},"embeddedInvoice":{"type":"string","description":"Package invoice text in [xml format](https://help.vtex.com/en/tutorial/configuring-xml--tutorials_242). This field is important for stores integrated with [external marketplaces](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide)."},"type":{"type":"string","description":"Package invoice type, which can be:\r\n- `Output`: Selling order invoice.\r\n- `Input`: Returning items invoice.","enum":["Output","Input"]},"courierStatus":{"type":["object","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) package shipping information.","properties":{"status":{"type":["string","null"],"description":"Defines if a carrier was assigned for order shipping (`ok`) or not (`null`)."},"finished":{"type":"boolean","description":"Defines if the carrier has already delivered the package (`true`) or not (`false`)."},"deliveredDate":{"type":"string","description":"Package delivery date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."},"data":{"type":"array","description":"Package tracking information.","items":{"type":"object","description":"Package tracking details.","properties":{"lastChange":{"type":"string","description":"Package tracking date since last update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."},"city":{"type":"string","description":"Package current tracking city."},"state":{"type":"string","description":"Package current tracking state in two-digit code format."},"description":{"type":"string","description":"Package tracking description."},"createDate":{"type":"string","description":"Package tracking creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]+hh:mm`."}}}}}},"cfop":{"type":["string","null"],"description":"[CFOP](https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/facilitacao/anexo-ecf-cfop) (_Código Fiscal de Operação e Prestação_) is a Brazilian fiscal code of operations and services that classifies business transactions types."},"restitutions":{"type":"object","description":"Information about a value being returned to the customer. This field applies only to invoices with the `Input` type because it relates to returning items.","properties":{"Refund":{"type":"object","description":"Customer refund details.","properties":{"value":{"type":"integer","description":"Refund value in cents."},"giftCardData":{"type":["string","null"],"description":"Refund involving [Gift Card](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."},"items":{"type":["array","null"],"description":"Information about the items being returned.","items":{"type":"object","description":"Returned item details.","properties":{"useFreight":{"type":["boolean","null"],"description":"Defines if the refund includes freight values (`true`) or not (`false`)."},"isCompensation":{"type":"boolean","description":"Defines if there are compensated unit tags in the package (`true`) or not (`false`)."},"compensationValue":{"type":"integer","description":"Compensational refund value in cents."},"id":{"type":"string","description":"SKU unique identification code of the returned item."},"quantity":{"type":"integer","description":"Number of items being returned."},"price":{"type":"integer","description":"Returned item price in cents."},"description":{"type":"string","description":"Customer reason for returning the item."}}}}}}}},"volumes":{"type":"integer","description":"Indicates the number of boxes (volumes) needed to contain the package items. For example, two refrigerators do not fit in a single volume, so this field would have value `2`."},"EnableInferItems":{"type":["boolean","null"],"description":"Defines if the package items' value should be inferred by the invoice value (`true`) or not (`false`)."}}}}}},"paymentData":{"type":"object","description":"Payments information.","properties":{"giftCards":{"type":["array","null"],"description":"[Gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"object","description":"Gift card details.","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionCode":{"type":"string","description":"Gift card code used by the customer at checkout."},"name":{"type":["string","null"],"description":"Gift card name."},"caption":{"type":["string","null"],"description":"Gift card loyalty program, when applicable."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be `0.0`."},"provider":{"type":"string","description":"Gift card provider name."},"groupName":{"type":["string","null"],"description":"Gift card group name."},"inUse":{"type":"boolean","description":"Defines if the gift card is in use (`true`) or not (`false`)."},"isSpecialCard":{"type":"boolean","description":"Defines if the gift card is a special card (`true`) or not (`false`)."}}}},"transactions":{"type":"array","description":"Information about the order financial transactions.","items":{"type":"object","description":"Information about a given transaction.","properties":{"isActive":{"type":"boolean","description":"Defines of the transaction is active (`true`) or inactive (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Payments information.","items":{"type":"object","description":"Payment details.","properties":{"id":{"type":"string","description":"Payment unique identifier."},"paymentSystem":{"type":"string","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","description":"Order total payment value in cents."},"installments":{"type":"integer","description":"Number of payment installments."},"referenceValue":{"type":"integer","description":"Total payment reference value in cents."},"cardHolder":{"type":["string","null"],"description":"Name of the card owner."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first four digits."},"lastDigits":{"type":["string","null"],"description":"Card last four digits."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"expireMonth":{"type":["string","null"],"description":"Card expiration month in 2-digit format."},"expireYear":{"type":["string","null"],"description":"Card expiration year in 4-digit format."},"url":{"type":["string","null"],"description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Gift card code used by the customer at checkout."},"group":{"type":"string","description":"Transaction payment method, which can be credit card, debid card, bank invoice, promissory, gift card or pix (`instantPayment`).","enum":["creditCard","debitCard","bankInvoice","promissory","giftCard","instantPayment"]},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"dueDate":{"type":["string","null"],"description":"Payment due date in `MM/YY` format."},"connectorResponses":{"type":"object","description":"Payment provider (connector) responses. The fields within this object can vary according to the order payment provider.","properties":{"Message":{"type":["string","null"],"description":"Provider operational message or error to be logged."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"authorizationId":{"type":"string","description":"Provider authorization ID."},"status":{"type":"string","description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."},"delayToAutoSettle":{"type":"integer","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`, regardless if the payment was approved by the merchant's anti-fraud provider. The maximum value allowed is `604800` seconds (7 days)."},"ReturnCode":{"type":["string","null"],"description":"Provider operational return code or error to be logged."},"nsu":{"type":"string","description":"Provider unique sequential number for the transaction."},"code":{"type":"string","description":"Provider operational code or error to be logged."},"message":{"type":"string","description":"Provider operational message or error to be logged."},"Tid":{"type":"string","description":"Provider unique identifier for the transaction."},"acquirer":{"type":"string","description":"[Acquirer](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/kdPbEIWf8Xq8tESQvViMB#acquirer) name (mostly used for card payments)."},"authId":{"type":"string","description":"Authorization identification."},"paymentId":{"type":"string","description":"Payment ID."},"delayToAutoSettleAfterAntifraud":{"type":"string","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`. This happens only after the payment was approved by the merchant's anti-fraud provider."}}},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider ID."},"giftCardAsDiscount":{"type":["boolean","null"],"description":"Defines if the payment has a gift card discount (`true`) or not (`false`)."},"koinUrl":{"type":["string","null"],"description":"Koin connector URL."},"accountId":{"type":["string","null"],"description":"Identification code of the account where the payment was made."},"parentAccountId":{"type":["string","null"],"description":"When the payment was made in a subaccount, this field retrieves the main account ID."},"bankIssuedInvoiceIdentificationNumber":{"type":["string","null"],"description":"Bank issued invoice numeric sequence."},"bankIssuedInvoiceIdentificationNumberFormatted":{"type":["string","null"],"description":"Bank issued invoice numeric sequence formatted as customers see."},"bankIssuedInvoiceBarCodeNumber":{"type":["string","null"],"description":"Bank issued invoice bar code number."},"bankIssuedInvoiceBarCodeType":{"type":["string","null"],"description":"Bank issued invoice bar code type."},"billingAddress":{"type":["object","null"],"description":"Billing address information.","properties":{"postalCode":{"type":"string","description":"Billing address postal code."},"city":{"type":"string","description":"Billing address city."},"state":{"type":"string","description":"Billing address state."},"country":{"type":"string","description":"Billing address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Billing address street."},"number":{"type":"string","description":"Billing address number."},"neighborhood":{"type":"string","description":"Billing address neighborhood."},"complement":{"type":["string","null"],"description":"Billing address complement."},"reference":{"type":["string","null"],"description":"Billing address additional information."},"geoCoordinates":{"type":"array","description":"Billing address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}},"paymentOrigin":{"type":["string","null"],"description":"Type of [wallet](https://help.vtex.com/en/tutorial/what-is-an-e-wallet--4v5wcOe4A0SiaimWM2cU60) used in the payment."}}}}}}}}},"shippingData":{"type":"object","description":"Shipping information.","properties":{"id":{"type":"string","description":"Object ID, the expected value is `shippingData`."},"address":{"type":"object","description":"Shipping address details.","properties":{"addressType":{"type":"string","description":"Type of address. For example, `residential` or `pickup`."},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"postalCode":{"type":"string","description":"Shipping address postal code."},"city":{"type":"string","description":"Shipping address city."},"state":{"type":"string","description":"Shipping address state/province."},"country":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Shipping address street."},"number":{"type":"string","description":"Shipping address number."},"neighborhood":{"type":"string","description":"Shipping address neighborhood."},"complement":{"type":"string","description":"Shipping address complement."},"reference":{"type":["string","null"],"description":"Shipping address additional information."},"geoCoordinates":{"type":"array","description":"Pair of geocoordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude and latitude."}}}},"logisticsInfo":{"type":"array","description":"Array of objects containing item's logistics information.","items":{"type":"object","description":"Logistics information.","properties":{"itemIndex":{"type":"integer","description":"Index of the item starting from 0."},"selectedSla":{"type":"string","description":"Selected shipping option."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time."},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"Original shipping price for the item in cents."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, if it applies to the item."},"deliveryCompany":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"shippingEstimate":{"type":"string","description":"Total shipping estimate time in days. For instance, three business days is represented `3bd`."},"shippingEstimateDate":{"type":"string","description":"Shipping estimate date, defined after the confirmation of the order."},"slas":{"type":"array","description":"Service Level Agreement (SLA) corresponding to [shipping policies](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).","items":{"type":"object","description":"Order shipping SLA details.","properties":{"id":{"type":"string","description":"ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"name":{"type":"string","description":"Name of the shipping policy."},"shippingEstimate":{"type":"string","description":"Total shipping estimate time in days. For instance, three business days is represented `3bd`."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, if it applies to the item."},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"selectedDeliveryChannel":{"type":"string","description":"Defines if the delivery channel is `delivery` or `pickup-in-point`."},"pickupStoreInfo":{"type":"object","description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","properties":{"additionalInfo":{"type":["string","null"],"description":"Additional information about the pickup point."},"address":{"type":["object","null"],"description":"Pickup point address details.","properties":{"addressType":{"type":["string","null"],"description":"Type of address. For example, `residential` or `pickup`."},"receiverName":{"type":["string","null"],"description":"Full name of the order receiver."},"addressId":{"type":["string","null"],"description":"Pickup point address ID."},"versionId":{"type":["string","null"],"description":"Pickup point address version ID."},"entityId":{"type":["string","null"],"description":"Pickup point address entity ID."},"postalCode":{"type":["string","null"],"description":" Pickup point postal code."},"city":{"type":["string","null"],"description":"Pickup point address city."},"state":{"type":["string","null"],"description":"Pickup point address state/province."},"country":{"type":["string","null"],"description":"Pickup point address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":["string","null"],"description":"Pickup point address street."},"number":{"type":["string","null"],"description":"Pickup point address number."},"neighborhood":{"type":["string","null"],"description":"Pickup point address neighborhood."},"complement":{"type":["string","null"],"description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address additional information."},"geoCoordinates":{"type":["array","null"],"description":"Pair of geocoordinates, first longitude then latitude.","items":{"type":["number","null"],"description":"Longitude and latitude."}}}},"dockId":{"type":["string","null"],"description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID related to the delivery or the pickup point."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"isPickupStore":{"type":"boolean","description":"Defines if the type of shipping is pickup (`true`) or not (`false`)."}}},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA."},"pickupPointId":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"transitTime":{"type":"string","description":"Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`."},"pickupDistance":{"type":"number","description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}}},"shipsTo":{"type":"array","items":{"type":"string","description":"Three-digit country code of the shipping address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"description":"List of countries of the shipping address."},"deliveryIds":{"type":"array","description":"Information about delivery IDs.","items":{"type":"object","description":"Delivery IDs.","properties":{"courierId":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE)'s ID."},"courierName":{"type":"string","description":"Carrier's name."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"quantity":{"type":"integer","description":"Quantity of items."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), if there are any.","items":{"type":"string","description":"Kits information."}}}}},"deliveryChannels":{"type":"array","description":"List of delivery channels associated with the trade policy.","items":{"type":"object","properties":{"id":{"type":"string","description":"Delivery channel's shipping type, which can be `delivery` or `pickup-in-point`."},"stockBalance":{"type":"integer","description":"Stock check for an SKU availability."}},"description":"Delivery channels information."}},"selectedDeliveryChannel":{"type":"string","description":"Defines if the delivery channel is `delivery` or `pickup-in-point`."},"pickupStoreInfo":{"type":["object","null"],"description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","properties":{"additionalInfo":{"type":["string","null"],"description":"Additional information about the pickup point."},"address":{"type":["string","null"],"description":"Pickup point's address."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"isPickupStore":{"type":"boolean","description":"Defines if the type of shipping is pickup (`true`) or not (`false`)."}}},"addressId":{"type":["string","null"],"description":"Address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)'s ID."},"transitTime":{"type":["string","null"],"description":"Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`."}}}},"trackingHints":{"type":["array","null"],"description":"List containing order shipping label information.","items":{"type":"object","description":"Shipping label information.","properties":{"trackingId":{"type":"string","description":"Tracking ID."},"courierName":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) name."},"trackingUrl":{"type":"string","description":"Tracking URL."},"trackingLabel":{"type":"string","description":"Tracking label."}}}},"selectedAddresses":{"type":"array","description":"Information about selected adresses.","items":{"type":"object","description":"Selected adresses.","properties":{"addressId":{"type":"string","description":"Selected address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID of the selected address."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID of the selected address."},"addressType":{"type":"string","description":"Selected adress's shipping type, which can be `pickup`, `residential`, `invoice`, `search`, `inStore`, `commercial` or `giftRegistry`."},"receiverName":{"type":"string","description":"Full name of the person who is going to receive the order in the selected address."},"street":{"type":"string","description":"Street of the selected address."},"number":{"type":"string","description":"Number of the building, house or apartment of the selected address."},"complement":{"type":"string","description":"Complement to the selected address if it applies."},"neighborhood":{"type":"string","description":"Neighborhood of the selected address."},"postalCode":{"type":"string","description":"Postal code of the selected address."},"city":{"type":"string","description":"City of the selected address."},"state":{"type":"string","description":"State of the selected address."},"country":{"type":"string","description":"Three-digit country code of the selected address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"reference":{"type":["string","null"],"description":"Complement to help locate the selected address."},"geoCoordinates":{"type":"array","items":{"type":"number","description":"Longitude and latitude geocoordinates."},"description":"List with the selected address's geocoordinates, first longitude then latitude."}}}},"contactInformation":{"type":"array","description":"Array with customer contact information.","items":{"type":"object","description":"Contact information.","properties":{"id":{"type":"string","description":"Customer contact ID."},"email":{"type":"string","description":"Customer contact email."},"firstName":{"type":"string","description":"Customer contact first name."},"lastName":{"type":"string","description":"Customer contact last name."},"phone":{"type":"string","description":"Customer contact phone number."},"document":{"type":"string","description":"Customer contact document ID."},"documentType":{"type":"string","description":"Customer contact document type."},"entityId":{"type":"string","description":"Entity identification code."},"versionId":{"type":"string","description":"Version identification code."}}}}}},"ratesAndBenefitsData":{"type":"object","description":"Information on promotions and taxes that apply to the order.","properties":{"id":{"type":"string","description":"ID of the rate or benefit."},"rateAndBenefitsIdentifiers":{"type":"array","description":"Information about order's promotions and taxes identifiers.","items":{"type":"object","description":"Promotions or tax information.","properties":{"description":{"type":["string","null"],"description":"Promotion or tax description."},"featured":{"type":"boolean","description":"Defines if the promotion or tax is cumulative (`true`) or not (`false`)."},"id":{"type":"string","description":"Promotion or tax ID."},"name":{"type":"string","description":"Promotion or tax name."},"matchedParameters":{"type":"object","description":"Informs the criteria and conditions fulfilled so the promotion became valid.","additionalProperties":true},"additionalInfo":{"type":["object","null"],"description":"Object containing promotion or tax additional information. For example { Free shipping: 100,00 }."}}}}}},"marketingData":{"type":["object","null"],"description":"Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs.","properties":{"id":{"type":"string","description":"Object ID. The expected value is `marketingData`."},"utmSource":{"type":"string","description":"Value of the `utm_source` parameter of the URL that led to the request."},"utmPartner":{"type":"string","description":"UTM Source Parameters."},"utmMedium":{"type":"string","description":"Value of the `utm_medium` parameter of the URL that led to the request."},"utmCampaign":{"type":"string","description":"Value of the `utm_campaign` parameter of the URL that led to the request."},"coupon":{"type":"string","description":"Coupon code."},"utmiCampaign":{"type":"string","description":"Internal UTM value `utmi_cp`."},"utmipage":{"type":"string","description":"Internal UTM value `utmi_p`."},"utmiPart":{"type":"string","description":"Internal UTM value `utmi_pc`."},"marketingTags":{"type":"array","description":"Marketing tags information. This field can be used to register campaign data or informative tags regarding promotions.","items":{"type":"string","description":"Marketing tag."}}}},"giftRegistryData":{"type":["object","null"],"description":"Information about [gift list](https://developers.vtex.com/docs/guides/creating-gift-lists).","properties":{"giftRegistryId":{"type":"string","description":"Gift list ID."},"giftRegistryType":{"type":"string","description":"[Gift list type](https://help.vtex.com/en/tutorial/creating-a-type-of-list)."},"giftRegistryTypeName":{"type":"string","description":"Gift list type name."},"addressId":{"type":"string","description":"Gift list shipping address ID."},"description":{"type":"string","description":"Gift list description."}}},"clientProfileData":{"type":"object","description":"Object with information on the client's profile.","properties":{"id":{"type":"string","description":"Object ID, the expected value is `clientProfileData`."},"email":{"type":"string","description":"Customer email."},"firstName":{"type":"string","description":"Customer first name."},"lastName":{"type":"string","description":"Customer last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document identification code informed by the customer."},"phone":{"type":"string","description":"Customer phone number."},"corporateName":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the corporate name."},"tradeName":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the trade name."},"corporateDocument":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the corporate document."},"stateInscription":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the state inscription."},"corporatePhone":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the company's phone number."},"isCorporate":{"type":"boolean","description":"Defines if the customer is a legal entity (`true`) or not (`false`)."},"userProfileId":{"type":"string","description":"Customer user profile ID."},"userProfileVersion":{"type":["string","null"],"description":"Customer user profile version."},"customerClass":{"type":["string","null"],"description":"Customer class identification."},"customerCode":{"type":["string","null"],"description":"Customer code."}}},"items":{"type":"array","description":"Information about order's items.","items":{"type":"object","properties":{"uniqueId":{"type":"string","description":"Alphanumeric sequence that identifies an SKU in a given order."},"id":{"type":"string","description":"Unique SKU identifier."},"productId":{"type":"string","description":"ID of the product associated with the item."},"ean":{"type":["string","null"],"description":"EAN of the SKU."},"lockId":{"type":"string","description":"Reservation ID."},"itemAttachment":{"type":"object","description":"Item attachment information.","properties":{"content":{"type":"object","description":"Item attachment custom field for content."},"name":{"type":["string","null"],"description":"Item attachment name."}}},"attachments":{"type":"array","items":{"type":"string","description":"Attachments information."},"description":"Array containing information on attachments."},"quantity":{"type":"integer","description":"Quantity of items."},"seller":{"type":"string","description":"Seller related to the order."},"name":{"type":"string","description":"Item's name."},"refId":{"type":"string","description":"Product referencial code associated with the item."},"price":{"type":"integer","description":"Item's price."},"listPrice":{"type":"integer","description":"Item's [list price](https://help.vtex.com/en/tracks/prices-101--6f8pwCns3PJHqMvQSugNfP/3XcXp0r5WrJvogB8KIX4Kx#list-price)."},"manualPrice":{"type":["string","null"],"description":"Item's [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"priceTags":{"type":"array","items":{"type":"string","description":"Price modifiers."},"description":"List of objects with item's price modifiers."},"imageUrl":{"type":"string","description":"SKU image URL."},"detailUrl":{"type":"string","description":"SKU slug."},"components":{"type":"array","items":{"type":"string","description":"Components."},"description":"Item's components."},"bundleItems":{"type":"array","items":{"type":"object","description":"Item's offering details.","properties":{"id":{"type":"integer","description":"Offering ID."},"quantity":{"type":"integer","description":"Offering quantity."}}},"description":"This field groups offerings (services) related to the item and displays their ID and quantity. A gift package is an example of an offering."},"params":{"type":"array","items":{"type":"string","description":"Information about params."},"description":"Array with information about params."},"offerings":{"type":"array","items":{"type":"string","description":"Service name related to the item."},"description":"Item's offerings, which are services related to the item. For example, guarantee or installation."},"attachmentOfferings":{"type":["array","null"],"description":"Array containing attachments details.","items":{"type":"object","description":"Attachment details.","properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Schema of the content declared in the field `attachmentOfferings`."}}}},"sellerSku":{"type":"string","description":"SKU ID from the seller perspective."},"priceValidUntil":{"type":["string","null"],"description":"Date until when the price is going to be valid if there is a promotion."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"tax":{"type":"integer","description":"Item's tax."},"preSaleDate":{"type":["string","null"],"description":"Item's pre sale date."},"additionalInfo":{"type":"object","description":"Additional information about the item.","properties":{"brandName":{"type":"string","description":"Item's brand name."},"brandId":{"type":"string","description":"Item's brand ID."},"categoriesIds":{"type":"string","description":"Item's category ID."},"categories":{"type":"array","description":"Items categories information.","items":{"type":"object","description":"Category information.","properties":{"id":{"type":"number","description":"Category ID."},"name":{"type":"string","description":"Category name."}}}},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial conditions ID."},"dimension":{"type":"object","description":"Item's dimensions.","properties":{"cubicweight":{"type":"number","description":"Item's cubic weight."},"height":{"type":"integer","description":"Item's height."},"length":{"type":"integer","description":"Item's length."},"weight":{"type":"integer","description":"Item's weight."},"width":{"type":"integer","description":"Item's width."}}},"offeringInfo":{"type":["string","null"],"description":"Information about services related to the item. For example: guarantee or installation."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"measurementUnit":{"type":"string","description":"Item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Item's unit multiplier."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"isGift":{"type":"boolean","description":"This field is `true` when the item is a gift in order context and `false` when it is not."},"shippingPrice":{"type":["string","null"],"description":"Item's shipping price."},"rewardValue":{"type":"integer","description":"Item's reward value."},"freightCommission":{"type":"integer","description":"Value of the freight commission."},"priceDefinitions":{"type":"object","description":"Item's price information.","properties":{"sellingPrices":{"type":"array","description":"Details on item's selling price.","items":{"type":"object","description":"Selling price.","properties":{"value":{"type":"integer","description":"Total value of items in cents."},"quantity":{"type":"integer","description":"Quantity of items."}}}},"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value of all item's units in cents."}}},"taxCode":{"type":["string","null"],"description":"Item's tax code."},"parentItemIndex":{"type":["integer","null"],"description":"Ranking number that shows how related items are indexed in between each other. It starts at `0` as the primary item reference and counts up to `1`, `2`, and so on. For example, a customer bought sunglasses and hired a warranty service. Since the sunglasses are index `0`, the warranty service (the [assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)) is index `1` and has the `parentItemIndex` value `0`. This response is `null` for items that are not assembly options."},"parentAssemblyBinding":{"type":["string","null"],"description":"When items are indexed in between each other, this field returns the assembly option ID. This response is `null` for items that are not [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator responsible for the order."},"serialNumbers":{"type":["string","null"],"description":"This field identifies the order in the `handling` status in the workflow, and it was used for VTEX internal control."},"assemblies":{"type":["array","null"],"description":"Information about items customization.","items":{"type":"string","description":"Customization information."}},"costPrice":{"type":"integer","description":"Item's cost price."}},"description":"Items information."}},"marketplaceItems":{"type":"array","description":"Array with marketplace items information.","items":{"type":"string","description":"Marketplace items."}},"authorizationPolicyData":{"type":"array","description":"Information about the order authorization policy. When the store doesn't have any policies, the status will always be `accepted`.","items":{"type":"object","description":"Details about the order authorization policy","properties":{"status":{"type":"string","description":"Status of the order's authorization policy.","enum":["accepted","denied","pending"]},"deniedPolicies":{"type":"array","description":"Information about the order's denied policies.","items":{"type":"object","description":"Details about the order's denied policies.","minItems":0,"properties":{"policyId":{"type":"string","description":"Unique identifier of the denied policy."},"policyName":{"type":"string","description":"Name of denied policy."},"requireAllPoliciesAcceptance":{"type":"boolean","description":"Defines whether all listed policies in the policy group must be accepted."},"policyGroupId":{"type":"string","description":"Unique identifier of the policy group."},"policyGroupName":{"type":"string","description":"Name of the policy group."},"policyGroupUnitId":{"type":"string","description":"Identifier of the business unit this policy group belongs to."},"authorizationData":{"type":["array","null"],"description":"Information about the order's authorization data.","items":{"type":"object","description":"Details about the order's authorization data.","properties":{"requireAllApprovals":{"type":"boolean","description":"Defines whether the policy requires approval by all authorizers."},"authorizers":{"type":["array","null"],"description":"Information about the order's authorizers.","items":{"type":"object","description":"Details about the order's authorizers.","properties":{"id":{"type":"string","description":"Unique identifier of the authorizer."},"type":{"type":"string","description":"Type of the authorizer.","enum":["User","Unit"]},"authorizationDate":{"type":["string","null"],"description":"Date of the authorization."}}}}}}}}}},"pendingPolicies":{"type":"array","description":"Information about the order's pending policies.","items":{"type":"object","description":"Details about the order's pending policies.","minItems":0,"properties":{"policyId":{"type":"string","description":"Unique identifier of the pending policy."},"policyName":{"type":"string","description":"Name of pending policy."},"requireAllPoliciesAcceptance":{"type":"boolean","description":"Defines whether all listed policies must be accepted."},"policyGroupId":{"type":"string","description":"Unique identifier of the policy group."},"policyGroupName":{"type":"string","description":"Name of the policy group."},"policyGroupUnitId":{"type":"string","description":"Identifier of the business unit this policy group belongs to."},"authorizationData":{"type":["array","null"],"description":"Information about the order's authorization data.","items":{"type":"object","description":"Details about the order's authorization data.","properties":{"requireAllApprovals":{"type":"boolean","description":"Defines whether the policy requires approval by all authorizers."},"authorizers":{"type":["array","null"],"description":"Information about the order's authorizers.","items":{"type":"object","description":"Details about the order's authorizers.","properties":{"id":{"type":"string","description":"Unique identifier of the authorizer."},"type":{"type":"string","description":"Type of the authorizer.","enum":["User","Unit"]},"authorizationDate":{"type":["string","null"],"description":"Date of the authorization."}}}}}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves order details by searching by order ID or sequence number. + + >⚠️ Throttling: Each VTEX account can make up to 6000 requests per minute. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + >Check the [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. Instead of using `orderId`, you can also make the request using the sequence, a six-digit string that follows the order ID. For example, in order 1268540501456-01 (501456), the sequence is 501456. To use this parameter, replace the value between `{ }` keys in `seq{sequence-number}` with the sequence. For example: `seq501456`. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 20 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Orders/Get orders by order group ID.yml b/BrunoCollections/VTEX - Orders API/Orders/Get orders by order group ID.yml new file mode 100644 index 0000000000..472319ae95 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Get orders by order group ID.yml @@ -0,0 +1,96 @@ +info: + name: Get orders by order group ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/orders/order-group/:orderGroup" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderGroup + value: v71021570str + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/pvt/orders/order-group/:orderGroup - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/pvt/orders/order-group/:orderGroup - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/oms/pvt/orders/order-group/:orderGroup - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/pvt/orders/order-group/:orderGroup - Schema is valid", function () { + const schema = {"type":"array","description":"List of orders grouped by the order group ID.","items":{"type":"object","description":"Information about an order related to the order group ID.","properties":{"orderId":{"type":"string","description":"Order ID."},"sequence":{"type":"string","description":"Sequence number part of the order ID. For example, in order `v70530116str-01`, the sequence is `70530116`."},"marketplaceOrderId":{"type":["string","null"],"description":"Order ID in the marketplace."},"marketplaceServicesEndpoint":{"type":["string","null"],"description":"Marketplace endpoint for post purchase communication."},"sellerOrderId":{"type":"string","description":"Seller order ID."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196).","enum":["Marketplace","Fulfillment","Chain"]},"affiliateId":{"type":["string","null"],"description":"Three-letter [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) code configured by the seller to identify a marketplace."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order."},"merchantName":{"type":["string","null"],"description":"For a VTEX store, the merchant's name will be the same as the account name. An external seller can have a `merchantName`, but it will not be an account name."},"status":{"type":"string","description":"[Order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) in the workflow."},"statusDescription":{"type":["string","null"],"description":"Status description displayed on the VTEX Admin. This field is obsolete and may not return any value."},"value":{"type":"integer","description":"Order total value in cents."},"creationDate":{"type":"string","description":"Order creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastChange":{"type":"string","description":"Order last change date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderGroup":{"type":"string","description":"Order group ID, a segment of the order ID that groups all orders related to the same purchase. For example, in order ID `v71021570str-02`), the order group ID is `v71021570str`."},"totals":{"type":"array","description":"Information about the order totals.","items":{"type":"object","description":"Details about the order totals.","properties":{"id":{"type":"string","description":"Total ID, which defines what the total is about.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total name."},"value":{"type":"integer","description":"Total value in cents."},"alternativeTotals":{"type":["array","null"],"description":"Information about the order alternative totals, when applicable. For example, when there is a discount for items in the marketplace that results in a difference in the `Items` total value, the `alternativeTotals` can retrieve details about it.","items":{"type":"object","description":"Details about the order alternative totals.","properties":{"id":{"type":"string","description":"Alternative total ID, which can be related to items, discounts, shipping or taxes."},"name":{"type":"string","description":"Alternative total name."},"value":{"type":"integer","description":"Alternative total value in cents."}}}}}}},"items":{"type":"array","description":"Information on order items.","items":{"type":"object","description":"Information on each order item.","properties":{"uniqueId":{"type":"string","description":"Order item unique ID."},"id":{"type":"string","description":"Item ID."},"productId":{"type":"string","description":"Product ID."},"ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"lockId":{"type":["string","null"],"description":"[Reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) ID."},"attachments":{"type":["array","null"],"description":"Information about [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":["string","null"],"description":"Attachment custom field content."}}}}},"quantity":{"type":"integer","description":"Item quantity."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"name":{"type":"string","description":"SKU name."},"refId":{"type":"string","description":"Ref ID."},"price":{"type":"integer","description":"Item price in cents."},"listPrice":{"type":"integer","description":"List price in cents."},"manualPrice":{"type":["integer","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) in cents."},"manualPriceAppliedBy":{"type":["string","null"],"description":"ID of the user who applied the manual price."},"priceTags":{"type":"array","description":"Information about price tags. A price tag is a price modifier, like s discount or a promotion applicable to the item in the order context.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":"string","description":"Price tag name."},"value":{"type":["number","null"],"description":"Price tag value in cents. Discounts correspond to negative numbers."},"isPercentual":{"type":"boolean","description":"Defines if the price tag value is applied through a percentage (`true`) or not (`false`)."},"identifier":{"type":"string","description":"Price tag identifier."},"rawValue":{"type":"number","description":"Price tag raw value."},"rate":{"type":["integer","null"],"description":"Price tag rate."},"jurisCode":{"type":["string","null"],"description":"Juris code."},"jurisType":{"type":["string","null"],"description":"Juris type."},"jurisName":{"type":["string","null"],"description":"Juris name."}}}},"imageUrl":{"type":"string","description":"Image URL."},"detailUrl":{"type":"string","description":"Detail URL."},"components":{"type":["array","null"],"description":"Item components.","items":{"type":["string","null"],"description":"Component name."}},"bundleItems":{"type":["array","null"],"description":"Information about services sold with the item. For example, a gift package.","items":{"type":"object","description":"Information about a given service.","properties":{"type":{"type":"string","description":"Service type."},"id":{"type":"integer","description":"Service ID."},"name":{"type":"string","description":"Service name."},"price":{"type":"integer","description":"Service price in cents."}}}},"params":{"type":"array","description":"Array with information about params.","items":{"type":"string","description":"Param name."}},"offerings":{"type":["array","null"],"description":"Information about offerings, which are services related to the item. For example, a warranty or installation.","items":{"type":["string","null"],"description":"Name of the service related to the item."}},"attachmentOfferings":{"type":["array","null"],"description":"Array containing attachments information.","items":{"type":["object","null"],"description":"Attachment details.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"required":{"type":["boolean","null"],"description":"Defines if the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Schema of the content declared in the field `attachmentOfferings`.","additionalProperties":{"type":["string","null"],"description":"Attachment schema content."}}}}},"sellerSku":{"type":"string","description":"Seller SKU ID."},"priceValidUntil":{"type":["string","null"],"description":"Item price expiration date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"tax":{"type":"integer","description":"Tax value in cents."},"preSaleDate":{"type":["string","null"],"description":"Presale date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"additionalInfo":{"type":"object","description":"Item additional information.","properties":{"brandName":{"type":"string","description":"Item brand name."},"brandId":{"type":"string","description":"Item brand ID."},"categoriesIds":{"type":"string","description":"Categories IDs."},"categories":{"type":"array","description":"Item [categories](https://help.vtex.com/tracks/catalog-101--5AF0XfnjfWeopIFBgs3LIQ/2gkZDjXRqfsq62TlAkj4uf) information.","items":{"type":"object","description":"Information about a given category.","properties":{"id":{"type":"integer","description":"Category ID."},"name":{"type":"string","description":"Category name."}}}},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial condition ID."},"dimension":{"type":"object","description":"Item dimensions.","required":["cubicweight","height","length","weight","width"],"properties":{"cubicweight":{"type":"number","description":"Item cubic weight."},"height":{"type":"number","description":"Item height."},"length":{"type":"number","description":"Item length."},"weight":{"type":"number","description":"Item weight."},"width":{"type":"number","description":"Item width."}}},"offeringInfo":{"type":["string","null"],"description":"Offering information."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"measurementUnit":{"type":"string","description":"Item measurement unit."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"sellingPrice":{"type":"integer","description":"Selling price in cents. This field can present rounding discrepancies, so we recommend retrieving pricing information from the `priceDefinition` field."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`) or not (`false`)."},"shippingPrice":{"type":["integer","null"],"description":"Item shipping price in cents. This value does not account for the order total shipping price."},"rewardValue":{"type":"integer","description":"Reward value in cents."},"freightCommission":{"type":"integer","description":"Freight commission value in cents."},"priceDefinition":{"type":"object","description":"Item price information.","properties":{"sellingPrices":{"type":"array","description":"Item selling prices.","items":{"type":"object","description":"Price value per quantity.","properties":{"value":{"type":"integer","description":"Item selling price value in cents."},"quantity":{"type":"integer","description":"Item quantity."}}}},"calculatedSellingPrice":{"type":"integer","description":"Item calculated selling price in cents."},"total":{"type":"integer","description":"Item total price in cents."},"reason":{"type":["string","null"],"description":"Item price definition reason."}}},"taxCode":{"type":["string","null"],"description":" Item tax code."},"parentItemIndex":{"type":["integer","null"],"description":"Ranking number that shows how related items are indexed in between each other. It starts at `0` as the primary item reference and counts up to `1`, `2`, and so on. For example, a customer bought sunglasses and hired a warranty service. Since the sunglasses are index `0`, the warranty service (the [assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)) is index `1` and has the `parentItemIndex` value `0`. This response is `null` for items that are not assembly options."},"parentAssemblyBinding":{"type":["string","null"],"description":"When items are indexed in between each other, this field returns the assembly option ID. This response is `null` for items that are not [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH)."},"callCenterOperator":{"type":["string","null"],"description":"Identification code of the call center operator that sold the item, when applicable."},"serialNumbers":{"type":["string","null"],"description":"This field identifies the order in the `handling` status in the workflow, and it was used for VTEX internal control."},"assemblies":{"type":["array","null"],"description":"Information about the item customization, when applicable.","items":{"type":["string","null"],"description":"Customization information."}},"costPrice":{"type":["integer","null"],"description":"Item cost price in cents."}}}},"marketplaceItems":{"type":"array","description":"Array with marketplace items information.","items":{"type":"string","description":"Marketplace items."}},"clientProfileData":{"type":"object","description":"Information about the customer profile.","properties":{"id":{"type":"string","description":"Object ID, the expected value is `clientProfileData`."},"email":{"type":"string","description":"Customer email."},"firstName":{"type":"string","description":"Customer first name."},"lastName":{"type":"string","description":"Customer last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document identification code informed by the customer."},"phone":{"type":"string","description":"Customer phone number."},"corporateName":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the corporate name."},"tradeName":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the trade name."},"corporateDocument":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the corporate document."},"stateInscription":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the state inscription."},"corporatePhone":{"type":["string","null"],"description":"If the customer is a legal entity, this field includes the company's phone number."},"isCorporate":{"type":"boolean","description":"Defines if the customer is a legal entity (`true`) or not (`false`)."},"userProfileId":{"type":"string","description":"Customer user profile ID."},"userProfileVersion":{"type":["string","null"],"description":"Customer user profile version."},"customerClass":{"type":["string","null"],"description":"Customer class identification."},"customerCode":{"type":["string","null"],"description":"Customer code."}}},"giftRegistryData":{"type":["object","null"],"description":"[Gift list](https://developers.vtex.com/docs/guides/creating-gift-lists) information.","properties":{"giftRegistryId":{"type":"string","description":"Gift list ID."},"giftRegistryType":{"type":"string","description":"[Gift list type](https://help.vtex.com/en/tutorial/creating-a-type-of-list)."},"giftRegistryTypeName":{"type":"string","description":"Gift list type name."},"addressId":{"type":"string","description":"Gift list shipping address ID."},"description":{"type":"string","description":"Gift list description."}}},"marketingData":{"type":["object","null"],"description":"Information about marketing and promotions, such as coupon code and [Urchin Tracking Module (UTM)](https://help.vtex.com/en/tutorial/what-are-utm-source-utm-campaign-and-utm-medium--2wTz7QJ8KUG6skGAoAQuii).","properties":{"id":{"type":"string","description":"Object ID. The expected value is `marketingData`."},"utmSource":{"type":["string","null"],"description":"A UTM is an Urchin Tracking Module used to track traffic related to your store. This field is an UTM for tracking the traffic source, to know from which site, advertiser, or publication the customer came before reaching your site."},"utmPartner":{"type":["string","null"],"description":"UTM for tracking the partner."},"utmMedium":{"type":"string","description":"UTM for tracking the advertising or marketing media used to reach your site, such as banners and newsletters."},"utmCampaign":{"type":["string","null"],"description":"UTM for tracking the marketing campaign context."},"coupon":{"type":["string","null"],"description":"Coupon code used by the customer."},"utmiCampaign":{"type":["string","null"],"description":"Internal UTM for tracking the marketing campaign context."},"utmipage":{"type":["string","null"],"description":"A `utmi` is an internal Urchin Tracking Module (UTM) used to track traffic inside your site. This field is an internal UTM for tracking pages."},"utmiPart":{"type":["string","null"],"description":"Internal UTM for tracking the partner."},"marketingTags":{"type":"array","description":"List of marketing tags valid for the item.","items":{"type":"string","description":"Marketing tag name."}}}},"ratesAndBenefitsData":{"type":"object","description":"Information on promotions and taxes that apply to the order.","properties":{"id":{"type":"string","description":"Object ID. The expected value is `ratesAndBenefitsData`."},"rateAndBenefitsIdentifiers":{"type":"array","description":"Information about order's promotions and taxes identifiers.","items":{"type":"object","description":"Information about a given promotion or tax.","properties":{"description":{"type":["string","null"],"description":"Promotion or tax description."},"featured":{"type":"boolean","description":"Defines if the [target audience](https://help.vtex.com/en/tutorial/creating-a-campaign-audience--6cnuDZJzIkIeocewAQQK4K) is featured (`true`) or not (`false`)."},"id":{"type":"string","description":"Promotion or tax ID."},"name":{"type":"string","description":"Promotion or tax name."},"matchedParameters":{"type":"object","description":"Informs the criteria and conditions fulfilled so the promotion became valid.","additionalProperties":{"type":"string","description":"Promotion or tax criteria content."}},"additionalInfo":{"type":["object","null"],"description":"Object containing the promotion or tax additional information.","additionalProperties":{"type":"string","description":"Additional information."}}}}}}},"shippingData":{"type":"object","description":"Order shipping information.","properties":{"id":{"type":"string","description":"Object ID. The expected value is `shippingData`."},"address":{"type":"object","description":"Shipping address details.","required":["addressType","receiverName","addressId","postalCode","city","state","country","street","number","neighborhood","complement","reference","geoCoordinates"],"properties":{"addressType":{"type":"string","description":"Shipping address type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"addressId":{"type":"string","description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"postalCode":{"type":"string","description":"Shipping address postal code."},"city":{"type":"string","description":"Shipping address city."},"state":{"type":"string","description":"Shipping address state."},"country":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Shipping address street."},"number":{"type":"string","description":"Shipping address number."},"neighborhood":{"type":"string","description":"Shipping address neighborhood."},"complement":{"type":["string","null"],"description":"Shipping address complement."},"reference":{"type":["string","null"],"description":"Shipping address additional information."},"geoCoordinates":{"type":"array","description":"Shipping address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}},"logisticsInfo":{"type":"array","description":"Logistics information regarding order items.","items":{"type":"object","description":"Logistics information about an item.","properties":{"itemIndex":{"type":"integer","description":"Each item in the order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"itemId":{"type":"string","description":"SKU ID."},"selectedSla":{"type":"string","description":"Service Level Agreement (SLA), which corresponds to the shipping method selected by the customer, usually like normal or express."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time."},"price":{"type":"integer","description":"Item shipping price in cents. This value does not correspond to the order total shipping price."},"listPrice":{"type":"integer","description":"Item [list price](https://help.vtex.com/en/tracks/prices-101--6f8pwCns3PJHqMvQSugNfP/3XcXp0r5WrJvogB8KIX4Kx#list-price) in cents."},"sellingPrice":{"type":"integer","description":"Item selling price in cents."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, when applicable."},"deliveryCompany":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company name."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"shippingEstimateDate":{"type":"string","description":"Shipping estimate date, defined after order confirmation, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"slas":{"type":"array","description":"Service Level Agreements (SLA) corresponding to [shipping policies](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).","items":{"type":"object","description":"Service Level Agreement (SLA) information.","properties":{"id":{"type":"string","description":"ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"name":{"type":"string","description":"[Shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) name."},"shippingEstimate":{"type":"string","description":"Shipping estimate time in days. For instance, three business days is represented `3bd`."},"shippingEstimateDate":{"type":["string","null"],"description":"SLA shipping estimate date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"deliveryWindow":{"type":["string","null"],"description":"[Delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable."},"availableDeliveryWindows":{"type":["array","null"],"description":"Available delivery windows information, when applicable.","items":{"type":"string","description":"Information about an available delivery window."}},"deliveryIds":{"type":"array","description":"SLA delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"courierName":{"type":"string","description":"Carrier name."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"listPrice":{"type":"integer","description":"SLA shipping list price in cents."},"price":{"type":"integer","description":"SLA shipping price in cents. Does not account for the order total shipping price."},"selectedDeliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time related to the SLA."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."},"pickupDistance":{"type":["number","null"],"description":"Distance in kilometers between the pickup point and the customer address. The distance is measured as a straight line."}}}},"shipsTo":{"type":"array","description":"List of shipping address countries.","items":{"type":"string","description":"Shipping address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."}},"deliveryIds":{"type":"array","description":"Order delivery IDs information.","items":{"type":"object","description":"Information about a delivery ID.","properties":{"courierId":{"type":"string","description":"Carrier ID."},"courierName":{"type":"string","description":"Carrier name."},"dockId":{"type":"string","description":"[Loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) ID."},"quantity":{"type":"integer","description":"Quantity of items being delivered."},"warehouseId":{"type":"string","description":"[Warehouse](https://help.vtex.com/en/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb) ID."},"accountCarrierName":{"type":"string","description":"Account carrier name."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kit](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28) items, when applicable.","items":{"type":"string","description":"Kit item information."}}}}},"deliveryChannels":{"type":"array","description":"Delivery channels associated with the sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)).","items":{"type":"object","description":"Delivery channel information.","properties":{"id":{"type":"string","description":"Delivery channel shipping type.","enum":["delivery","pickup-in-point"]},"stockBalance":{"type":"integer","description":"Stock check for SKU availability."}}}},"deliveryChannel":{"type":"string","description":"Defines if the delivery channel is delivery or pickup. This field is deprecated and was replaced by the `deliveryChannels` field.","enum":["delivery","pickup-in-point"]},"pickupStoreInfo":{"type":"object","description":"Information about a [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"properties":{"isPickupStore":{"type":"boolean","description":"Defines if the shipping type was pickup (`true`) or not (`false`)."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"address":{"type":["object","null"],"description":"Pickup point address information.","properties":{"postalCode":{"type":"string","description":"Pickup point address postal code."},"country":{"type":"string","description":"Three-digit country code of the pickup point address in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"city":{"type":"string","description":"Pickup point address city."},"state":{"type":"string","description":"Pickup point address state."},"neighborhood":{"type":"string","description":"Pickup point address neighborhood."},"street":{"type":"string","description":"Pickup point address street."},"number":{"type":"string","description":"Pickup point address number."},"complement":{"type":"string","description":"Pickup point address complement."},"reference":{"type":["string","null"],"description":"Pickup point address reference."},"location":{"type":"object","description":"Pickup point geolocation coordinates.","properties":{"latitude":{"type":"number","description":"Latitude coordinate."},"longitude":{"type":"number","description":"Longitude coordinate."}}}}},"additionalInfo":{"type":["string","null"],"description":"Additional information."},"dockId":{"type":["string","null"],"description":"ID of the loading dock related to the pickup point."}}},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when applicable."},"transitTime":{"type":"string","description":"Number of days the carrier takes in transit to deliver the order. For instance, three business days is represented `3bd`."}}}},"trackingHints":{"type":["array","null"],"description":"List containing order shipping label information.","items":{"type":"object","description":"Shipping label details.","properties":{"trackingId":{"type":"string","description":"Order tracking ID."},"courierName":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) name."},"trackingUrl":{"type":"string","description":"Order tracking URL."},"trackingLabel":{"type":"string","description":"Order tracking label."}}}},"selectedAddresses":{"type":"array","description":"Selected adresses information.","items":{"type":"object","description":"Details about a selected adress.","properties":{"addressId":{"type":"string","description":"Selected address ID."},"versionId":{"type":["string","null"],"description":"Selected address version ID."},"entityId":{"type":["string","null"],"description":"Selected address entity ID."},"addressType":{"type":"string","description":"Selected adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"street":{"type":"string","description":"Selected address street."},"number":{"type":"string","description":"Selected address number."},"complement":{"type":["string","null"],"description":"Selected address complement."},"neighborhood":{"type":"string","description":"Selected address neighborhood."},"postalCode":{"type":"string","description":"Selected address postal code."},"city":{"type":"string","description":"Selected address city."},"state":{"type":"string","description":"Selected address state."},"country":{"type":"string","description":"Selected address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"reference":{"type":["string","null"],"description":"Selected address additional information."},"geoCoordinates":{"type":"array","description":"Selected address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}}},"availableAddresses":{"type":"array","description":"Available adresses information.","items":{"type":"object","description":"Details about an available adress.","properties":{"addressId":{"type":"string","description":"Available address ID."},"versionId":{"type":["string","null"],"description":"Available address version ID."},"entityId":{"type":["string","null"],"description":"Available address entity ID."},"addressType":{"type":"string","description":"Available adress shipping type.","enum":["residential","pickup"]},"receiverName":{"type":"string","description":"Full name of the order receiver."},"street":{"type":"string","description":"Available address street."},"number":{"type":"string","description":"Available address number."},"complement":{"type":["string","null"],"description":"Available address complement."},"neighborhood":{"type":"string","description":"Available address neighborhood."},"postalCode":{"type":"string","description":"Available address postal code."},"city":{"type":"string","description":"Available address city."},"state":{"type":"string","description":"Available address state."},"country":{"type":"string","description":"Available address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"reference":{"type":["string","null"],"description":"Available address additional information."},"geoCoordinates":{"type":"array","description":"Available address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}}},"contactInformation":{"type":["array","null"],"description":"Order contact information.","items":{"type":"object","description":"Order contact details.","properties":{"id":{"type":"string","description":"Contact ID."},"email":{"type":"string","description":"Contact email."},"firstName":{"type":"string","description":"Contact first name."},"lastName":{"type":"string","description":"Contact last name."},"document":{"type":"string","description":"Contact document number."},"phone":{"type":"string","description":"Contact phone number."},"documentType":{"type":"string","description":"Contact document type."}}}}}},"paymentData":{"type":"object","description":"Payments information.","properties":{"giftCards":{"type":["array","null"],"description":"[Gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide) information, when applicable.","items":{"type":"object","description":"Gift card details.","properties":{"id":{"type":"string","description":"Gift card identification."},"redemptionCode":{"type":"string","description":"Gift card code used by the customer at checkout."},"name":{"type":["string","null"],"description":"Gift card name."},"caption":{"type":["string","null"],"description":"Gift card loyalty program, when applicable."},"value":{"type":"integer","description":"Gift card value in cents."},"balance":{"type":"number","description":"Gift card current balance. For newly created gift cards, the balance will be `0.0`."},"provider":{"type":"string","description":"Gift card provider name."},"groupName":{"type":["string","null"],"description":"Gift card group name."},"inUse":{"type":"boolean","description":"Defines if the gift card is in use (`true`) or not (`false`)."},"isSpecialCard":{"type":"boolean","description":"Defines if the gift card is a special card (`true`) or not (`false`)."}}}},"transactions":{"type":"array","description":"Information about the order financial transactions.","items":{"type":"object","description":"Information about a given transaction.","properties":{"isActive":{"type":"boolean","description":"Defines of the transaction is active (`true`) or inactive (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"Payments information.","items":{"type":"object","description":"Payment details.","properties":{"id":{"type":"string","description":"Payment unique identifier."},"paymentSystem":{"type":"string","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","description":"Order total payment value in cents."},"installments":{"type":"integer","description":"Number of payment installments."},"referenceValue":{"type":"integer","description":"Total payment reference value in cents."},"cardHolder":{"type":["string","null"],"description":"Name of the card owner."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first four digits."},"lastDigits":{"type":["string","null"],"description":"Card last four digits."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"expireMonth":{"type":["string","null"],"description":"Card expiration month in 2-digit format."},"expireYear":{"type":["string","null"],"description":"Card expiration year in 4-digit format."},"url":{"type":["string","null"],"description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Gift card code used by the customer at checkout."},"group":{"type":"string","description":"Transaction payment method, which can be credit card, debid card, bank invoice, promissory, gift card or pix (`instantPayment`).","enum":["creditCard","debitCard","bankInvoice","promissory","giftCard","instantPayment"]},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"dueDate":{"type":["string","null"],"description":"Payment due date in `MM/YY` format."},"connectorResponses":{"type":"object","description":"Payment provider (connector) responses. The fields within this object can vary according to the order payment provider.","properties":{"Message":{"type":["string","null"],"description":"Provider operational message or error to be logged."},"tid":{"type":"string","description":"Provider unique identifier for the transaction."},"authorizationId":{"type":"string","description":"Provider authorization ID."},"status":{"type":"string","description":"Order payment status in the [transaction flow](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/1xjzgJZvqwaI1rfxLMCC3Y)."},"delayToAutoSettle":{"type":"integer","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`, regardless if the payment was approved by the merchant's anti-fraud provider. The maximum value allowed is `604800` seconds (7 days)."},"ReturnCode":{"type":["string","null"],"description":"Provider operational return code or error to be logged."},"nsu":{"type":"string","description":"Provider unique sequential number for the transaction."},"code":{"type":"string","description":"Provider operational code or error to be logged."},"message":{"type":"string","description":"Provider operational message or error to be logged."},"Tid":{"type":"string","description":"Provider unique identifier for the transaction."},"acquirer":{"type":"string","description":"[Acquirer](https://help.vtex.com/en/tracks/payments--6GAS7ZzGAm7AGoEAwDbwJG/kdPbEIWf8Xq8tESQvViMB#acquirer) name (mostly used for card payments)."},"authId":{"type":"string","description":"Authorization identification."},"paymentId":{"type":"string","description":"Payment ID."},"delayToAutoSettleAfterAntifraud":{"type":"string","description":"Total time (in seconds) before the auto settle, when the platform makes an automatic call to `/settlements`. This happens only after the payment was approved by the merchant's anti-fraud provider."}}},"giftCardProvider":{"type":["string","null"],"description":"Gift card provider ID."},"giftCardAsDiscount":{"type":["boolean","null"],"description":"Defines if the payment has a gift card discount (`true`) or not (`false`)."},"koinUrl":{"type":["string","null"],"description":"Koin connector URL."},"accountId":{"type":["string","null"],"description":"Identification code of the account where the payment was made."},"parentAccountId":{"type":["string","null"],"description":"When the payment was made in a subaccount, this field retrieves the main account ID."},"bankIssuedInvoiceIdentificationNumber":{"type":["string","null"],"description":"Bank issued invoice numeric sequence."},"bankIssuedInvoiceIdentificationNumberFormatted":{"type":["string","null"],"description":"Bank issued invoice numeric sequence formatted as customers see."},"bankIssuedInvoiceBarCodeNumber":{"type":["string","null"],"description":"Bank issued invoice bar code number."},"bankIssuedInvoiceBarCodeType":{"type":["string","null"],"description":"Bank issued invoice bar code type."},"billingAddress":{"type":["object","null"],"description":"Billing address information.","properties":{"postalCode":{"type":"string","description":"Billing address postal code."},"city":{"type":"string","description":"Billing address city."},"state":{"type":"string","description":"Billing address state."},"country":{"type":"string","description":"Billing address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Billing address street."},"number":{"type":"string","description":"Billing address number."},"neighborhood":{"type":"string","description":"Billing address neighborhood."},"complement":{"type":["string","null"],"description":"Billing address complement."},"reference":{"type":["string","null"],"description":"Billing address additional information."},"geoCoordinates":{"type":"array","description":"Billing address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}}}},"paymentOrigin":{"type":["string","null"],"description":"Type of [wallet](https://help.vtex.com/en/tutorial/what-is-an-e-wallet--4v5wcOe4A0SiaimWM2cU60) used in the payment."}}}}}}}}},"packageAttachment":{"type":["object","null"],"description":"Information about shipping packages, which are created after order invoicing.","properties":{"packages":{"type":["array","null"],"description":"List with packages' information.","items":{"type":"object","description":"Package details.","properties":{"courier":{"type":"string","description":"Name of the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) responsible for the package shipping."},"description":{"type":["string","null"],"description":"Package description."},"invoiceNumber":{"type":"string","description":"Unique identification code of the package invoice."},"invoiceValue":{"type":"integer","description":"Package invoice value in cents."},"invoiceUrl":{"type":"string","description":"Package invoice URL."},"issuanceDate":{"type":"string","description":"Package invoice issuance date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"trackingNumber":{"type":"string","description":"Package [tracking number](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-)."},"invoiceKey":{"type":"string","description":"Package invoice key."},"trackingUrl":{"type":"string","description":"Package tracking URL."},"embeddedInvoice":{"type":"string","description":"Package invoice text in [xml format](https://help.vtex.com/en/tutorial/configuring-xml--tutorials_242). This field is important for stores integrated with [external marketplaces](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide)."},"type":{"type":"string","description":"Package invoice type, which can be:\r\n- `Output`: Selling order invoice.\r\n- `Input`: Returning items invoice.","enum":["Output","Input"]},"items":{"type":"array","description":"Information on each item in the package.","items":{"type":"object","description":"Package item details.","properties":{"itemIndex":{"type":"integer","description":"Item index of the item position whithin the `items` array. The count starts at `0`."},"id":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Package item quantity."},"price":{"type":"integer","description":"Package item price in cents."},"description":{"type":"string","description":"Package item description."},"unitMultiplier":{"type":"number","description":"Package item unit multiplier."}}}},"courierStatus":{"type":["object","null"],"description":"[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) shipping information.","properties":{"deliveredDate":{"type":"string","description":"Package delivery date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"status":{"type":["string","null"],"description":"Defines if a carrier was assigned for order shipping (`ok`) or not (`null`)."},"finished":{"type":"boolean","description":"Defines if the carrier has already delivered the package (`true`) or not (`false`)."},"data":{"type":"array","description":"Package tracking information.","items":{"type":"object","description":"Package tracking details.","properties":{"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"city":{"type":"string","description":"Package tracking city."},"state":{"type":"string","description":"Package tracking state in two-digit code format."},"description":{"type":"string","description":"Package tracking description."},"createDate":{"type":"string","description":"Package tracking creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}},"cfop":{"type":["string","null"],"description":"[CFOP](https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/facilitacao/anexo-ecf-cfop) (_Código Fiscal de Operação e Prestação_) is a Brazilian fiscal code of operations and services that classifies business transaction types."},"lastChange":{"type":"string","description":"Date since package tracking last change in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"restitutions":{"type":["object","null"],"description":"Information about a value being returned to the customer. This field applies only to invoices with the `Input` type because it relates to returning items.","properties":{"refund":{"type":"object","description":"Customer refund details.","properties":{"value":{"type":"integer","description":"Refund value in cents."},"giftCardData":{"type":["string","null"],"description":"Refund involving a [gift card](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."},"items":{"type":["array","null"],"description":"Information about the items being returned.","items":{"type":"object","description":"Returned item details.","properties":{"useFreight":{"type":["boolean","null"],"description":"Defines if the refund includes freight values (`true`) or not (`false`)."},"isCompensation":{"type":"boolean","description":"Defines if there are compensated unit tags in the package (`true`) or not (`false`)."},"compensationValue":{"type":"integer","description":"Compensational refund value in cents."},"id":{"type":"string","description":"SKU ID of the returned item."},"quantity":{"type":"integer","description":"Number of items being returned."},"price":{"type":"integer","description":"Returned item price in cents."},"description":{"type":"string","description":"Customer reason for returning the item."}}}}}}}},"volumes":{"type":["integer","null"],"description":"Indicates the number of boxes (volumes) needed to contain the package items. For example, two refrigerators do not fit in a single volume, so this field would have value `2`."}}}}}},"sellers":{"type":"array","description":"Information about the sellers associated with the order.","items":{"type":"object","description":"Information about a given seller.","properties":{"id":{"type":"string","description":"Seller identifier."},"name":{"type":"string","description":"Seller name."},"logo":{"type":["string","null"],"description":"Seller logo URL."},"fulfillmentEndpoint":{"type":"string","description":"URL of the endpoint for fulfillment of seller's orders, which the marketplace use to communicate with the seller."}}}},"callCenterOperatorData":{"type":["object","null"],"description":"Information about the call center operator responsible for the order.","properties":{"id":{"type":"string","description":"Call center operator identification code."},"email":{"type":"string","description":"Call center operator email."},"userName":{"type":"string","description":"Call center operator user name."}}},"followUpEmail":{"type":"string","description":"Email of the store employee responsible for managing the order."},"lastMessage":{"type":["string","null"],"description":"Last transactional message sent to the customer."},"hostname":{"type":"string","description":"Main [account name](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC)."},"invoiceData":{"type":["object","null"],"description":"Order invoices information.","properties":{"address":{"type":["object","null"],"description":"Invoice address information.","properties":{"addressType":{"type":["string","null"],"description":"Invoice address type, which can be `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]},"receiverName":{"type":["string","null"],"description":"Full name of the order receiver."},"addressId":{"type":["string","null"],"description":"Invoice address ID."},"versionId":{"type":["string","null"],"description":"Invoice address version ID."},"entityId":{"type":["string","null"],"description":"Invoice address entity ID."},"postalCode":{"type":"string","description":"Invoice address postal code."},"city":{"type":"string","description":"Invoice address city."},"state":{"type":"string","description":"Invoice address state."},"country":{"type":"string","description":"Invoice address three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"street":{"type":"string","description":"Invoice address street."},"number":{"type":"string","description":"Invoice address number."},"neighborhood":{"type":"string","description":"Invoice address neighborhood."},"complement":{"type":["string","null"],"description":"Invoice address complement."},"reference":{"type":["string","null"],"description":"Invoice address additional information."},"geoCoordinates":{"type":"array","description":"Invoice address pair of geolocation coordinates, first longitude then latitude.","items":{"type":"number","description":"Longitude or latitude."}},"contactId":{"type":["string","null"],"description":"Contact unique identifier."}}},"userPaymentInfo":{"type":["object","null"],"description":"Invoice information regarding payment method.","properties":{"paymentMethods":{"type":"array","description":"List of the payment methods used by the customer in the purchase.","items":{"type":"string","description":"Payment method name."}}}},"invoiceSubject":{"type":["object","null"],"description":"Information about the invoice subject.","properties":{"id":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject email address."},"firstName":{"type":"string","description":"Invoice subject first name."},"lastName":{"type":"string","description":"Invoice subject last name."},"phone":{"type":"string","description":"Invoice subject phone number."}}}}},"changesAttachment":{"type":["object","null"],"description":"Information about changes in the order.","required":["id","changesData"],"properties":{"id":{"type":"string","description":"Order changes ID."},"changesData":{"type":"array","description":"Information about changes in the order.","items":{"required":["reason","discountValue","incrementValue","itemsAdded","itemsRemoved","receipt"],"type":"object","description":"Details about an order change.","properties":{"reason":{"type":"string","description":"Text explaining why the order was changed. This information may be shown to the customer in the storefront or transactional emails."},"discountValue":{"type":["integer","null"],"description":"Order change discount value in cents."},"incrementValue":{"type":["integer","null"],"description":"Order change increment value in cents."},"itemsAdded":{"type":["array","null"],"description":"Information about items added to the order, when applicable.","items":{"type":"object","description":"Information about an item added to the order.","properties":{"id":{"type":"string","description":"Added item SKU ID."},"name":{"type":"string","description":"Added item SKU name."},"quantity":{"type":"integer","description":"Quantity of items added."},"price":{"type":"integer","description":"Added item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Added item unit multiplier."}}}},"itemsRemoved":{"type":["array","null"],"description":"Information about items removed from the order, when applicable.","items":{"type":"object","description":"Information about an item removed from the order.","required":["id","name","quantity","price","unitMultiplier"],"properties":{"id":{"type":"string","description":"Removed item SKU ID."},"name":{"type":"string","description":"Removed item name."},"quantity":{"type":"integer","format":"int32","description":"Quantity of removed items."},"price":{"type":"integer","format":"int32","description":"Removed item price in cents."},"unitMultiplier":{"type":["string","null"],"description":"Removed item unit multiplier."}}}},"receipt":{"required":["date","orderId","receipt"],"type":"object","description":"Order changes receipt information.","properties":{"date":{"type":"string","description":"Receipt creation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"orderId":{"type":"string","description":"Order ID."},"receipt":{"type":"string","description":"Receipt unique identifier code."}}}}}}}},"openTextField":{"type":["object","null"],"description":"Optional field for additional information.","additionalProperties":{"type":"string","description":"Additional information."}},"roundingError":{"type":"integer","description":"Rounding error total value in cents, when applicable. For example, in orders with a discount over non-integer multiplier items, the rounding price is applied per item, not after the sum of all items, what can cause a difference in the total discount value."},"orderFormId":{"type":"string","description":"ID of the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields), the main object processed by the VTEX Checkout."},"commercialConditionData":{"type":["string","null"],"description":"Commercial condition information."},"isCompleted":{"type":"boolean","description":"Defines if the order payment has been settled (`true`) or not (`false`)."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields. For example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}},"customFields":{"type":"array","description":"Array with information about the custom fields.","items":{"type":"object","description":"Object with information about the custom fields.","properties":{"linkedEntity":{"type":"object","description":"Linked entity information.","properties":{"type":{"type":"string","description":"Type of the linked entity such as `cart`, `item`, `address`."},"id":{"type":"string","description":"ID of the linked entity."}}},"fields":{"type":"array","description":"Array with information about the custom field's name and value.","items":{"type":"object","description":"Custom field's name and value.","properties":{"name":{"type":"string","description":"Name of the custom field."},"value":{"type":"string","description":"Value of the custom field."}}}}}}}}},"storePreferencesData":{"type":"object","description":"Store preferences in the [Account settings](https://help.vtex.com/en/tutorial/account-details-page--2vhUVOKfCaswqLguT2F9xq) page.","properties":{"countryCode":{"type":"string","description":"Country code in three-digit [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"currencyFormatInfo":{"type":"object","description":"Currency format settings.","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Number of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Character for currency decimal separation."},"CurrencyGroupSeparator":{"type":"string","description":"Character for currency group separation."},"CurrencyGroupSize":{"type":"integer","description":"Limit of characters that can be grouped for currency groups."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if the prices displayed for customers start with the currency symbol (`true`) or not (`false`)."}}},"currencyLocale":{"type":"integer","description":"Currency locale code in [LCID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) format."},"currencySymbol":{"type":"string","description":"Currency symbol characters."},"timeZone":{"type":"string","description":"Time zone considered for the store orders."}}},"allowCancellation":{"type":"boolean","description":"Defines if order cancellation is allowed (`true`) or not anymore (`false`)."},"allowEdition":{"type":"boolean","description":"Defines if the order can be edited (`true`) or not anymore (`false`)."},"isCheckedIn":{"type":"boolean","description":"Defines if the order was placed via [VTEX Sales App](https://help.vtex.com/en/tracks/instore-getting-started-and-setting-up--zav76TFEZlAjnyBVL5tRc) (`true`) or not (`false`)."},"marketplace":{"type":["object","null"],"description":"Information about the marketplace related to the order.","properties":{"baseURL":{"type":"string","description":"Marketplace base URL."},"isCertified":{"type":["boolean","null"],"description":"Defines if the marketplace is a [VTEX certified marketplace](https://help.vtex.com/en/tutorial/marketplace-strategies-at-vtex--tutorials_402#integrating-with-certified-marketplaces) (`true`) or not (`false`)."},"name":{"type":"string","description":"Marketplace name."}}},"authorizedDate":{"type":["string","null"],"description":"Order authorization date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"invoicedDate":{"type":["string","null"],"description":"Order invoice date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cancelReason":{"type":["string","null"],"description":"Order cancellation reason."},"itemMetadata":{"type":"object","description":"Metadata information about items.","properties":{"Items":{"type":"array","description":"Metadata details about items.","items":{"type":"object","description":"Metadata details about a given item","properties":{"Id":{"type":"string","description":"SKU ID."},"Seller":{"type":"string","description":"Seller ID."},"Name":{"type":"string","description":"Item name as displayed to customers in the storefront."},"SkuName":{"type":"string","description":"SKU name."},"ProductId":{"type":"string","description":"Product ID."},"RefId":{"type":"string","description":"SKU reference ID."},"Ean":{"type":["string","null"],"description":"European Article Number (EAN) of the item."},"ImageUrl":{"type":"string","description":"SKU image URL."},"DetailUrl":{"type":"string","description":"SKU slug."},"AssemblyOptions":{"type":["array","null"],"description":"[Assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) information related to the item, when applicable.","items":{"type":"object","description":"[Assembly option](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) details.","properties":{"Id":{"type":"string","description":"Assembly option ID."},"Name":{"type":"string","description":"Assembly option name."},"Required":{"type":"boolean","description":"Defines if sending the attachment for the item purchased is required(`true`) or optional (`false`)."},"InputValues":{"type":["object","null"],"description":"Assembly option content.","additionalProperties":{"type":["string","null"],"description":"Assembly option value."}},"Composition":{"type":["object","null"],"description":"Assembly option composition.","additionalProperties":{"type":"string","description":"Assembly option composition value."}}}}}}}}}},"subscriptionData":{"type":["object","null"],"description":"Information about [subscriptions](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453), when applicable.","properties":{"subscriptionGroupId":{"type":["string","null"],"description":"Subscription group ID. If this field returns `null` and the `executionCount` is `0`, the order is the first subscription order."},"subscriptions":{"type":["array","null"],"description":"List with subscriptions details.","items":{"type":"object","description":"Subscription details.","properties":{"executionCount":{"type":"integer","description":"Position of the order in the subscription cycle. The first order will have the value `0`, the second will have the value `1`, and so on."},"priceAtSubscriptionDate":{"type":["number","null"],"description":"Value of the order when the customer subscribed. Subscriptions created via VTEX Admin or [Subscriptions API](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3) do not have an original order, so this field returns `0.0`."},"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts in `0`, followed by `1`, `2`, and so on."},"plan":{"type":"object","description":"Information about the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR).","properties":{"type":{"type":"string","description":"Plan type."},"frequency":{"type":"object","description":"Information about the subscription recurrence.","properties":{"periodicity":{"type":"string","description":"Defines the subscription recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the frequency. For a `DAY` frequency, the value will be days, for `MONTH` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription will be valid.","properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}}}}}}},"taxData":{"type":["object","null"],"description":"Order taxes information.","required":["areTaxesDesignatedByMarketplace","taxInfoCollection"],"properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"Defines if the taxes were applied by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Order taxes details.","items":{"type":"object","description":"Information about a given tax.","required":["itemIndex","sku","priceTags"],"properties":{"itemIndex":{"type":"integer","description":"Item indexing number."},"sku":{"type":"string","description":"SKU ID."},"priceTags":{"type":["array","null"],"description":"Price tags information.","items":{"type":"object","description":"Information about a given price tag.","properties":{"identifier":{"type":"string","description":"Price tag identifier code."},"isPercentual":{"type":"boolean","description":"Indicates whether price tag value is applied through a percentage (`true`) or not (`false`)."},"name":{"type":"string","description":"Price tag name."},"value":{"type":"integer","description":"Price tag value in cents."},"rawValue":{"type":"number","description":"Price tag raw value that can contain up to five decimals, separated by a period."}}}}}}}}},"checkedInPickupPointId":{"type":["string","null"],"description":"When the order is created at a physical store which is configured as a pickup point, this field retrieves the pickup point ID."},"cancellationData":{"type":["object","null"],"description":"Information about [order cancellation](https://developers.vtex.com/docs/guides/order-canceling-improvements), when applicable.","properties":{"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"requestedBySystem":{"type":["boolean","null"],"description":"Defines if the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example."},"requestedBySellerNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the seller (`true`) or not (`false`)."},"requestedByPaymentNotification":{"type":["boolean","null"],"description":"Defines if the order cancellation was requested by the payment gateway (`true`) or not (`false`)."},"reason":{"type":"string","description":"Reason why the order was canceled."},"cancellationDate":{"type":"string","description":"Order cancellation date in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cancellationRequestId":{"type":"string","description":"ID that identifies the cancellation operation."}}},"cancellationRequests":{"type":["array","null"],"description":"Information about the [seller order cancellation denials](https://developers.vtex.com/docs/guides/order-canceling-improvements), regardless if the cancellation request was made by the marketplace or the customer.","items":{"type":"object","description":"Information about the seller denial to a given order cancellation request.","properties":{"id":{"type":"string","description":"ID that identifies the original cancellation operation made by the marketplaces or its customer care service using the [Cancel order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/cancel) endpoint."},"reason":{"type":"string","description":"Reason why there was a request to cancel the order."},"cancellationRequestDate":{"type":"string","description":"Date of when the order cancellation request was processed by the platform. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"requestedByUser":{"type":"boolean","description":"Defines if the order cancellation was requested by the customer (`true`) or not (`false`)."},"deniedBySeller":{"type":"boolean","description":"Defines if the order cancellation request was [denied by the seller](https://developers.vtex.com/docs/guides/order-canceling-improvements) (`true`) or accepted by the seller (`false`)."},"deniedBySellerReason":{"type":["string","null"],"description":"Reason given by the seller for denying the order cancellation."},"cancellationRequestDenyDate":{"type":["string","null"],"description":"Date of when the platform processed the seller denial to an order cancellation request. The date format is [ISO 8601 time zone offset](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}},"clientPreferencesData":{"type":"object","description":"Information about the customer preferences.","properties":{"locale":{"type":"string","description":"Language code of the customer preferred language while accessing the store."},"optinNewsLetter":{"type":"boolean","description":"Defines if the customer receives the store's newsletter (`true`) or not (`false`)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details about all orders related to the same purchase by searching by order group ID. + + >⚠️ Throttling: Each VTEX account can make up to 6000 requests per minute. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderGroup` | path | (Required) Order group ID is a part of the order ID that groups all orders related to the same purchase. For example, when an order is fullfilled by multiple sellers, each seller has its own order ID (`v71021570str-01` and `v71021570str-02`), but they share the same order group ID (`v71021570str`). | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 35 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Orders/List orders.yml b/BrunoCollections/VTEX - Orders API/Orders/List orders.yml new file mode 100644 index 0000000000..7c93af05e1 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/List orders.yml @@ -0,0 +1,213 @@ +info: + name: List orders + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/orders" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderBy + value: v502556llux-01,asc + type: query + disabled: true + - name: page + value: "10" + type: query + disabled: true + - name: per_page + value: "15" + type: query + disabled: true + - name: f_hasInputInvoice + value: "false" + type: query + disabled: true + - name: q + value: "- OrderID: v212333lux-02 - Client email: taylor@email.com - Client document: 21133355524 - Client name: Taylor" + type: query + disabled: true + - name: f_shippingEstimate + value: 0.days + type: query + disabled: true + - name: f_invoicedDate + value: invoicedDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z] + type: query + disabled: true + - name: f_creationDate + value: creationDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z] + type: query + disabled: true + - name: f_authorizedDate + value: creationDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z] + type: query + disabled: true + - name: f_UtmSource + value: christmas_campaign + type: query + disabled: true + - name: f_sellerNames + value: SellerName + type: query + disabled: true + - name: f_callCenterOperatorName + value: Operator%20Name + type: query + disabled: true + - name: f_salesChannel + value: Main + type: query + disabled: true + - name: salesChannelId + value: "1" + type: query + disabled: true + - name: f_affiliateId + value: WLM + type: query + disabled: true + - name: f_status + value: ready-for-handling + type: query + disabled: true + - name: incompleteOrders + value: "true" + type: query + disabled: true + - name: f_paymentNames + value: Visa + type: query + disabled: true + - name: f_RnB + value: Free+Shipping + type: query + disabled: true + - name: searchField + value: "- SKU ID: `25` - Gift List ID: `11223` - Transaction ID (TID): `54546300238810034995829230012` - PCI Connector's Transaction ID (TID): `7032909234899834298423209` - Payment ID (PID): `2` - Connector's NSU: `2437281`" + type: query + disabled: true + - name: f_isInstore + value: "true" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/pvt/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/pvt/orders - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[GET]::/api/oms/pvt/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/pvt/orders - Schema is valid", function () { + const schema = {"title":"Userorderslist","required":["list","facets","paging","stats"],"type":"object","description":"Order list object.","properties":{"list":{"type":"array","items":{"title":"List1","required":["orderId","creationDate","clientName","items","totalValue","paymentNames","status","statusDescription","marketPlaceOrderId","sequence","salesChannel","affiliateId","origin","workflowInErrorState","workflowInRetry","lastMessageUnread","ShippingEstimatedDate","ShippingEstimatedDateMax","ShippingEstimatedDateMin","orderIsComplete","listId","listType","authorizedDate","callCenterOperatorName","totalItems","currencyCode"],"type":"object","properties":{"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"creationDate":{"type":"string","description":"Order's creation date."},"clientName":{"type":"string","description":"Order's customer name."},"items":{"type":["array","null"],"items":{"title":"Item2","required":["seller","quantity","description","ean","refId","id","productId","sellingPrice","price"],"type":"object","properties":{"seller":{"type":"string","description":"Seller related to the order."},"quantity":{"type":"integer","description":"Quantity of SKUs."},"description":{"type":"string","description":"Description of items."},"ean":{"type":["string","null"],"description":"EAN of the SKU."},"refId":{"type":["string","null"],"description":"Item's reference ID."},"id":{"type":"string","description":"Item's SKU ID, which is a unique numerical identifier."},"productId":{"type":"string","description":"ID of the Product associated with the item."},"sellingPrice":{"type":"integer","description":"Details on item's selling price."},"price":{"type":"integer","description":"Item's price."}}},"description":"Information about order's items."},"totalValue":{"type":"integer","description":"Total value amount."},"paymentNames":{"type":["string","null"],"description":"Payment system name."},"status":{"type":"string","description":"Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"statusDescription":{"type":"string","description":"Status description which is displayed on the Admin panel. This field is deprecated and may not return any value."},"marketPlaceOrderId":{"type":["string","null"],"description":"Marketplace order ID."},"sequence":{"type":"string","description":"Six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order."},"affiliateId":{"type":"string","description":"Corresponds to the three-digits [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types), which can be `Marketplace`, `Fulfillment` or `Chain`."},"workflowInErrorState":{"type":"boolean","description":"If there is a work flow error (`true`) or not (`false`)."},"workflowInRetry":{"type":"boolean","description":"If the order is in a work flow retry (`true`) or not (`false`)."},"lastMessageUnread":{"type":["string","null"],"description":"Last sent transactional message."},"ShippingEstimatedDate":{"type":["string","null"],"description":"Estimate shipping date."},"ShippingEstimatedDateMax":{"type":["string","null"],"description":"The most extended shipping estimation possible."},"ShippingEstimatedDateMin":{"type":["string","null"],"description":"The least extended shipping estimation possible."},"orderIsComplete":{"type":"boolean","description":"If it is a completed order (`true`) or not (`false`). For more information, see [Order flow and status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"listId":{"type":["string","null"],"description":"Related Gift List ID."},"listType":{"type":["string","null"],"description":"Related Gift list type."},"authorizedDate":{"type":["string","null"],"description":"Authorized order date."},"callCenterOperatorName":{"type":["string","null"],"description":"Call center operator responsible for the order."},"totalItems":{"type":"integer","description":"Order's total amount of items."},"currencyCode":{"type":["string","null"],"description":"Currency code in ISO 4217. For example, `BRL`."}}},"description":"List with user's orders details."},"facets":{"type":"array","items":{"type":"string"},"description":"Array containing facets information."},"paging":{"type":"object","description":"Pagination information.","required":["total","pages","currentPage","perPage"],"properties":{"total":{"type":"integer","description":"Total number of orders."},"pages":{"type":"integer","description":"Total number of pages."},"currentPage":{"type":"integer","description":"Number of the current page."},"perPage":{"type":"integer","description":"Number of orders per page."}}},"stats":{"title":"Stats2","required":["stats"],"type":"object","properties":{"stats":{"title":"Stats3","required":["totalValue","totalItems"],"type":"object","properties":{"totalValue":{"title":"TotalValue1","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"type":"object","properties":{"Count":{"type":"integer"},"Max":{"type":"integer"},"Mean":{"type":"integer"},"Min":{"type":"integer"},"Missing":{"type":"integer"},"StdDev":{"type":"integer"},"Sum":{"type":"integer"},"SumOfSquares":{"type":"integer"},"Facets":{"type":"object"}}},"totalItems":{"title":"TotalItems1","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"type":"object","properties":{"Count":{"type":"integer"},"Max":{"type":"integer"},"Mean":{"type":"integer"},"Min":{"type":"integer"},"Missing":{"type":"integer"},"StdDev":{"type":"integer"},"Sum":{"type":"integer"},"SumOfSquares":{"type":"integer"},"Facets":{"type":"object"}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of orders according to the filters described below. + + >⚠️ **B2B Buyer Portal** + > + > When filtering by [contact information fields](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#post-/api/dataentities/contact_information/documents), you must use the exact value of the field in the contact information. Partial matches are not supported. + + The limit of information retrieval is 30 pages, the default number of orders per page is 15 and it is possible to configure it up to 100 using the `per_page` parameter. + + Be aware that since October 3rd, 2018, this endpoint does not return the `items` property. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + > This endpoint should **not** be used for integrations. Use the [orders Feed or hook](https://developers.vtex.com/docs/guides/orders-feed) for this purpose. + + This endpoint returns only orders that already have been indexed, which takes approximately four minutes. Because of this, the data retrieved may present inconsistencies. To get live up-to-date information and [build order integrations](https://developers.vtex.com/vtex-rest-api/docs/erp-integration-set-up-order-integration) use the [orders Feed or hook](https://developers.vtex.com/docs/guides/orders-feed). + + > **Onboarding guide** + > + > Check the new [Orders onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/orders-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Orders and is organized by focusing on the developer's journey. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **List Orders** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | List Orders | + | Checkout Admin | List Orders | + | IntegrationProfile - Fulfillment Oms | List Orders | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderBy` | query | You can retrieve orders lists filtering by an `OrderField` combined with an `OrderType`. To do so, you have to concatenate them: `orderBy={{OrderField}},{{OrderType}}`. - `OrderField` values accepted: `creationDate`, `orderId`, `items`, `totalValue` and `origin`. - `OrderType` values accepted: `asc` and `desc`. | + | `page` | query | Define the number of pages you wish to retrieve, restricted to the limit of 30 pages. | + | `per_page` | query | Quantity of orders for each page, the default value is 15 and it goes up to 100 orders per page. Be aware that the limit of retrieval ofthis endpoint is 30 pages. | + | `f_hasInputInvoice` | query | Filters list to return only orders with non `null` values for the `invoiceInput` field. | + | `q` | query | This parameter filters using Fulltext and accepts the values below. Be aware that the `+` caracter is not allowed in Fulltext Search. - Order Id - Client email - Client document - Client name B2B Buyer Portal users can search for contact information fields, which includes the values below: - User email. - User first name. - User last name. - User phone number. - User document ID. - User document type. | + | `f_shippingEstimate` | query | You can filter orders by shipping estimate time in days by concatenating the desired number of days with the sufix `.days`. For example: - Next 7 days: `7.days` - Tomorrow: `1.days` - Today: `0.days` - Late: `-1.days` | + | `f_invoicedDate` | query | You can filter orders by invoiced date by concatenating the sufix `invoicedDate:` with the range date in Timestamp format. For example: - 1 Day: `invoicedDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z]` - 1 Month: `invoicedDate:[2022-01-01T02:00:00.000Z TO 2022-02-01T01:59:59.999Z]` - 1 Year: `invoicedDate:[2022-01-01T02:00:00.000Z TO 2022-01-01T01:59:59.999Z]` | + | `f_creationDate` | query | You can filter orders by creation date by concatenating the sufix `creationDate:` with the range date in Timestamp format. For example: - 1 Day: `creationDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z]` - 1 Month: `creationDate:[2022-01-01T02:00:00.000Z TO 2022-02-01T01:59:59.999Z]` - 1 Year: `creationDate:[2022-01-01T02:00:00.000Z TO 2022-01-01T01:59:59.999Z]` | + | `f_authorizedDate` | query | You can filter orders by creation date by concatenating the sufix `authorizedDate:` with the range date in Timestamp format. For example: - 1 Day: `authorizedDate:[2022-01-01T02:00:00.000Z TO 2022-01-02T01:59:59.999Z]` - 1 Month: `authorizedDate:[2022-01-01T02:00:00.000Z TO 2022-02-01T01:59:59.999Z]` - 1 Year: `authorizedDate:[2022-01-01T02:00:00.000Z TO 2022-01-01T01:59:59.999Z]` | + | `f_UtmSource` | query | You can filter orders by Urchin Tracking Module (UTM) source. | + | `f_sellerNames` | query | You can filter orders by using a seller's name. | + | `f_callCenterOperatorName` | query | You can filter orders by using a Call Center Operator's identification. | + | `f_salesChannel` | query | You can filter orders by sales channel's ([or trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) name. | + | `salesChannelId` | query | You can filter orders by sales channel's ([or trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID. | + | `f_affiliateId` | query | You can filter orders by affiliate ID. | + | `f_status` | query | You can filter orders by the following [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196): - `waiting-for-sellers-confirmation` - `payment-pending` - `payment-approved` - `ready-for-handling` - `handling` - `invoiced` - `canceled` | + | `incompleteOrders` | query | When set as `true`, you retrieve [incomplete orders](https://help.vtex.com/en/tutorial/understanding-incomplete-orders), when set as `false`, you retrieve orders that are not incomplete. | + | `f_paymentNames` | query | You can filter orders by payment type. | + | `f_RnB` | query | You can filter orders by rates and benefits (promotions). | + | `searchField` | query | You can search orders by using one of the following criterias: - SKU ID - `sku_Ids&sku_Ids` - Gift List ID - `listId&listId` - Transaction ID (TID) - `tid&tid` - PCI Connector's Transaction ID (TID) - `pci_tid&pci_tid` - Payment ID (PID) - `paymentId&paymentId` - Connector's NSU - `nsu&nsu` | + | `f_isInstore` | query | When set as `true`, this parameter filters orders made via [inStore](https://help.vtex.com/en/tracks/what-is-instore--zav76TFEZlAjnyBVL5tRc), and when set as `false`, it filters orders that were not made via inStore. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 16 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/Orders/Register modifications on order.yml b/BrunoCollections/VTEX - Orders API/Orders/Register modifications on order.yml new file mode 100644 index 0000000000..05b3962330 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Register modifications on order.yml @@ -0,0 +1,146 @@ +info: + name: Register modifications on order + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/changes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + body: + type: json + data: |- + { + "requestId": "change-request-0123", + "reason": "Stock shortage", + "discountValue": 100, + "incrementValue": 100, + "itemsRemoved": [ + { + "id": "0", + "price": 2499, + "quantity": 1 + } + ], + "itemsAdded": [ + { + "id": "0", + "price": 2499, + "quantity": 1 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/oms/pvt/orders/:orderId/changes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/changes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/changes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/changes - Schema is valid", function () { + const schema = {"type":"object","properties":{"date":{"type":"string","description":"Date of order modification."},"orderId":{"type":"string","description":"ID of the order."},"receipt":{"type":"string","description":"Receipt identification."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request allows [modifying an order](https://help.vtex.com/en/tutorial/changing-items-from-a-completed-order--tutorials_190) by: + + - Adding items to an order. + + - Removing items from an order. + + - Applying discounts to the total value of the order. + + - Incrementing the total value of the order. + + >❗ This endpoint is being deprecated in March 1st, 2026. We stopped providing support for this API since December 31st, 2025. If you wish to modify an order, you can use the [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) endpoint for an improved order modification experience. + + > **Timeout settings:** This is a synchronous API, which means the application requests data and waits until a value is returned. This behavior can cause timeout errors. To avoid them, we recommend setting the timeout in 20 seconds. + + In order modifications scenarios, it is possible to insert a [Partial invoice](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe). The total value of the order will be updated after the insertion of the invoice, even when there is a partial invoice scenario. The updated value is settled by the VTEX Payment Gateway, and the customer reimbursement is automatic. + + This action can only be done for orders in the following status: + + - `handling` + + - `waiting-for-fulfillment` + + - `ready for invoicing` + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Checkout | CheckoutResources | **Orders Full Access** | + | OMS | OMS access | **Cancel order** | + | OMS | OMS access | **Change order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Checkout Admin | Orders Full Access | + | OMS - Full access |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Oms |

Cancel order

Change order

| + | IntegrationProfile - Fulfillment Gateway | Cancel order | + | IntegrationProfile - Fulfillment Gateway Oms |

Cancel order

Change order

| + | inStore Sales Person |

Cancel order

Change order

| + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) ID that identifies the order in the seller. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "date": "2024-02-08T13:54:33.6868469+00:00", + "orderId": "v502538llux-01", + "receipt": "535d4581-a2a2-4fd2-a206-1c61eae91b1e" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Orders/Start handling order.yml b/BrunoCollections/VTEX - Orders API/Orders/Start handling order.yml new file mode 100644 index 0000000000..61395d6a6f --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/Start handling order.yml @@ -0,0 +1,69 @@ +info: + name: Start handling order + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/start-handling" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/oms/pvt/orders/:orderId/start-handling - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/oms/pvt/orders/:orderId/start-handling - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the status of an order to indicate that it is in `handling`. + + + > Expect a `status 204` response with no content in case of a successful request. The store must validate this response to retry the call if the response differs from the `204` code, making this flow the store's responsibility. This endpoint can also respond with `status 500`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Change order workflow status** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Change order workflow status | + | IntegrationProfile - Fulfillment Oms | Change order workflow status | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Orders/folder.yml b/BrunoCollections/VTEX - Orders API/Orders/folder.yml new file mode 100644 index 0000000000..0591326f3b --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: Orders + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Orders API/Payment/Retrieve payment transaction.yml b/BrunoCollections/VTEX - Orders API/Payment/Retrieve payment transaction.yml new file mode 100644 index 0000000000..4e7294f7ef --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Payment/Retrieve payment transaction.yml @@ -0,0 +1,128 @@ +info: + name: Retrieve payment transaction + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/payment-transaction" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/pvt/orders/:orderId/payment-transaction - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/payment-transaction - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/payment-transaction - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/pvt/orders/:orderId/payment-transaction - Schema is valid", function () { + const schema = {"required":["status","isActive","transactionId","merchantName","payments"],"type":"object","properties":{"status":{"type":"string","description":"Transaction status."},"isActive":{"type":"boolean","description":"If it is an active transaction (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Transaction merchant's name."},"payments":{"type":"array","items":{"title":"Payment1","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","description":"Payment value."},"installments":{"type":"integer","description":"Payment Installments quantity."},"referenceValue":{"type":"integer","description":"Payment reference Value."},"cardHolder":{"type":["string","null"],"description":"Payment card holder."},"cardNumber":{"type":["string","null"],"description":"Payment card number."},"firstDigits":{"type":"string","description":"Payment card first digits."},"lastDigits":{"type":"string","description":"Payment card last digits."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"expireMonth":{"type":["string","null"],"description":"Payment card expire month."},"expireYear":{"type":["string","null"],"description":"Payment card expire year."},"url":{"type":["string","null"],"description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift Card ID."},"giftCardName":{"type":["string","null"],"description":"Gift Card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift Card caption."},"redemptionCode":{"type":["string","null"],"description":"Code for the customer to use the Gift Card."},"group":{"type":"string","description":"It represents the payment method. For each method, it can have the following values: \n\r\n- **Credit card:** `creditCard` \r\n\r\n- **Debid card:** `debitCard`\r\n\r\n- **Bank invoice:** `bankInvoice`\r\n\r\n- **Promissory:** `promissory` \r\n\r\n- **Gift card:** `giftCard` \n\r\n- **Pix:** `instantPayment`."},"tid":{"type":"string","description":"Payment transaction ID."},"dueDate":{"type":["string","null"],"description":"Payment due date."},"connectorResponses":{"title":"ConnectorResponses","required":["Tid","ReturnCode","Message","authId"],"type":"object","properties":{"Tid":{"type":"string","description":"Connector transaction ID."},"ReturnCode":{"type":["string","null"],"description":"Connector return code."},"Message":{"type":["string","null"],"description":"Information about the connector's responses."},"authId":{"type":"string","description":"Connector authorization ID."}}}}},"description":"Payments' details object."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves transaction details by order ID. All events in the transaction will be registered in this call's response body. + + In scenarios of [order changes](https://developers.vtex.com/vtex-rest-api/reference/registerchange), it is possible to insert a [Partial invoice](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe). The total value of the order will be updated after the insertion of the invoice, even when there is a [Partial invoice](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) scenario. The updated value is settled by VTEX's Payment Gateway. The reimbursement for the shopper is automatic. + + >⚠️ At this time, this route does not support Fulfillment payment queries, only Marketplace orders. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | View order | View order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "status": "Finished", + "isActive": true, + "transactionId": "CB452D77E7D04099A4DB0479087B1D2C", + "merchantName": "LUXSTORE", + "payments": [ + { + "id": "721CBE1090324D12ABE301FE33DE775A", + "paymentSystem": "4", + "paymentSystemName": "Mastercard", + "value": 10150, + "installments": 1, + "referenceValue": 10150, + "cardHolder": null, + "cardNumber": null, + "firstDigits": "412341", + "lastDigits": "4123", + "url": null, + "giftCardId": null, + "giftCardName": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "creditCard", + "tid": "101770752", + "dueDate": null, + "connectorResponses": { + "Tid": "101770752", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "170852" + } + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Payment/Send payment notification.yml b/BrunoCollections/VTEX - Orders API/Payment/Send payment notification.yml new file mode 100644 index 0000000000..a17ac510f9 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Payment/Send payment notification.yml @@ -0,0 +1,65 @@ +info: + name: Send payment notification + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/payments/:paymentId/payment-notification" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + - name: paymentId + value: F5C1A4E20D3B4E07B7E871F5B5BC9F91 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/oms/pvt/orders/:orderId/payments/:paymentId/payment-notification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Send a payment notification of a given order, by order ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify payment** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify payment | + | IntegrationProfile - Fulfillment Oms | Notify payment | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `paymentId` | path | (Required) VTEX payment identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | diff --git a/BrunoCollections/VTEX - Orders API/Payment/folder.yml b/BrunoCollections/VTEX - Orders API/Payment/folder.yml new file mode 100644 index 0000000000..fbce1c6317 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Payment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Orders API/Tracking/Update order tracking status.yml b/BrunoCollections/VTEX - Orders API/Tracking/Update order tracking status.yml new file mode 100644 index 0000000000..13f1a6fa79 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Tracking/Update order tracking status.yml @@ -0,0 +1,122 @@ +info: + name: Update order tracking status + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber/tracking" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1172452900788-01 + type: path + - name: invoiceNumber + value: "000030711" + type: path + body: + type: json + data: |- + { + "isDelivered": false, + "deliveredDate": null, + "events": [ + { + "city": "Rio de Janeiro", + "state": "RJ", + "description": "Coletado pela transportadora", + "date": "2015-06-23" + }, + { + "city": "Sao Paulo", + "state": "SP", + "description": "A caminho de Curitiba", + "date": "2015-06-24" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber/tracking - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber/tracking - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[PUT]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber/tracking - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/oms/pvt/orders/:orderId/invoice/:invoiceNumber/tracking - Schema is valid", function () { + const schema = {"title":"UpdateTrackingStatus","required":["date","orderId","receipt"],"type":"object","properties":{"date":{"type":"string"},"orderId":{"type":"string"},"receipt":{"type":"string"}},"example":{"date":"2017-03-29T18:04:31.0521233+00:00","orderId":"v501245lspt-01","receipt":"f67d33a8029c42ce9a8f07fc17f54449"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint sends a tracking event to an order that already has a tracking number registered to its invoice. + + This request is not meant to send a tracking number and URL to the invoice. If you wish to send a tracking number and URL to an order, use the [Update order's partial invoice](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-) endpoint. For more information, see [Partial invoice](https://help.vtex.com/en/tracks/partial-invoices--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) scenarios. + + This endpoint applies to orders with any shipping type, whether delivery or [pickup](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **Notify invoice** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | Notify invoice | + | IntegrationProfile - Fulfillment Oms | Notify invoice | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `invoiceNumber` | path | (Required) Number that identifies the invoice. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "date": "2017-03-29T18:04:31.0521233+00:00", + "orderId": "v501245lspt-01", + "receipt": "f67d33a8029c42ce9a8f07fc17f54449" + } + ``` diff --git a/BrunoCollections/VTEX - Orders API/Tracking/folder.yml b/BrunoCollections/VTEX - Orders API/Tracking/folder.yml new file mode 100644 index 0000000000..a6d32a35e2 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/Tracking/folder.yml @@ -0,0 +1,4 @@ +info: + name: Tracking + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Orders API/User orders/Retrieve user order details.yml b/BrunoCollections/VTEX - Orders API/User orders/Retrieve user order details.yml new file mode 100644 index 0000000000..642d6fa3bb --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/User orders/Retrieve user order details.yml @@ -0,0 +1,139 @@ +info: + name: Retrieve user order details + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/oms/user/orders/:orderId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: clientEmail + value: customer@mail.com + type: query + disabled: true + - name: text + value: Rio de Janeiro + type: query + disabled: true + - name: status + value: ready-for-handling + type: query + disabled: true + - name: creation_date + value: "[2025-01-01T02:00:00.000Z TO 2025-04-08T23:59:59.999Z]" + type: query + disabled: true + - name: purchase_agent_id + value: 848a994a-1b6b-4dbd-5555-0455af24e0f2 + type: query + disabled: true + - name: my_pending_approvals + value: "false" + type: query + disabled: true + - name: orderId + value: 1172452900788-01 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/user/orders/:orderId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/user/orders/:orderId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/oms/user/orders/:orderId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/user/orders/:orderId - Schema is valid", function () { + const schema = {"title":"Userorderdetails","required":["orderId","sequence","marketplaceOrderId","marketplaceServicesEndpoint","sellerOrderId","origin","affiliateId","salesChannel","merchantName","status","statusDescription","value","creationDate","lastChange","orderGroup","totals","items","marketplaceItems","clientProfileData","giftRegistryData","marketingData","ratesAndBenefitsData","shippingData","paymentData","packageAttachment","sellers","callCenterOperatorData","followUpEmail","lastMessage","hostname","invoiceData","changesAttachment","openTextField","roundingError","orderFormId","commercialConditionData","isCompleted","customData","storePreferencesData","allowCancellation","allowEdition","isCheckedIn","marketplace","authorizedDate","invoicedDate","cancelReason","itemMetadata","subscriptionData","taxData","checkedInPickupPointId","cancellationData","clientPreferencesData"],"type":"object","properties":{"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"sequence":{"type":"string","description":"Sequence is a six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`."},"marketplaceOrderId":{"type":"string","description":"Marketplace order ID."},"marketplaceServicesEndpoint":{"type":"string","description":"Marketplace services endpoint."},"sellerOrderId":{"type":"string","description":"ID of the seller related to the order. It can be a VTEX seller or an external seller."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types), which can be `Marketplace`, `Fulfillment` or `Chain`."},"affiliateId":{"type":"string","description":"Corresponds to the three-digit [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order."},"merchantName":{"type":"string","description":"Name of the merchant."},"status":{"type":"string","description":"Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"statusDescription":{"type":"string","description":"`Deprecated`. Status description which is displayed on the Admin panel. This field is obsolete and may not return any value."},"value":{"type":"integer","description":"Order's total amount."},"creationDate":{"type":"string","description":"Order's creation date."},"lastChange":{"type":"string","description":"Order's last change date."},"orderGroup":{"type":"string","description":"Order's group ID."},"totals":{"type":"array","items":{"required":["id","name","value"],"type":"object","description":"Object about order's totals.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about `Items`, `Discounts`, `Shipping`, `Tax` or `Change`."},"name":{"type":"string","description":"Name of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`."},"value":{"type":"integer","description":"Total amount of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`."}}},"description":"List with details about orders' totals."},"items":{"type":"array","items":{"required":["uniqueId","id","productId","ean","lockId","itemAttachment","attachments","quantity","seller","name","refId","price","listPrice","manualPrice","priceTags","imageUrl","detailUrl","components","bundleItems","params","offerings","attachmentOfferings","sellerSku","priceValidUntil","commission","tax","preSaleDate","additionalInfo","measurementUnit","unitMultiplier","sellingPrice","isGift","shippingPrice","rewardValue","freightCommission","priceDefinitions","taxCode","parentItemIndex","parentAssemblyBinding","callCenterOperator","serialNumbers","assemblies","costPrice"],"type":"object","description":"Item details.","properties":{"uniqueId":{"type":"string","description":"Unique ID is an alphanumeric sequence that identifies an SKU in a given order."},"id":{"type":"string","description":"Item's SKU ID, which is a unique numerical identifier."},"productId":{"type":"string","description":"ID of the Product associated with the item."},"ean":{"type":["string","null"],"description":"EAN of the SKU."},"lockId":{"type":"string","description":"Reservation ID."},"itemAttachment":{"title":"ItemAttachment","description":"Information about attachments, if it applies.","required":["content","name"],"type":"object","properties":{"content":{"type":"object","description":"Attachment's custom field for content."},"name":{"type":["string","null"],"description":"Attachment's name."}}},"attachments":{"type":"array","items":{"type":"string","description":"Attachment details."},"description":"Array containing information on attachments."},"quantity":{"type":"integer","description":"Quantity of items."},"seller":{"type":"string","description":"Seller related to the order."},"name":{"type":"string","description":"Item's name."},"refId":{"type":"string","description":"Product referencial code associated with the item."},"price":{"type":"integer","description":"Item's price."},"listPrice":{"type":"integer","description":"Item's list price."},"manualPrice":{"type":["string","null"],"description":"Item's manual price."},"priceTags":{"type":"array","items":{"type":"string","description":"Price modifier."},"description":"List of objects with item's price modifiers."},"imageUrl":{"type":"string","description":"Item's SKU image URL."},"detailUrl":{"type":"string","description":"URL slug of the item."},"components":{"type":"array","items":{"type":"string","description":"A given component."},"description":"Item's components."},"bundleItems":{"type":"array","items":{"type":"string","description":"Item offering details."},"description":"This field groups offerings (services) related to the item and displays their ID and quantity. A gift package is an example of an offering."},"params":{"type":"array","items":{"type":"string","description":"Param name."},"description":"Information about params."},"offerings":{"type":"array","items":{"type":"string","description":"Name of the service related to the item. For example, guarantee or installation."},"description":"Item's offerings, which are services related to the item. For example, guarantee or installation."},"attachmentOfferings":{"type":["array","null"],"description":"List of attachments details.","items":{"type":"object","description":"Attachment details.","required":["name","required","schema"],"properties":{"name":{"type":["string","null"],"description":"Name of the attachment."},"required":{"type":["boolean","null"],"description":"If the attachment is required (`true`) or not (`false`)."},"schema":{"type":["object","null"],"description":"Schema of the content declared in the field `attachmentOfferings`."}}}},"sellerSku":{"type":"string","description":"SKU ID from the seller perspective."},"priceValidUntil":{"type":["string","null"],"description":"Date until when the price is going to be valid if there is a promotion."},"commission":{"type":"integer","description":"Commission value registered for the seller."},"tax":{"type":"integer","description":"Item's tax."},"preSaleDate":{"type":["string","null"],"description":"Item's pre sale date."},"additionalInfo":{"title":"AdditionalInfo","description":"Additional information about the item.","required":["brandName","brandId","categoriesIds","productClusterId","commercialConditionId","dimension","offeringInfo","offeringType","offeringTypeId"],"type":"object","properties":{"brandName":{"type":"string","description":"Item's brand name."},"brandId":{"type":"string","description":"Item's brand ID."},"categoriesIds":{"type":"string","description":"Item's category ID."},"productClusterId":{"type":"string","description":"All product clusters related to the item."},"commercialConditionId":{"type":"string","description":"Commercial conditions ID."},"dimension":{"type":"object","description":"Item dimensions.","required":["cubicweight","height","length","weight","width"],"properties":{"cubicweight":{"type":"number","description":"Item cubic weight."},"height":{"type":"number","description":"Item height."},"length":{"type":"number","description":"Item length."},"weight":{"type":"number","description":"Item weight."},"width":{"type":"number","description":"Item width."}}},"offeringInfo":{"type":["string","null"],"description":"Information about services related to the item. For example: guarantee or installation."},"offeringType":{"type":["string","null"],"description":"Offering type."},"offeringTypeId":{"type":["string","null"],"description":"Offering type ID."}}},"measurementUnit":{"type":"string","description":"Item's measurement unit."},"unitMultiplier":{"type":"integer","description":"Item's unit multiplier."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"isGift":{"type":"boolean","description":"This field is `true` when the item is a gift in order context and `false` when it is not."},"shippingPrice":{"type":["string","null"],"description":"Item's shipping price."},"rewardValue":{"type":"integer","description":"Item's reward value."},"freightCommission":{"type":"integer","description":"Value of the freight commission."},"priceDefinitions":{"type":"object","description":"Item's price information.","required":["sellingPrices","calculatedSellingPrice","total"],"properties":{"sellingPrices":{"type":"array","items":{"type":"object","description":"Item value and quantity.","required":["value","quantity"],"properties":{"value":{"type":"integer","description":"Total value of items in cents."},"quantity":{"type":"integer","description":"Quantity of items."}}},"description":"Details on item's selling price."},"calculatedSellingPrice":{"type":"integer","description":"Item's calculated unitary selling price in cents."},"total":{"type":"integer","description":"Total value of all item's units in cents."}}},"taxCode":{"type":["string","null"],"description":" Item's tax code."},"parentItemIndex":{"type":["string","null"],"description":"Parent item index."},"parentAssemblyBinding":{"type":["string","null"],"description":"Parent assembly binding."},"callCenterOperator":{"type":["string","null"],"description":"Call center operator responsible for the order."},"serialNumbers":{"type":["string","null"],"description":"This field identifies the order in the `handling` status in the workflow, and it was used for VTEX internal control."},"assemblies":{"type":["array","null"],"description":"Retrieves information about orders item's customizations.","items":{"type":"string","description":"Customization information."}},"costPrice":{"type":"integer","description":"Item's cost price."}}},"description":"Information about order's items."},"marketplaceItems":{"type":"array","items":{"type":"string"},"description":"Marketplace details object."},"clientProfileData":{"title":"ClientProfileData","description":"Object with information on the client's profile.","required":["id","email","firstName","lastName","documentType","document","phone","corporateName","tradeName","corporateDocument","stateInscription","corporatePhone","isCorporate","userProfileId","customerClass"],"type":"object","properties":{"id":{"type":"string","description":"Object ID, the expected value is `clientProfileData`."},"email":{"type":"string","description":"Customer's email."},"firstName":{"type":"string","description":"Customer's first name."},"lastName":{"type":"string","description":"Customer's last name."},"documentType":{"type":"string","description":"Type of the document informed by the customer."},"document":{"type":"string","description":"Document identification code informed by the customer."},"phone":{"type":"string","description":"Customers's phone number."},"corporateName":{"type":["string","null"],"description":"If the customer is a legal entity, here goes the corporate name."},"tradeName":{"type":["string","null"],"description":"If the customer is a legal entity, here goes the trade name."},"corporateDocument":{"type":["string","null"],"description":"If the customer is a legal entity, here goes the corporate document."},"stateInscription":{"type":["string","null"],"description":"If the customer is a legal entity, here goes the state inscription."},"corporatePhone":{"type":["string","null"],"description":"If the customer is a legal entity, here goes the corpany's phone number."},"isCorporate":{"type":"boolean","description":"The value is `true` when the customer is a legal entity and `false` when not."},"userProfileId":{"type":"string","description":"Customer user profile ID."},"customerClass":{"type":["string","null"],"description":"Identification of the class the customer belongs to."}}},"giftRegistryData":{"type":["string","null"],"description":"Information about gift list, when it applies."},"marketingData":{"type":"object","description":"Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs.","required":["id","utmSource","utmPartner","utmMedium","utmCampaign","coupon","utmiCampaign","utmipage","utmiPart","marketingTags"],"properties":{"id":{"type":"string","description":"Object ID which expected value is `marketingData`."},"utmSource":{"type":"string","description":"Value of the `utm_source` parameter of the URL that led to the request."},"utmPartner":{"type":"string","description":"UTM Source Parameters."},"utmMedium":{"type":"string","description":"Value of the `utm_medium` parameter of the URL that led to the request."},"utmCampaign":{"type":"string","description":"Value of the `utm_campaign` parameter of the URL that led to the request."},"coupon":{"type":"string","description":"Coupon's code information."},"utmiCampaign":{"type":"string","description":"Internal UTM value `utmi_cp`."},"utmipage":{"type":"string","description":"Internal UTM value `utmi_p`."},"utmiPart":{"type":"string","description":"Internal UTM value `utmi_pc`."},"marketingTags":{"type":"array","description":"Marketing tags information. This field can be used to register campaign data or informative tags regarding promotions.","items":{"type":"string"}}}},"ratesAndBenefitsData":{"title":"RatesAndBenefitsData","description":"Information on promotions and taxes that apply to the order.","required":["id","rateAndBenefitsIdentifiers"],"type":"object","properties":{"id":{"type":"string","description":"ID of the rate or benefit."},"rateAndBenefitsIdentifiers":{"type":"array","items":{"type":"string"},"description":"Information about order's promotions and taxes identifiers."}}},"shippingData":{"title":"ShippingData","description":"Object containing shipping data.","required":["id","address","logisticsInfo","trackingHints","selectedAddresses"],"type":"object","properties":{"id":{"type":"string","description":"Object ID, the expected value is `shippingData`."},"address":{"title":"Address","description":"Shipping address details.","required":["addressType","receiverName","addressId","versionId","entityId","postalCode","city","state","country","street","number","neighborhood","complement","reference","geoCoordinates"],"type":"object","properties":{"addressType":{"type":"string","description":"Type of address. For example, `Residential` or `Pickup`, among others."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order."},"addressId":{"type":"string","description":"Shipping address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID."},"postalCode":{"type":"string","description":"Postal code of the shipping address."},"city":{"type":"string","description":"City of the shipping address."},"state":{"type":"string","description":"State of the shipping address."},"country":{"type":"string","description":"Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3)."},"street":{"type":"string","description":"Street of the shipping address."},"number":{"type":"string","description":"Number of the building, house or apartment in the shipping address."},"neighborhood":{"type":"string","description":"Neighborhood of the shipping address."},"complement":{"type":"string","description":"Complement to the shipping address when it applies."},"reference":{"type":["string","null"],"description":"Complement to help locate the shipping address, in case of delivery."},"geoCoordinates":{"type":"array","items":{"type":"number"},"description":"Array with two numbers with geocoordinates, first longitude then latitude."}}},"logisticsInfo":{"type":"array","items":{"title":"LogisticsInfo","required":["itemIndex","selectedSla","lockTTL","price","listPrice","sellingPrice","deliveryWindow","deliveryCompany","shippingEstimate","shippingEstimateDate","slas","shipsTo","deliveryIds","deliveryChannels","deliveryChannel","pickupStoreInfo","addressId","versionId","entityId","polygonName","pickupPointId","transitTime"],"type":"object","properties":{"itemIndex":{"type":"integer","description":"Index of the item starting from 0."},"selectedSla":{"type":"string","description":"Selected shipping option."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time."},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"listPrice":{"type":"integer","description":"SKU's optional price for a specific trade policy."},"sellingPrice":{"type":"integer","description":"Item's selling price."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, if it applies to the item."},"deliveryCompany":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE) company's name."},"shippingEstimate":{"type":"string","description":"Total shipping estimate time in days. For instance, three business days is represented `3bd`."},"shippingEstimateDate":{"type":"string","description":"Shipping estimate date. It is defined only after the confirmation of the order."},"slas":{"type":"array","items":{"title":"Sla","required":["id","name","shippingEstimate","deliveryWindow","price","deliveryChannel","pickupStoreInfo","polygonName","lockTTL","pickupPointId","transitTime","pickupDistance"],"type":"object","properties":{"id":{"type":"string","description":"ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"name":{"type":"string","description":"Name of the shipping policy."},"shippingEstimate":{"type":"string","description":"Total shipping estimate time in days. For instance, three business days is represented `3bd`."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, if it applies to the item."},"price":{"type":"integer","description":"Shipping price for the item in cents. Does not account for the whole order's shipping price."},"deliveryChannel":{"type":"string","description":"If the delivery channel is `delivery` or `pickup-in-point`."},"pickupStoreInfo":{"title":"PickupStoreInfo","description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"type":"object","properties":{"additionalInfo":{"type":["string","null"],"description":"Additional information about the pickup point."},"address":{"type":["string","null"],"description":"Pickup point's address."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"isPickupStore":{"type":"boolean","description":"If this field is set `true`, it means the type of shipping is pickup, and if set as `false`, it is not."}}},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"lockTTL":{"type":"string","description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA."},"pickupPointId":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"transitTime":{"type":"string","description":"Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`."},"pickupDistance":{"type":"number","description":"Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line."}}},"description":"Information on Service Level Agreement (SLA), corresponding to [shipping policies](https://help.vtex.com/tutorial/shipping-policy--tutorials_140)."},"shipsTo":{"type":"array","items":{"type":"string","description":"Three letters ISO code."},"description":"Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3)."},"deliveryIds":{"type":"array","items":{"title":"DeliveryId","description":"Information about delivery IDs.","required":["courierId","courierName","dockId","quantity","warehouseId","accountCarrierName","kitItemDetails"],"type":"object","properties":{"courierId":{"type":"string","description":"[Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)'s ID."},"courierName":{"type":"string","description":"Carrier's name."},"dockId":{"type":"string","description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)."},"quantity":{"type":"integer","description":"Quantity of items."},"warehouseId":{"type":"string","description":"ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)."},"accountCarrierName":{"type":"string","description":"Name of the account's [carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)."},"kitItemDetails":{"type":["array","null"],"description":"Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), if there are any.","items":{"type":"string"}}}},"description":"Information about delivery IDs."},"deliveryChannels":{"type":"array","description":"List of delivery channels associated with the trade policy.","items":{"type":"object","required":["id","stockBalance"],"properties":{"id":{"type":"string","description":"Delivery channel's shipping type, which can be `delivery` or `pickup-in-point`."},"stockBalance":{"type":"integer","description":"Stock check for an SKU availability."}}}},"deliveryChannel":{"type":"string","description":"If the delivery channel is `delivery` or `pickup-in-point`."},"pickupStoreInfo":{"title":"PickupStoreInfo","description":"Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","required":["additionalInfo","address","dockId","friendlyName","isPickupStore"],"type":"object","properties":{"additionalInfo":{"type":["string","null"],"description":"Additional information about the pickup point."},"address":{"type":["string","null"],"description":"Pickup point's address."},"dockId":{"type":["string","null"],"description":"ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point."},"friendlyName":{"type":["string","null"],"description":"Name of the pickup point displayed at checkout."},"isPickupStore":{"type":"boolean","description":"If this field is set `true`, it means the type of shipping is pickup, and if set as `false`, it is not."}}},"addressId":{"type":"string","description":"Address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID."},"entityId":{"type":"string","description":"Shipping address entity ID."},"polygonName":{"type":["string","null"],"description":"Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy."},"pickupPointId":{"type":"string","description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)'s ID."},"transitTime":{"type":"string","description":"Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`."}}},"description":"Array of objects containing item's logistics information."},"trackingHints":{"type":["string","null"],"description":"List containing order shipping label information."},"selectedAddresses":{"type":"array","items":{"title":"SelectedAddress","required":["addressId","versionId","entityId","addressType","receiverName","street","number","complement","neighborhood","postalCode","city","state","country","reference","geoCoordinates"],"type":"object","properties":{"addressId":{"type":"string","description":"Selected address ID."},"versionId":{"type":["string","null"],"description":"Shipping address version ID of the selected address."},"entityId":{"type":["string","null"],"description":"Shipping address entity ID of the selected address."},"addressType":{"type":"string","description":"Selected adress's shipping type, which can be `pickup`, `residential`, `invoice`, `search`, `inStore`, `commercial` or `giftRegistry`."},"receiverName":{"type":"string","description":"Name of the person who is going to receive the order in the selected address."},"street":{"type":"string","description":"Street of the selected address."},"number":{"type":"string","description":"Number of the building, house or apartment of the selected address."},"complement":{"type":"string","description":"Complement to the selected address if it applies."},"neighborhood":{"type":"string","description":"Neighborhood of the selected address."},"postalCode":{"type":"string","description":"Postal code of the selected address."},"city":{"type":"string","description":"City of the selected address."},"state":{"type":"string","description":"State of the selected address."},"country":{"type":"string","description":"Three letters ISO code of the country of the selected address (ISO 3166 ALPHA-3)."},"reference":{"type":["string","null"],"description":"Complement to help locate the selected address."},"geoCoordinates":{"type":"array","items":{"type":"number"},"description":"Array with two numbers with the selected address's geocoordinates, first longitude then latitude."}}},"description":"Information about selected adresses."}}},"paymentData":{"title":"PaymentData","description":"Object with information about the payment.","required":["transactions"],"type":"object","properties":{"giftCards":{"type":"array","description":"Array with information about Gift Cards.","items":{"type":"string"}},"transactions":{"type":"array","items":{"title":"Transaction","description":"Financial transaction details.","required":["isActive","transactionId","merchantName","payments"],"type":"object","properties":{"isActive":{"type":"boolean","description":"When this field is set as `true`, the payment is active, and when it is `false`, the payment is inactive."},"transactionId":{"type":"string","description":"ID of the transaction."},"merchantName":{"type":"string","description":"Name of the merchant that will receive the payment."},"payments":{"type":"array","items":{"title":"Payment","description":"Payment details.","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses","giftCardProvider","giftCardAsDiscount","koinUrl","accountId","parentAccountId","bankIssuedInvoiceIdentificationNumber","bankIssuedInvoiceIdentificationNumberFormatted","bankIssuedInvoiceBarCodeNumber","bankIssuedInvoiceBarCodeType","billingAddress"],"type":"object","properties":{"id":{"type":"string","description":"VTEX payment ID that can be used as unique identifier."},"paymentSystem":{"type":"string","description":"Payment system's ID."},"paymentSystemName":{"type":"string","description":"Payment system's name."},"value":{"type":"integer","description":"Payment's final amount in cents."},"installments":{"type":"integer","description":"Number of payment installments."},"referenceValue":{"type":"integer","description":"Payment's reference value in cents."},"cardHolder":{"type":["string","null"],"description":"Name of the person who owns the card."},"cardNumber":{"type":["string","null"],"description":"Numeric sequence of the card used in the transaction."},"firstDigits":{"type":["string","null"],"description":"Fist digits of the card used in the transaction."},"lastDigits":{"type":["string","null"],"description":"Last digits of the card used in the transaction."},"cvv2":{"type":["string","null"],"description":"Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions."},"expireMonth":{"type":["string","null"],"description":"Expire month of the card used in the transaction (2-digits)."},"expireYear":{"type":["string","null"],"description":"Expire year of the card used in the transaction (4-digits)."},"url":{"type":"string","description":"Payment's URL."},"giftCardId":{"type":["string","null"],"description":"Gift Card's ID."},"giftCardName":{"type":["string","null"],"description":"Gift Card's name."},"giftCardCaption":{"type":["string","null"],"description":"Gift Card's caption."},"redemptionCode":{"type":["string","null"],"description":"Code for the customer to use the Gift Card."},"group":{"type":"string","description":"Name of the collection the Gift Card belongs to."},"tid":{"type":["string","null"],"description":"Provider's unique identifier for the transaction."},"dueDate":{"type":"string","description":"Payment due date, with the format `yyyy-mm-dd`."},"connectorResponses":{"type":"object","description":"Information about the connector responses.","required":["Tid","ReturnCode","Message","authId"],"properties":{"Tid":{"type":"string","description":"Provider's unique identifier for the transaction."},"ReturnCode":{"type":"string","description":"Provider's operation/error code to be logged."},"Message":{"type":"string","description":"Provider's operation/error message to be logged."},"authId":{"type":"string","description":"Connector's authorization ID."}}},"giftCardProvider":{"type":"string","description":"Gift Card provider's ID."},"giftCardAsDiscount":{"type":"boolean","description":"When this field is set as `true`, the Gift Card is a discount over the price, and when set as `false`, it is not a discount."},"koinUrl":{"type":"string","description":"Payment's account ID."},"accountId":{"type":"string","description":"Payment's account ID."},"parentAccountId":{"type":"string","description":"This field retrieves the main account if the payment was made in a subaccount."},"bankIssuedInvoiceIdentificationNumber":{"type":"string","description":"Numeric sequence that identifies the bank issued invoice."},"bankIssuedInvoiceIdentificationNumberFormatted":{"type":"string","description":"Bank issued invoice ID formatted."},"bankIssuedInvoiceBarCodeNumber":{"type":"string","description":"Number of the bank issued invoice bar code."},"bankIssuedInvoiceBarCodeType":{"type":"string","description":"Type of the bank issued invoice bar code."},"billingAddress":{"type":"object","description":"Billing address information."}}},"description":"Detailed information about payment."}}},"description":"Information about financial transactions."}}},"packageAttachment":{"title":"PackageAttachment","description":"Package object populated after order invoiced.","required":["packages"],"type":"object","properties":{"packages":{"type":"array","items":{"type":"string"},"description":"Packages details."}}},"sellers":{"type":"array","items":{"title":"Seller","description":"Information about the seller associated with the order.","required":["id","name","logo","fulfillmentEndpoint"],"type":"object","properties":{"id":{"type":"string","description":"Seller ID that identifies the seller."},"name":{"type":"string","description":"Seller's name."},"logo":{"type":"string","description":"URL of the seller's logo."},"fulfillmentEndpoint":{"type":"string","description":"URL of the endpoint for fulfillment of seller's orders."}}},"description":"List of all sellers associated with the order."},"callCenterOperatorData":{"type":["string","null"],"description":"Call center operator responsible for the order."},"followUpEmail":{"type":"string","description":"Email of the store's employee responsible for managing the order."},"lastMessage":{"type":["string","null"],"description":"Last sent transactional message."},"hostname":{"type":"string","description":"Account Hostname registered in License Manager."},"invoiceData":{"type":["object","null"],"description":"Information pertinent to the order's invoice."},"changesAttachment":{"title":"ChangesAttachment","description":"Information about changes in the order.","required":["id","changesData"],"type":"object","properties":{"id":{"type":"string","description":"Object ID, the expect value is `changeAttachment`."},"changesData":{"type":"array","items":{"title":"ChangesDatum","required":["reason","discountValue","incrementValue","itemsAdded","itemsRemoved","receipt"],"type":"object","properties":{"reason":{"type":"string","description":"Text explaining why there was a change in the order. This information may be shown to the customer in the UI or transactional emails."},"discountValue":{"type":"integer","description":"Order change discount value."},"incrementValue":{"type":"integer","description":"Order change increment value."},"itemsAdded":{"type":"array","items":{"type":"string"},"description":"List of items added to the order."},"itemsRemoved":{"type":"array","items":{"title":"ItemsRemoved","required":["id","name","quantity","price","unitMultiplier"],"type":"object","properties":{"id":{"type":"string","description":"SKU ID of the item removed from the order."},"name":{"type":"string","description":"Name of the item removed from the order."},"quantity":{"type":"integer","description":"Quantity of items removed from the order."},"price":{"type":"integer","description":"Total amount of items removed from the order."},"unitMultiplier":{"type":["string","null"],"description":"Unit multiplier of the item removed from the order."}}},"description":"List of items removed from the order."},"receipt":{"title":"Receipt","description":"Information about the receipt for modified orders.","required":["date","orderId","receipt"],"type":"object","properties":{"date":{"type":"string","description":"Date when the receipt was created."},"orderId":{"type":"string","description":"ID of the order."},"receipt":{"type":"string","description":"Receipt's unique identifier code."}}}}},"description":"Order change details."}}},"openTextField":{"type":["string","null"],"description":"Optional field with order's additional information. This field must be filled in using the following format: \n\r```\n\r{\r\n \"fieldExample\": \"ValueExample\"\r\n }\n\r```\n\r."},"roundingError":{"type":"integer","description":"Rounding error total amount, if it applies. For example, in orders with a discount over non-integer multiplier items, the rounding price is performed per item, not after the sum of all items. That can cause a difference in the total discount amount, which is informed in this field."},"orderFormId":{"type":"string","description":"[Order form](https://developers.vtex.com/docs/guides/orderform-fields) ID."},"commercialConditionData":{"type":["string","null"],"description":"Information about commercial conditions."},"isCompleted":{"type":"boolean","description":"When set as `true`, the order's payment has been settled, and when set as `false`, it has not been settled yet."},"customData":{"type":["string","null"],"description":"Custom information in the order. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt."},"storePreferencesData":{"title":"StorePreferencesData","description":"Object with data from the store's configuration - stored in VTEX's License Manager.","required":["countryCode","currencyCode","currencyFormatInfo","currencyLocale","currencySymbol","timeZone"],"type":"object","properties":{"countryCode":{"type":"string","description":"Three letters ISO code of the country (ISO 3166 ALPHA-3)."},"currencyCode":{"type":"string","description":"Currency code in ISO 4217. For example, `BRL`."},"currencyFormatInfo":{"title":"CurrencyFormatInfo","description":"Object with currency format details.","required":["CurrencyDecimalDigits","CurrencyDecimalSeparator","CurrencyGroupSeparator","CurrencyGroupSize","StartsWithCurrencySymbol"],"type":"object","properties":{"CurrencyDecimalDigits":{"type":"integer","description":"Quantity of currency decimal digits."},"CurrencyDecimalSeparator":{"type":"string","description":"Defines what currency decimal separator will be applied."},"CurrencyGroupSeparator":{"type":"string","description":"Defines what currency group separator will be applied."},"CurrencyGroupSize":{"type":"integer","description":"Defines how many characters will be grouped."},"StartsWithCurrencySymbol":{"type":"boolean","description":"Defines if all prices will be initiated with the currency symbol (`true`) or not (`false`)."}}},"currencyLocale":{"type":"integer","description":"Currency Locale Code in LCID in decimal."},"currencySymbol":{"type":"string","description":"Currency symbol."},"timeZone":{"type":"string","description":"Time zone from where the order was made."}}},"allowCancellation":{"type":"boolean","description":"When set as `true`, the order can be canceled, and when set as `false`, it is no longer possible to cancel the order."},"allowEdition":{"type":"boolean","description":"When set as `true`, the order can be edited, and when set as `false`, it is no longer possible to edit the order."},"isCheckedIn":{"type":"boolean","description":"This field is set `true` when the order was made via inStore and `false` when it was not."},"marketplace":{"title":"Marketplace","description":"Details about the marketplace related to the order.","required":["baseURL","isCertified","name"],"type":"object","properties":{"baseURL":{"type":"string","description":"Marketplace base URL."},"isCertified":{"type":["string","null"],"description":"If is a certified marketplace."},"name":{"type":"string","description":"Name of the marketplace."}}},"authorizedDate":{"type":"string","description":"Authorized order date."},"invoicedDate":{"type":["string","null"],"description":"Order's invoice date."},"cancelReason":{"type":["string","null"],"description":"Reason for order cancellation."},"itemMetadata":{"type":"object","description":"Metadata information about the order's items.","required":["Items"],"properties":{"Items":{"type":"array","description":"Metadata items.","items":{"type":"object","required":["Id","Seller","Name","SkuName","ProductId","RefId","Ean","ImageUrl","DetailUrl","AssemblyOptions"],"properties":{"Id":{"type":"string","description":"Item's SKU ID, which is a unique numerical identifier."},"Seller":{"type":"string","description":"Seller ID that identifies the seller the item belongs to."},"Name":{"type":"string","description":"Name of the item as displayed to customers in the storefront."},"SkuName":{"type":"string","description":"Name of the SKU corresponding to the item."},"ProductId":{"type":"string","description":"ID of the Product associated with the item."},"RefId":{"type":"string","description":"Item's reference ID."},"Ean":{"type":"string","description":"EAN of the item."},"ImageUrl":{"type":"string","description":"Item's SKU image URL."},"DetailUrl":{"type":"string","description":"URL slug of the item."},"AssemblyOptions":{"type":"array","description":"Displays information about [assembly options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) related to the item, if there are any.","items":{"required":["Id","Name","Required","InputValues","Composition"],"type":"object","properties":{"Id":{"type":"string","description":"ID of the attachment related to the order."},"Name":{"type":"string","description":"Name of the attachment related to the order."},"Required":{"type":"boolean","description":"If this field is set as `true`, when the customer purchases the item sending the attachment is required, and when set as `false`, sending the attachment is optional."},"InputValues":{"type":["object","null"],"description":"Displays the attachment's content."},"Composition":{"type":["object","null"],"description":"Displays the attachment's composition."}}}}}}}}},"subscriptionData":{"type":["object","null"],"description":"Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453).","required":["SubscriptionGroupId","Subscriptions"],"properties":{"SubscriptionGroupId":{"type":"string","description":"ID of the subscription's group. If this field returns `null` and the `executionCount` is `0`, the order is the first one with subscriptions."},"Subscriptions":{"type":["array","null"],"description":"List with subscriptions and their details.","items":{"type":"object","required":["ExecutionCount","PriceAtSubscriptionDate","ItemIndex","Plan"],"properties":{"ExecutionCount":{"type":"integer","description":"Position of the order in the subscription cycle. The first order will have the value `0`, the second will have the value `1`, and so on."},"PriceAtSubscriptionDate":{"type":"number","description":"Price of the order when the customer signed up for subscriptions. Subscriptions created from Admin UI or APIs do not have an original order, so the field returns `0.0`. This field was valid only for Subscriptions v2 and is deprecated in Subscriptions v3."},"ItemIndex":{"type":"integer","description":"Each item in the subscriptions' order is identified by an index. The position starts in`0`, followed by `1`, `2`, and so on."},"Plan":{"type":"object","description":"Information about the subscription's validility and frequency.","required":["type","frequency","validity"],"properties":{"type":{"type":"string","description":"Type of plan."},"frequency":{"type":"object","description":"Information about subscriptions' recurrence.","required":["periodicity","interval"],"properties":{"periodicity":{"type":"string","description":"Defines the subscriptions recurrence period. The possible values are `DAILY`,`WEEKLY`, `MONTHLY` and `YEARLY`."},"interval":{"type":"integer","description":"Number of the time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the field's value will correspond to days, for `MONTHLY` to months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription will be valid.","required":["begin","end"],"properties":{"begin":{"type":"string","description":"Subscriptions' beginning date with the format `yyyy-mm-ddThh:mm:ss`."},"end":{"type":"string","description":"Subscriptions' ending date with the format `yyyy-mm-ddThh:mm:ss`."}}}}}}}}}},"taxData":{"type":"object","description":"Order's tax information.","required":["areTaxesDesignatedByMarketplace","taxInfoCollection"],"properties":{"areTaxesDesignatedByMarketplace":{"type":"boolean","description":"If the taxes were designated by the marketplace (`true`) or not (`false`)."},"taxInfoCollection":{"type":"array","description":"Array with taxes' details.","items":{"type":"object","required":["itemIndex","sku","priceTags"],"properties":{"itemIndex":{"type":"integer","description":"Item's indexing number."},"sku":{"type":"string","description":"Alphanumeric sequence that identifies an SKU."},"priceTags":{"type":"array","description":"Price tag information.","items":{"type":"object","required":["isPercentual","name","rawValue"],"properties":{"isPercentual":{"type":"boolean","description":"If the tax is a percentage (`true`) or note (`false`)."},"name":{"type":"string","description":"Name that identifies the tax."},"rawValue":{"type":"string","description":"The amount that corresponds to the tax."}}}}}}}}},"checkedInPickupPointId":{"type":"string","description":"If the field `isCheckedIn` is set as `true`, the `checkedInPickupPointId` will retrieve the ID of the physical store where the order was made."},"cancellationData":{"type":"object","description":"Information about order cancellation, when it applies.","required":["RequestedByUser","RequestedBySystem","RequestedBySellerNotification","RequestedByPaymentNotification","Reason","CancellationDate"],"properties":{"RequestedByUser":{"type":"boolean","description":"If the order cancellation was requested by the costumer (`true`) or not (`false`)."},"RequestedBySystem":{"type":"boolean","description":"If the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example."},"RequestedBySellerNotification":{"type":"boolean","description":"If the order cancellation was requested by the seller (`true`) or not (`false`)."},"RequestedByPaymentNotification":{"type":"boolean","description":"If the order cancellation was requested by the payment gateway (`true`) or not (`false`)."},"Reason":{"type":"string","description":"The reason why the order was cancelled."},"CancellationDate":{"type":"string","description":"The date when the order was cancelled."}}},"clientPreferencesData":{"type":"object","description":"Information about customer's preferences.","required":["locale","optinNewsLetter"],"properties":{"locale":{"type":"string","description":"Customer's prefered language while accessing the store."},"optinNewsLetter":{"type":"boolean","description":"When set as `true`, this field indicates customers opted to receive the newsletters, and when set as `false`, it means they did not."}}}},"example":{"orderId":"v502556llux-01","sequence":"502556","marketplaceOrderId":"","marketplaceServicesEndpoint":"http://oms.vtexinternal.com.br/api/oms?an=luxstore","sellerOrderId":"00-v502556llux-01","origin":"Marketplace","affiliateId":"","salesChannel":"1","merchantName":"luxstore","status":"handling","statusDescription":"Preparando Entrega","value":1160,"creationDate":"2019-01-28T20:09:43.899958+00:00","lastChange":"2019-02-06T20:46:11.7010747+00:00","orderGroup":"v502556lspt","totals":[{"id":"Items","name":"Total dos Itens","value":3290},{"id":"Discounts","name":"Total dos Descontos","value":0},{"id":"Shipping","name":"Total do Frete","value":1160},{"id":"Tax","name":"Total da Taxa","value":0},{"id":"Change","name":"Total das mudanças","value":-3290}],"items":[{"uniqueId":"87F0945396994B349158C7D9C9941442","id":"1234568358","productId":"9429485","ean":null,"lockId":"00-v502556llux-01","itemAttachment":{"content":{},"name":null},"attachments":[],"quantity":1,"seller":"1","name":"Bay Max L","refId":"BIGHEROBML","price":3290,"listPrice":3290,"manualPrice":null,"priceTags":[],"imageUrl":"http://luxstore.vteximg.com.br/arquivos/ids/159263-55-55/image-cc1aed75cbfa424a85a94900be3eacec.jpg?v=636795432619830000","detailUrl":"/bay-max-9429485/p","components":[],"bundleItems":[],"params":[],"offerings":[],"attachmentOfferings":[{"name":"vtex.subscription.weekly","required":false,"schema":{"vtex.subscription.key.frequency":{"MaximumNumberOfCharacters":7,"Domain":[" 1 week"," 2 week"," 3 week"," 4 week"]}}}],"sellerSku":"1234568358","priceValidUntil":null,"commission":0,"tax":0,"preSaleDate":null,"additionalInfo":{"brandName":"VTEX","brandId":"2000023","categoriesIds":"/1/","productClusterId":"135,142","commercialConditionId":"5","dimension":{"cubicweight":0.7031,"height":15,"length":15,"weight":15,"width":15},"offeringInfo":null,"offeringType":null,"offeringTypeId":null},"measurementUnit":"un","unitMultiplier":1,"sellingPrice":3290,"isGift":false,"shippingPrice":null,"rewardValue":0,"freightCommission":0,"priceDefinitions":{"sellingPrices":[{"value":99,"quantity":1}],"calculatedSellingPrice":99,"total":99},"taxCode":null,"parentItemIndex":null,"parentAssemblyBinding":null,"callCenterOperator":"callCenterOp5473869","serialNumbers":"3","assemblies":[],"costPrice":52}],"marketplaceItems":[],"clientProfileData":{"id":"clientProfileData","email":"rodrigo.cunha@vtex.com.br","firstName":"Rodrigo","lastName":"Cunha","documentType":"cpf","document":"11047867702","phone":"+5521972321094","corporateName":null,"tradeName":null,"corporateDocument":null,"stateInscription":null,"corporatePhone":null,"isCorporate":false,"userProfileId":"5a3692de-358a-4bea-8885-044bce33bb93","customerClass":null},"giftRegistryData":null,"marketingData":{"id":"marketingData","utmSource":"fb","utmPartner":"utm partner","utmMedium":"utm medium","utmCampaign":"christmas","coupon":"sale","utmiCampaign":" ","utmipage":" ","utmiPart":" ","marketingTags":["vtex-subscription"]},"ratesAndBenefitsData":{"id":"ratesAndBenefitsData","rateAndBenefitsIdentifiers":[]},"shippingData":{"id":"shippingData","address":{"addressType":"residential","receiverName":"Rodrigo Cunha","addressId":"-1425945657910","versionId":"e9c3bec2-125d-4b96-a021-316c3aa9f14f","entityId":"eabfb564-99d6-40d8-bd6c-bddbd4990aad","postalCode":"22250-040","city":"Rio de Janeiro","state":"RJ","country":"BRA","street":"Praia de Botafogo","number":"518","neighborhood":"Botafogo","complement":"10","reference":null,"geoCoordinates":[]},"logisticsInfo":[{"itemIndex":0,"selectedSla":"Normal","lockTTL":"10d","price":1160,"listPrice":1160,"sellingPrice":1160,"deliveryWindow":null,"deliveryCompany":"Todos os CEPS","shippingEstimate":"5bd","shippingEstimateDate":"2019-02-04T20:33:46.4595004+00:00","slas":[{"id":"Normal","name":"Normal","shippingEstimate":"5bd","deliveryWindow":null,"price":1160,"deliveryChannel":"delivery","pickupStoreInfo":{"additionalInfo":null,"address":null,"dockId":null,"friendlyName":null,"isPickupStore":false},"polygonName":"region13","lockTTL":"12d","pickupPointId":"1_VTEX-RJ","transitTime":"0d","pickupDistance":29.861602783203125},{"id":"Expressa","name":"Expressa","shippingEstimate":"5bd","deliveryWindow":null,"price":1160,"deliveryChannel":"delivery","pickupStoreInfo":{"additionalInfo":null,"address":null,"dockId":null,"friendlyName":null,"isPickupStore":false},"polygonName":"region13","lockTTL":"12d","pickupPointId":"1_VTEX-RJ","transitTime":"0d","pickupDistance":29.861602783203125},{"id":"Quebra Kit","name":"Quebra Kit","shippingEstimate":"2bd","deliveryWindow":null,"price":1392,"deliveryChannel":"delivery","pickupStoreInfo":{"additionalInfo":null,"address":null,"dockId":null,"friendlyName":null,"isPickupStore":false},"polygonName":"region13","lockTTL":"12d","pickupPointId":"1_VTEX-RJ","transitTime":"0d","pickupDistance":29.861602783203125},{"id":"Sob Encomenda","name":"Sob Encomenda","shippingEstimate":"32bd","deliveryWindow":null,"price":1392,"deliveryChannel":"delivery","pickupStoreInfo":{"additionalInfo":null,"address":null,"dockId":null,"friendlyName":null,"isPickupStore":false},"polygonName":"region13","lockTTL":"12d","pickupPointId":"1_VTEX-RJ","transitTime":"0d","pickupDistance":29.861602783203125}],"shipsTo":["BRA"],"deliveryIds":[{"courierId":"197a56f","courierName":"Todos os CEPS","dockId":"1","quantity":1,"warehouseId":"1_1","accountCarrierName":"recorrenciaqa","kitItemDetails":[]}],"deliveryChannels":[{"id":"delivery","stockBalance":0}],"deliveryChannel":"delivery","pickupStoreInfo":{"additionalInfo":null,"address":null,"dockId":null,"friendlyName":null,"isPickupStore":false},"addressId":"-1425945657910","versionId":"e9c3bec2-125d-4b96-a021-316c3aa9f14f","entityId":"eabfb564-99d6-40d8-bd6c-bddbd4990aad","polygonName":"region56","pickupPointId":"1_VTEX-RJ","transitTime":"3d"}],"trackingHints":null,"selectedAddresses":[{"addressId":"-1425945657910","versionId":"e9c3bec2-125d-4b96-a021-316c3aa9f14f","entityId":"eabfb564-99d6-40d8-bd6c-bddbd4990aad","addressType":"residential","receiverName":"Rodrigo Cunha","street":"Praia de Botafogo","number":"518","complement":"10","neighborhood":"Botafogo","postalCode":"22250-040","city":"Rio de Janeiro","state":"RJ","country":"BRA","reference":null,"geoCoordinates":[]}]},"paymentData":{"transactions":[{"isActive":true,"transactionId":"418213DE29634837A63DD693A937A696","merchantName":"luxstore","payments":[{"id":"D3DEECAB3C6C4B9EAF8EF4C1FE062FF3","paymentSystem":"6","paymentSystemName":"Boleto Bancário","value":4450,"installments":1,"referenceValue":4450,"cardHolder":null,"cardNumber":null,"firstDigits":null,"lastDigits":null,"cvv2":null,"expireMonth":null,"expireYear":null,"url":"https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}","giftCardId":null,"giftCardName":null,"giftCardCaption":null,"redemptionCode":null,"group":"bankInvoice","tid":null,"dueDate":"2019-02-02","connectorResponses":{"Tid":"94857956","ReturnCode":"200","Message":"logMessage","authId":"857956"},"giftCardProvider":"presentCard","giftCardAsDiscount":false,"koinUrl":"koinURL","accountId":"5BC5C6B417FE432AB971B1D399F190C9","parentAccountId":"5BC5C6B417FE432AB971B1D399F190C9","bankIssuedInvoiceIdentificationNumber":"23797770100000019003099260100022107500729050","bankIssuedInvoiceIdentificationNumberFormatted":"32534.95739 75945.24534 54395.734214 5","bankIssuedInvoiceBarCodeNumber":"325349573975945245345439573421443986734065","bankIssuedInvoiceBarCodeType":"i25","billingAddress":{}}]}]},"packageAttachment":{"packages":[]},"sellers":[{"id":"1","name":"Lux Store","logo":"https://sellersLogo/images.png","fulfillmentEndpoint":"http://fulfillment.vtexcommerce.com.br/api/fulfillment?an=accountName"}],"callCenterOperatorData":null,"followUpEmail":"7bf3a59bbc56402c810bda9521ba449e@ct.vtex.com.br","lastMessage":null,"hostname":"luxstore","invoiceData":null,"changesAttachment":{"id":"changeAttachment","changesData":[{"reason":"Blah","discountValue":3290,"incrementValue":0,"itemsAdded":[],"itemsRemoved":[{"id":"1234568358","name":"Bay Max L","quantity":1,"price":3290,"unitMultiplier":null}],"receipt":{"date":"2019-02-06T20:46:04.4003606+00:00","orderId":"v502556llux-01","receipt":"029f9ab8-751a-4b1e-bf81-7dd25d14b49b"}}]},"openTextField":null,"roundingError":0,"orderFormId":"caae7471333e403f959fa5fd66951340","commercialConditionData":null,"isCompleted":true,"customData":null,"storePreferencesData":{"countryCode":"BRA","currencyCode":"BRL","currencyFormatInfo":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":",","CurrencyGroupSeparator":".","CurrencyGroupSize":3,"StartsWithCurrencySymbol":true},"currencyLocale":1046,"currencySymbol":"R$","timeZone":"E. South America Standard Time"},"allowCancellation":true,"allowEdition":false,"isCheckedIn":false,"marketplace":{"baseURL":"http://oms.vtexinternal.com.br/api/oms?an=luxstore","isCertified":null,"name":"luxstore"},"authorizedDate":"2019-01-28T20:33:04+00:00","invoicedDate":null,"cancelReason":"The size was too big.","itemMetadata":{"Items":[{"Id":"18","Seller":"1","Name":"Cat food","SkuName":"Cat food","ProductId":"6","RefId":"105","Ean":"43673557","ImageUrl":"http://store.vteximg.com.br/ids/155392-55-55/AlconKOI.jpg?v=635918402228600000","DetailUrl":"/catfood/p","AssemblyOptions":[{"Id":"vtex.subscription.plan-ana","Name":"vtex.subscription.plan-ana","Required":false,"InputValues":{"vtex.subscription.key.frequency":{"MaximumNumberOfCharacters":8,"Domain":["4 month","1 month"]}},"Composition":{}}]}]},"subscriptionData":{"SubscriptionGroupId":"A64AC73C0FB8693A7ADB4AC69CA4FD5F","Subscriptions":[{"ExecutionCount":724,"PriceAtSubscriptionDate":100,"ItemIndex":0,"Plan":{"type":"RECURRING_PAYMENT","frequency":{"periodicity":"DAILY","interval":1},"validity":{"begin":"2022-01-10T00:00:00.0000000+00:00","end":"2024-02-03T00:00:00.0000000+00:00"}}}]},"taxData":{"areTaxesDesignatedByMarketplace":true,"taxInfoCollection":[{"itemIndex":0,"sku":"COLOCAR_O_SKUID","priceTags":[{"isPercentual":false,"name":"Taxes (Magazine Luisa)","rawValue":"COLOCAR_O_VALOR_SEM_DECIMAL"}]}]},"checkedInPickupPointId":"storeNameExample_901","cancellationData":{"RequestedByUser":true,"RequestedBySystem":false,"RequestedBySellerNotification":false,"RequestedByPaymentNotification":false,"Reason":"Item was too big in the client.","CancellationDate":"2022-10--05T15:40:33"},"clientPreferencesData":{"locale":"en-US","optinNewsLetter":false}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all details from an order, through the perspective of the customer who placed the order. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + ## B2B Buyer Portal orders + + You can use this endpoint to list orders by filtering with the following fields: + + - Text: texts in existing order fields, [custom fields](https://developers.vtex.com/docs/guides/custom-fields-integration), and [contact information fields](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#post-/api/dataentities/contact_information/documents). + + - Status: the current status of the orders you wish to list. + + - Creation date: the date the order was created. + + - The purchase agent ID: ID of the purchase agent that made the order. + + - Pending approval: You can also filter by orders which are pending approval (`true`) or orders which are not pending approval (`false`). + + >⚠️ When using the `text` field to filter by contact information, you must use the exact value of the field in the contact information. Partial matches are not supported. For example: If the user's first name is set to `John Henry`, you must write `John Henry` in the `text` field. Searching for `John` will return orders made by `John`, and not `John Henry`. + + > Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | View My Contract Orders | My Account / OMS | **ViewMyContractOrders** | + | View My Org Unit Orders | My Account / OMS | **ViewMyOrgUnitOrders** | + | OMS | OMS access | **View order** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Call center operator | View order | + | OMS - Read only | View order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID is a unique code that identifies an order. | + | `clientEmail` | query | Customer email. This field is exclusive for B2C users. | + | `text` | query | Filter by text in existing order fields, custom fields, and contact information fields. This field is exclusive for B2B Buyer Portal users. | + | `status` | query | Order status. You can provide multiple values by repeating the query parameter. For example: - `status=payment-pending&status=handling` This field is exclusive for B2B Buyer Portal users. | + | `creation_date` | query | You can filter orders by creation date by concatenating the sufix `creationDate` with the range date in Timestamp format. This field accepts the value `*` for open ranges. For example: - `creationDate:[* TO 2025-04-08T23:59:59.999Z]` - `creationDate:[2025-01-01T02:00:00.000Z TO *]` This field is exclusive for B2B Buyer Portal users. | + | `purchase_agent_id` | query | ID of the purchase agent. You can provide multiple values by repeating the query parameter. For example: - `purchase_agent_id=848a994a-1b6b-4dbd-5555-0455af24e0f2&purchase_agent_id=848a994a-1b6b-4444-8498-0455af24e0f2` This field is exclusive for B2B Buyer Portal users. | + | `my_pending_approvals` | query | You can filter orders that are pending approval by the current user or by an organizational unit associated with the current user if it has `ViewMyOrgUnitOrders` permission. This field is exclusive for B2B Buyer Portal users. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 15 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/User orders/Retrieve user's orders.yml b/BrunoCollections/VTEX - Orders API/User orders/Retrieve user's orders.yml new file mode 100644 index 0000000000..6606f84bc9 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/User orders/Retrieve user's orders.yml @@ -0,0 +1,149 @@ +info: + name: Retrieve user's orders + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/oms/user/orders" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: clientEmail + value: customer@mail.com + type: query + disabled: true + - name: page + value: "15" + type: query + disabled: true + - name: per_page + value: "15" + type: query + disabled: true + - name: text + value: PO24893 + type: query + disabled: true + - name: status + value: ready-for-handling + type: query + disabled: true + - name: creation_date + value: "[2025-01-01T02:00:00.000Z TO 2025-04-08T23:59:59.999Z]" + type: query + disabled: true + - name: purchase_agent_id + value: 848a994a-1b6b-4dbd-5555-0455af24e0f2 + type: query + disabled: true + - name: my_pending_approvals + value: "false" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/oms/user/orders - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/oms/user/orders - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/oms/user/orders - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/oms/user/orders - Schema is valid", function () { + const schema = {"title":"Userorderslist","required":["list","facets","paging","stats"],"type":"object","description":"Order list object.","properties":{"list":{"type":"array","items":{"title":"List1","required":["orderId","creationDate","clientName","items","totalValue","paymentNames","status","statusDescription","marketPlaceOrderId","sequence","salesChannel","affiliateId","origin","workflowInErrorState","workflowInRetry","lastMessageUnread","ShippingEstimatedDate","ShippingEstimatedDateMax","ShippingEstimatedDateMin","orderIsComplete","listId","listType","authorizedDate","callCenterOperatorName","totalItems","currencyCode"],"type":"object","properties":{"orderId":{"type":"string","description":"Order ID is a unique code that identifies an order."},"creationDate":{"type":"string","description":"Order's creation date."},"clientName":{"type":"string","description":"Order's customer name."},"items":{"type":["array","null"],"items":{"title":"Item2","required":["seller","quantity","description","ean","refId","id","productId","sellingPrice","price"],"type":"object","properties":{"seller":{"type":"string","description":"Seller related to the order."},"quantity":{"type":"integer","description":"Quantity of SKUs."},"description":{"type":"string","description":"Description of items."},"ean":{"type":["string","null"],"description":"EAN of the SKU."},"refId":{"type":["string","null"],"description":"Item's reference ID."},"id":{"type":"string","description":"Item's SKU ID, which is a unique numerical identifier."},"productId":{"type":"string","description":"ID of the Product associated with the item."},"sellingPrice":{"type":"integer","description":"Details on item's selling price."},"price":{"type":"integer","description":"Item's price."}}},"description":"Information about order's items."},"totalValue":{"type":"integer","description":"Total value amount."},"paymentNames":{"type":["string","null"],"description":"Payment system name."},"status":{"type":"string","description":"Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"statusDescription":{"type":"string","description":"Status description which is displayed on the Admin panel. This field is deprecated and may not return any value."},"marketPlaceOrderId":{"type":["string","null"],"description":"Marketplace order ID."},"sequence":{"type":"string","description":"Six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`."},"salesChannel":{"type":"string","description":"Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order."},"affiliateId":{"type":"string","description":"Corresponds to the three-digits [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order."},"origin":{"type":"string","description":"Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types), which can be `Marketplace`, `Fulfillment` or `Chain`."},"workflowInErrorState":{"type":"boolean","description":"If there is a work flow error (`true`) or not (`false`)."},"workflowInRetry":{"type":"boolean","description":"If the order is in a work flow retry (`true`) or not (`false`)."},"lastMessageUnread":{"type":["string","null"],"description":"Last sent transactional message."},"ShippingEstimatedDate":{"type":["string","null"],"description":"Estimate shipping date."},"ShippingEstimatedDateMax":{"type":["string","null"],"description":"The most extended shipping estimation possible."},"ShippingEstimatedDateMin":{"type":["string","null"],"description":"The least extended shipping estimation possible."},"orderIsComplete":{"type":"boolean","description":"If it is a completed order (`true`) or not (`false`). For more information, see [Order flow and status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"listId":{"type":["string","null"],"description":"Related Gift List ID."},"listType":{"type":["string","null"],"description":"Related Gift list type."},"authorizedDate":{"type":["string","null"],"description":"Authorized order date."},"callCenterOperatorName":{"type":["string","null"],"description":"Call center operator responsible for the order."},"totalItems":{"type":"integer","description":"Order's total amount of items."},"currencyCode":{"type":["string","null"],"description":"Currency code in ISO 4217. For example, `BRL`."}}},"description":"List with user's orders details."},"facets":{"type":"array","items":{"type":"string"},"description":"Array containing facets information."},"paging":{"type":"object","description":"Pagination information.","required":["total","pages","currentPage","perPage"],"properties":{"total":{"type":"integer","description":"Total number of orders."},"pages":{"type":"integer","description":"Total number of pages."},"currentPage":{"type":"integer","description":"Number of the current page."},"perPage":{"type":"integer","description":"Number of orders per page."}}},"stats":{"title":"Stats2","required":["stats"],"type":"object","properties":{"stats":{"title":"Stats3","required":["totalValue","totalItems"],"type":"object","properties":{"totalValue":{"title":"TotalValue1","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"type":"object","properties":{"Count":{"type":"integer"},"Max":{"type":"integer"},"Mean":{"type":"integer"},"Min":{"type":"integer"},"Missing":{"type":"integer"},"StdDev":{"type":"integer"},"Sum":{"type":"integer"},"SumOfSquares":{"type":"integer"},"Facets":{"type":"object"}}},"totalItems":{"title":"TotalItems1","required":["Count","Max","Mean","Min","Missing","StdDev","Sum","SumOfSquares","Facets"],"type":"object","properties":{"Count":{"type":"integer"},"Max":{"type":"integer"},"Mean":{"type":"integer"},"Min":{"type":"integer"},"Missing":{"type":"integer"},"StdDev":{"type":"integer"},"Sum":{"type":"integer"},"SumOfSquares":{"type":"integer"},"Facets":{"type":"object"}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all orders. + + > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + + ## B2C orders + + You can use this endpoint to list all orders from a given customer, filtering by their email. + + ## B2B Buyer Portal orders + + You can use this endpoint to list orders by filtering with the following fields: + + - Text: texts in existing order fields, [custom fields](https://developers.vtex.com/docs/guides/custom-fields-integration), and [contact information fields](https://developers.vtex.com/docs/api-reference/b2b-contact-information-api#post-/api/dataentities/contact_information/documents). + + - Status: the current status of the orders you wish to list. + + - Creation date: the date the order was created. + + - The purchase agent ID: ID of the purchase agent that made the order. + + - Pending approval: You can also filter by orders which are pending approval (`true`) or orders which are not pending approval (`false`). + + >⚠️ When using the `text` field to filter by contact information, you must use the exact value of the field in the contact information. Partial matches are not supported. For example: If the user's first name is set to `John Henry`, you must write `John Henry` in the `text` field. Searching for `John` will return orders made by `John`, and not `John Henry`. + + > Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | View My Contract Orders | My Account / OMS | **ViewMyContractOrders** | + | View My Org Unit Orders | My Account / OMS | **ViewMyOrgUnitOrders** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Call center operator | View order | + | OMS - Read only | View order | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `clientEmail` | query | Customer email. This field is exclusive for B2C users. | + | `page` | query | Page number for result pagination. | + | `per_page` | query | Page quantity for result pagination. | + | `text` | query | Filter by text in existing order fields, custom fields, and contact information fields. This field is exclusive for B2B Buyer Portal users. | + | `status` | query | Order status. You can provide multiple values by repeating the query parameter. For example: - `status=payment-pending&status=handling` This field is exclusive for B2B Buyer Portal users. | + | `creation_date` | query | You can filter orders by creation date by concatenating the sufix `creationDate` with the range date in Timestamp format. This field accepts the value `*` for open ranges. For example: - `creationDate:[* TO 2025-04-08T23:59:59.999Z]` - `creationDate:[2025-01-01T02:00:00.000Z TO *]` This field is exclusive for B2B Buyer Portal users. | + | `purchase_agent_id` | query | ID of the purchase agent. You can provide multiple values by repeating the query parameter. For example: - `purchase_agent_id=848a994a-1b6b-4dbd-5555-0455af24e0f2&purchase_agent_id=848a994a-1b6b-4444-8498-0455af24e0f2` This field is exclusive for B2B Buyer Portal users. | + | `my_pending_approvals` | query | You can filter orders that are pending approval by the current user or by an organizational unit associated with the current user if it has `ViewMyOrgUnitOrders` permission. This field is exclusive for B2B Buyer Portal users. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Orders API/User orders/folder.yml b/BrunoCollections/VTEX - Orders API/User orders/folder.yml new file mode 100644 index 0000000000..8e035b7211 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/User orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: User orders + type: folder + seq: 10 diff --git a/BrunoCollections/VTEX - Orders API/environments/VTEX.yml b/BrunoCollections/VTEX - Orders API/environments/VTEX.yml new file mode 100644 index 0000000000..7757712586 --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/environments/VTEX.yml @@ -0,0 +1,12 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - name: maxLot + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Orders API/opencollection.yml b/BrunoCollections/VTEX - Orders API/opencollection.yml new file mode 100644 index 0000000000..764d3ed77a --- /dev/null +++ b/BrunoCollections/VTEX - Orders API/opencollection.yml @@ -0,0 +1,106 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Orders API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Each purchase a customer makes in your store generates an [order](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) on VTEX. With the Orders API, you can view orders statuses and manage multiple aspects involved in order fulfillment, such as financial transactions, invoicing, shipping, and subscriptions. You can also [modify orders](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) and make configurations to allow or forbid marketplaces and sellers to change or cancel orders. + + ## Order integration + + To automate actions related to order processing, you can [integrate orders](https://developers.vtex.com/docs/guides/erp-integration-guide) with systems like ERP (Enterprise Resource Planning) and WMS (Warehouse Management System) using [Feed and Hook](https://developers.vtex.com/docs/guides/orders-feed). + + ## Orders API Index + + ### Orders + + - `GET` [Get order](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders/-orderId-) + - `GET` [Get orders by order group ID](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders/order-group/-orderGroup-) + - `GET` [List orders](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders) + - `POST` [Start handling order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/start-handling) + - `POST` [Cancel order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/cancel) + - `POST` [Register modifications on order](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/changes) + + ### Order modifications + + - `PATCH` [Create order modifications](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) + - `POST` [Preview order modifications](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/order-system/orders/-changeOrderId-/changes/preview) + - `GET`[Get order modifications details](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes/-changeRequestId-) + - `GET`[Get order modifications history](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/-changeOrderId-/changes) + - `GET` [Get order modifications summary](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/orders/pvt/document/-changeOrderId-/change-summary) + - `POST` [Retry order modifications](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/order-system/orders/-changeOrderId-/changes/-changeRequestId-/retry) + - `POST`[Cancel order modifications](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/order-system/orders/-changeOrderId-/changes/-changeRequestId-/cancel) + - `PUT`[Update Order modifications settings](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/order-system/orders/changes/settings) + - `GET` [Get Order modifications settings](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/order-system/orders/changes/settings) + + ### Invoice + + - `POST` [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/invoice) + - `PATCH` [Update order's partial invoice (send tracking number)](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-) + + ### Tracking + + - `PUT` [Update order tracking status](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-/tracking) + + ### Conversation + + - `GET` [Retrieve order conversation](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders/-orderId-/conversation-message) + + ### Payment + + - `GET` [Retrieve payment transaction](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/orders/-orderId-/payment-transaction) + - `POST` [Send payment notification](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/payments/-paymentId-/payment-notification) + + ### Feed v2 (deprecated) + + - `GET` [Get feed order status](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/pvt/feed/orders/status) + + ### Feed v3 + + - `GET` [Get feed configuration](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/orders/feed/config) + - `POST` [Create or update feed configuration](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/feed/config) + - `DELETE` [Delete feed configuration](https://developers.vtex.com/docs/api-reference/orders-api#delete-/api/orders/feed/config) + - `GET` [Retrieve feed items](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/orders/feed) + - `POST` [Commit feed items](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/feed) + - `POST` [Test JSONata expression](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/expressions/jsonata) + + ### Order hook + + - `GET` [Get hook configuration](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/orders/hook/config) + - `POST` [Create or update hook configuration](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/hook/config) + - `DELETE` [Delete hook configuration](https://developers.vtex.com/docs/api-reference/orders-api#delete-/api/orders/hook/config) + + ### User orders + + - `GET` [Retrieve user's orders](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/user/orders) + - `GET` [Retrieve user order details](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/oms/user/orders/-orderId-) + + ### Change seller + + - `GET` [Get window to change seller](https://developers.vtex.com/docs/api-reference/orders-api#get-/api/checkout/pvt/configuration/window-to-change-seller) + - `POST` [Update window to change seller](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/checkout/pvt/configuration/window-to-change-seller) + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Create organization unit scope.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Create organization unit scope.yml new file mode 100644 index 0000000000..8a84034f67 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Create organization unit scope.yml @@ -0,0 +1,108 @@ +info: + name: Create organization unit scope + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes/:scope" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + - name: scope + value: contractIds + type: path + body: + type: json + data: |- + { + "ids": [ + "contract-123", + "contract-456" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Schema is valid", function () { + const schema = {"type":"object","description":"Response for scope creation, update, or removal operations.","properties":{"organizationUnitId":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"scope":{"type":"string","description":"Scope type identifier."},"ids":{"type":"array","description":"Current list of values for this scope after the operation.","items":{"type":"string","description":"Scope value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new scope with specified values for an organization unit. If the scope already exists, this operation will fail. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `scope` | path | (Required) Name of the scope category for which data should be retrieved. Supported values are: `contractIds`, `creditCards`, `installmentOptions`, `collectionIds`, `priceTables`, `paymentSystemIds`, `addresses`, `customFields`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "organizationUnitId": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "scope": "contractIds", + "ids": [ + "contract-123", + "contract-456" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Delete all scopes from organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Delete all scopes from organization unit.yml new file mode 100644 index 0000000000..8ba09d398d --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Delete all scopes from organization unit.yml @@ -0,0 +1,96 @@ +info: + name: Delete all scopes from organization unit + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all scopes from an organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T16:00:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Delete organization unit scope.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Delete organization unit scope.yml new file mode 100644 index 0000000000..9954e79e3e --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Delete organization unit scope.yml @@ -0,0 +1,96 @@ +info: + name: Delete organization unit scope + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes/:scope" + headers: + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + - name: scope + value: contractIds + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific scope from an organization unit, removing all associated values. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `scope` | path | (Required) Name of the scope category for which data should be retrieved. Supported values are: `contractIds`, `creditCards`, `installmentOptions`, `collectionIds`, `priceTables`, `paymentSystemIds`, `addresses`, `customFields`. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T16:30:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Get organization unit scopes.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Get organization unit scopes.yml new file mode 100644 index 0000000000..e481922d07 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Get organization unit scopes.yml @@ -0,0 +1,98 @@ +info: + name: Get organization unit scopes + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/scopes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/scopes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/scopes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/scopes - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing the scopes of the organization unit.","properties":{"organizationUnitId":{"type":"string","description":"ID of the organization unit."},"scopes":{"type":"array","description":"List of scope objects assigned to the unit.","items":{"type":"object","description":"Scope object.","properties":{"scope":{"type":"string","description":"Type of the scope.","enum":["contractIds","creditCards","installmentOptions","collectionIds","priceTables","paymentSystemIds","addresses","customFields"]},"ids":{"type":"array","description":"List of IDs associated with the scope.","items":{"type":"string","description":"ID of the scope value."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all scopes defined for a specific organization unit. Scopes represent domain-specific attributes such as contract IDs, collection IDs, or addresses. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "organizationUnitId": "92264b68-74da-4fc4-b51a-9ddcb8baf29a", + "scopes": [ + { + "scope": "creditCards", + "ids": [ + "21770434-1061-4ac5-bb4c-fce528aefbd1" + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Remove values from organization unit scope.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Remove values from organization unit scope.yml new file mode 100644 index 0000000000..10166a9326 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Remove values from organization unit scope.yml @@ -0,0 +1,107 @@ +info: + name: Remove values from organization unit scope + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes/:scope/remove" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + - name: scope + value: contractIds + type: path + body: + type: json + data: |- + { + "ids": [ + "contract-123", + "contract-456" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope/remove - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope/remove - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope/remove - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId/scopes/:scope/remove - Schema is valid", function () { + const schema = {"type":"object","description":"Response for scope creation, update, or removal operations.","properties":{"organizationUnitId":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"scope":{"type":"string","description":"Scope type identifier."},"ids":{"type":"array","description":"Current list of values for this scope after the operation.","items":{"type":"string","description":"Scope value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes specific values from an organization unit scope without deleting the entire scope. If all values are removed, the scope remains but with an empty set of values. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `scope` | path | (Required) Name of the scope category for which data should be retrieved. Supported values are: `contractIds`, `creditCards`, `installmentOptions`, `collectionIds`, `priceTables`, `paymentSystemIds`, `addresses`, `customFields`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "organizationUnitId": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "scope": "contractIds", + "ids": [ + "contract-456" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/Update organization unit scope.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/Update organization unit scope.yml new file mode 100644 index 0000000000..075ec88cb3 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/Update organization unit scope.yml @@ -0,0 +1,108 @@ +info: + name: Update organization unit scope + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/scopes/:scope" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + - name: scope + value: contractIds + type: path + body: + type: json + data: |- + { + "ids": [ + "contract-123", + "contract-456" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/scopes/:scope - Schema is valid", function () { + const schema = {"type":"object","description":"Response for scope creation, update, or removal operations.","properties":{"organizationUnitId":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"scope":{"type":"string","description":"Scope type identifier."},"ids":{"type":"array","description":"Current list of values for this scope after the operation.","items":{"type":"string","description":"Scope value."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing scope by replacing all its values with the provided set. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `scope` | path | (Required) Name of the scope category for which data should be retrieved. Supported values are: `contractIds`, `creditCards`, `installmentOptions`, `collectionIds`, `priceTables`, `paymentSystemIds`, `addresses`, `customFields`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "organizationUnitId": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "scope": "contractIds", + "ids": [ + "contract-789", + "contract-101" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Scopes/folder.yml b/BrunoCollections/VTEX - Organization Units API/Scopes/folder.yml new file mode 100644 index 0000000000..d4be40a0a0 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Scopes/folder.yml @@ -0,0 +1,4 @@ +info: + name: Scopes + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Add user to organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Add user to organization unit.yml new file mode 100644 index 0000000000..152786630b --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Add user to organization unit.yml @@ -0,0 +1,104 @@ +info: + name: Add user to organization unit + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/organization-units/:organizationUnitId/users?force=false" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: force + value: "false" + type: query + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "userIds": [ + "92264b68-74da-4fc4-b51a-9ddcb8baf29a" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/organization-units/:organizationUnitId/users - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/organization-units/:organizationUnitId/users - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/organization-units/:organizationUnitId/users - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/organization-units/:organizationUnitId/users - Schema is valid", function () { + const schema = {"type":"object","properties":{"organizationUnitId":{"type":"string","description":"ID of the organization unit."},"addedUserIds":{"type":"array","description":"List of user IDs that were successfully added to the organization unit.","items":{"type":"string","description":"ID of the user that was added to the organization unit."}},"failedUserIds":{"type":"array","description":"List of user IDs that were not added to the organization unit (can be empty).","items":{"type":"string","description":"ID of the user that was not added to the organization unit."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a user to a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `force` | query | (Required) Indicates whether user should be forcefully moved to the organization unit in case they are already assigned to another organization unit. If set to `true`, users already assigned to the organization unit will be returned in `addedUserIds`. If set to `false`, those users will appear in `failedUserIds` instead. | + + ## Example response (`200`) + + ```json + { + "organizationUnitId": "b13531bb-8242-43fd-80f5-3263dd4e9cdd", + "addedUserIds": [ + "468cc9c0-e8bd-4826-b7a6-13dce147dc26" + ], + "failedUserIds": [] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Create organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Create organization unit.yml new file mode 100644 index 0000000000..120ca0a709 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Create organization unit.yml @@ -0,0 +1,100 @@ +info: + name: Create organization unit + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/organization-units/v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "Marketing Department" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/organization-units/v1 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/organization-units/v1 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/organization-units/v1 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/organization-units/v1 - Schema is valid", function () { + const schema = {"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp of the most recent update."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Full ID path of the organization unit."}}},"id":{"type":"string","description":"ID of the organization unit."},"customerGroup":{"type":"object","description":"Group of customers associated with the organization unit.","properties":{"customerIds":{"type":"array","description":"List of associated customer IDs (can be empty).","items":{"type":"string","description":"ID of the customer."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new organization unit at the root level of the organizational hierarchy. After creation, you can move the organization unit to a desired parent using the `PUT` [Move organization unit](https://developers.vtex.com/docs/api-reference/organization-units-api#put-/api/organization-units/v1/-organizationUnitId-/path) endpoint. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "createdAt": "2025-03-19T21:28:13.103978Z", + "updatedAt": "2025-03-19T21:28:13.103978Z", + "name": "new-unit", + "path": { + "ids": "qastore/b13531bb-8242-43fd-80f5-3263dd4e9cdd/92264b68-74da-4fc4-b51a-9ddcb8baf29a" + }, + "id": "92264b68-74da-4fc4-b51a-9ddcb8baf29a", + "customerGroup": { + "customerIds": [] + } + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Delete organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Delete organization unit.yml new file mode 100644 index 0000000000..dde2c65c21 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Delete organization unit.yml @@ -0,0 +1,70 @@ +info: + name: Delete organization unit + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cascade + value: "true" + type: query + disabled: true + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/organization-units/v1/:organizationUnitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/organization-units/v1/:organizationUnitId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an organization unit. If the unit has children and the `cascade` parameter is `true`, all children will also be deleted. If `cascade` is `false` and the unit has children, the request will fail. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit to delete. | + | `cascade` | query | If `true`, deletes all child organization units of the specified organization unit. If `false` and the organization unit has children, the request will fail. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Find all organization units with scope value.yml b/BrunoCollections/VTEX - Organization Units API/Units/Find all organization units with scope value.yml new file mode 100644 index 0000000000..597032a248 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Find all organization units with scope value.yml @@ -0,0 +1,101 @@ +info: + name: Find all organization units with scope value + type: http + seq: 12 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/scope/:scope/value/:scopeValue" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: scope + value: contractIds + type: path + - name: scopeValue + value: 9025fbdd-6271-11f0-b37f-f5b4d28a6ca2 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/scope/:scope/value/:scopeValue - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/scope/:scope/value/:scopeValue - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/scope/:scope/value/:scopeValue - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/scope/:scope/value/:scopeValue - Schema is valid", function () { + const schema = {"type":"array","description":"Array of organization units that contain the specified scope value.","items":{"type":"object","description":"Simplified organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all organization units that have a specific scope value. This is useful for reverse lookups, such as finding which organization units are associated with a particular contract ID. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `scope` | path | (Required) Name of the scope category for which data should be retrieved. Supported values are: `contractIds`, `creditCards`, `installmentOptions`, `collectionIds`, `priceTables`, `paymentSystemIds`, `addresses`, `customFields`. | + | `scopeValue` | path | (Required) Unique identifier within the given scope. Example: For contractIds, use the contract ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department" + }, + { + "id": "6b7a46c0-67d9-4b7d-95a1-1a5d0a6c7b9c", + "name": "Sales Department" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Get all children organization units.yml b/BrunoCollections/VTEX - Organization Units API/Units/Get all children organization units.yml new file mode 100644 index 0000000000..02d57a0bf3 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Get all children organization units.yml @@ -0,0 +1,112 @@ +info: + name: Get all children organization units + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/children" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: shallowSearch + value: "true" + type: query + disabled: true + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/children - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/children - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/children - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId/children - Schema is valid", function () { + const schema = {"type":"array","description":"List of child organization units.","items":{"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all children of a specific organization unit. The `shallowSearch` parameter controls whether to retrieve only direct children or all descendants. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the parent organization unit. | + | `shallowSearch` | query | Indicates whether to retrieve only direct children (`true`) or all descendants (`false`). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "7c9a57d1-78e0-4c8e-a6b2-2a6e1b7d8c0b", + "name": "Marketing Operations", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a/7c9a57d1-78e0-4c8e-a6b2-2a6e1b7d8c0b" + }, + "createdAt": "2025-10-21T11:00:00.000Z", + "updatedAt": "2025-10-21T11:00:00.000Z" + }, + { + "id": "5a8b35b9-56c9-3a6c-84a0-0a4c9a5b6a8a", + "name": "Marketing Communications", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a/5a8b35b9-56c9-3a6c-84a0-0a4c9a5b6a8a" + }, + "createdAt": "2025-10-21T11:15:00.000Z", + "updatedAt": "2025-10-21T11:15:00.000Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Get organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Get organization unit.yml new file mode 100644 index 0000000000..c503045feb --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Get organization unit.yml @@ -0,0 +1,96 @@ +info: + name: Get organization unit + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/:organizationUnitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/:organizationUnitId - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details of a specific organization unit by its unique identifier. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T10:30:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Get root organization units.yml b/BrunoCollections/VTEX - Organization Units API/Units/Get root organization units.yml new file mode 100644 index 0000000000..a7cdde7c7a --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Get root organization units.yml @@ -0,0 +1,102 @@ +info: + name: Get root organization units + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/roots" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/roots - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/roots - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/roots - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/roots - Schema is valid", function () { + const schema = {"type":"array","description":"Array of root organization units.","items":{"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all root-level organization units for the account. Root units are top-level units with no parent. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T10:30:00.000Z" + }, + { + "id": "6b7a46c0-67d9-4b7d-95a1-1a5d0a6c7b9c", + "name": "Sales Department", + "path": { + "ids": "apiexamples/6b7a46c0-67d9-4b7d-95a1-1a5d0a6c7b9c" + }, + "createdAt": "2025-10-21T09:15:00.000Z", + "updatedAt": "2025-10-21T09:15:00.000Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/List users from organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/List users from organization unit.yml new file mode 100644 index 0000000000..b7cb9fac9b --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/List users from organization unit.yml @@ -0,0 +1,103 @@ +info: + name: List users from organization unit + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/api/vtexid/organization-units/:organizationUnitId/users" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vtexid/organization-units/:organizationUnitId/users - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vtexid/organization-units/:organizationUnitId/users - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vtexid/organization-units/:organizationUnitId/users - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vtexid/organization-units/:organizationUnitId/users - Schema is valid", function () { + const schema = {"type":"object","description":"Response object containing the list of users in the organization unit.","properties":{"users":{"type":"array","description":"List of users in the organization unit.","items":{"type":"object","description":"User object.","properties":{"userId":{"type":"string","description":"User's unique identifier."},"login":{"type":"string","description":"User's email address."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all users associated with a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "users": [ + { + "userId": "860cf3ed-1c50-4054-b367-99c8f6138fcc", + "login": "daniel.white@email.com" + }, + { + "userId": "37eba317-9154-4844-8ecd-afc5ffb0bf23", + "login": "john.thomas@email.com" + }, + { + "userId": "468cc9c0-e8bd-4826-b7a6-13dce147dc26", + "login": "emma.harris@email.com" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Move organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Move organization unit.yml new file mode 100644 index 0000000000..f59eb7bcf5 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Move organization unit.yml @@ -0,0 +1,102 @@ +info: + name: Move organization unit + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId/path" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 7c9a57d1-78e0-4c8e-a6b2-2a6e1b7d8c0b + type: path + body: + type: json + data: |- + { + "parentId": "b13531bb-8242-43fd-80f5-3263dd4e9cdd" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/path - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/path - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/path - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/organization-units/v1/:organizationUnitId/path - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Moves an organization unit to a different parent in the hierarchy. If no `parentId` is provided in the request body, the organization unit becomes a root organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Move_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit to move. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing and Communications Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T14:45:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Remove users from organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Remove users from organization unit.yml new file mode 100644 index 0000000000..26fe366fd1 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Remove users from organization unit.yml @@ -0,0 +1,68 @@ +info: + name: Remove users from organization unit + type: http + seq: 10 + +http: + method: DELETE + url: "{{baseUrl}}/api/vtexid/organization-units/:organizationUnitId/users" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "userIds": [ + "92264b68-74da-4fc4-b51a-9ddcb8baf29a" + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/vtexid/organization-units/:organizationUnitId/users - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes one or more users from a specific organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Rename organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Units/Rename organization unit.yml new file mode 100644 index 0000000000..aa327554bb --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Rename organization unit.yml @@ -0,0 +1,100 @@ +info: + name: Rename organization unit + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/organization-units/v1/:organizationUnitId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: organizationUnitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "name": "Marketing and Communications Department" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/organization-units/v1/:organizationUnitId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/organization-units/v1/:organizationUnitId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/organization-units/v1/:organizationUnitId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/organization-units/v1/:organizationUnitId - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the name of an existing organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `organizationUnitId` | path | (Required) Unique identifier (GUID) of the organization unit to update. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing and Communications Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T14:45:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/Search organization units.yml b/BrunoCollections/VTEX - Organization Units API/Units/Search organization units.yml new file mode 100644 index 0000000000..633fbfdee3 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/Search organization units.yml @@ -0,0 +1,118 @@ +info: + name: Search organization units + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: name + value: Marketing + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: pageSize + value: "20" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1 - Schema is valid", function () { + const schema = {"type":"array","description":"Array of organization units matching the search criteria.","items":{"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Searches for organization units based on query parameters, with pagination support. If no name filter is provided, returns all organization units for the account. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `name` | query | Name or partial name of the organization unit to search for. If not provided, all units are returned. | + | `page` | query | Page number for pagination. Must be greater than 0. | + | `pageSize` | query | Number of items per page. Must be between 1 and 1000. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T10:30:00.000Z" + }, + { + "id": "7c9a57d1-78e0-4c8e-a6b2-2a6e1b7d8c0b", + "name": "Marketing Operations", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a/7c9a57d1-78e0-4c8e-a6b2-2a6e1b7d8c0b" + }, + "createdAt": "2025-10-21T11:00:00.000Z", + "updatedAt": "2025-10-21T11:00:00.000Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Units/folder.yml b/BrunoCollections/VTEX - Organization Units API/Units/folder.yml new file mode 100644 index 0000000000..c7f48dc4ac --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Units/folder.yml @@ -0,0 +1,4 @@ +info: + name: Units + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Organization Units API/Users/Get user scopes.yml b/BrunoCollections/VTEX - Organization Units API/Users/Get user scopes.yml new file mode 100644 index 0000000000..e61ecb65c3 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Users/Get user scopes.yml @@ -0,0 +1,102 @@ +info: + name: Get user scopes + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/users/:userId/scopes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: 4a7b24a8-45b8-3b5c-73a9-9a3b8a4a5a7a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/users/:userId/scopes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/users/:userId/scopes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/users/:userId/scopes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/users/:userId/scopes - Schema is valid", function () { + const schema = {"type":"array","description":"Array of scopes with their types and associated values.","items":{"type":"object","description":"Scope with associated values.","properties":{"scope":{"type":"string","description":"Scope type identifier."},"ids":{"type":"array","description":"List of values associated with this scope.","items":{"type":"string","description":"Scope value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all scopes associated with a user's organization unit. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) Unique identifier (GUID) of the user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "scope": "contractIds", + "ids": [ + "contract-123", + "contract-456" + ] + }, + { + "scope": "collectionIds", + "ids": [ + "collection-789" + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Users/Get user's organization unit.yml b/BrunoCollections/VTEX - Organization Units API/Users/Get user's organization unit.yml new file mode 100644 index 0000000000..028d26ea22 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Users/Get user's organization unit.yml @@ -0,0 +1,96 @@ +info: + name: Get user's organization unit + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/organization-units/v1/:userId/unit" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: 4a7b24a8-45b8-3b5c-73a9-9a3b8a4a5a7a + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/organization-units/v1/:userId/unit - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/organization-units/v1/:userId/unit - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/organization-units/v1/:userId/unit - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/organization-units/v1/:userId/unit - Schema is valid", function () { + const schema = {"type":"object","description":"Organization unit object.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the organization unit."},"name":{"type":"string","description":"Name of the organization unit."},"path":{"type":"object","description":"Hierarchical path of the organization unit.","properties":{"ids":{"type":"string","description":"Forward-slash separated path of IDs from tenant root to this unit."}}},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the organization unit was last updated."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the organization unit associated with a specific user. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) Unique identifier (GUID) of the user. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a", + "name": "Marketing Department", + "path": { + "ids": "apiexamples/8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a" + }, + "createdAt": "2025-10-21T10:30:00.000Z", + "updatedAt": "2025-10-21T10:30:00.000Z" + } + ``` diff --git a/BrunoCollections/VTEX - Organization Units API/Users/folder.yml b/BrunoCollections/VTEX - Organization Units API/Users/folder.yml new file mode 100644 index 0000000000..99de5ce934 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/Users/folder.yml @@ -0,0 +1,4 @@ +info: + name: Users + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Organization Units API/environments/VTEX.yml b/BrunoCollections/VTEX - Organization Units API/environments/VTEX.yml new file mode 100644 index 0000000000..178299ed89 --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: myvtex + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Organization Units API/opencollection.yml b/BrunoCollections/VTEX - Organization Units API/opencollection.yml new file mode 100644 index 0000000000..e93174c0bb --- /dev/null +++ b/BrunoCollections/VTEX - Organization Units API/opencollection.yml @@ -0,0 +1,32 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Organization Units API + +request: + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Organization Units API enables you to manage B2B functionalities in your VTEX store, focusing on users and organization units. This API provides endpoints for managing users, organization units, and their associated scopes. + + >⚠️ This feature is only available for stores using B2B Buyer Portal, which is currently available to select accounts. + + ## Common parameters + + | Parameter name | Description | Type | + | - | - | - | + | `accountName` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `environment` | Environment to use. Used as part of the URL. | Server variable. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/Evaluate payment policies.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/Evaluate payment policies.yml new file mode 100644 index 0000000000..7916d38123 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/Evaluate payment policies.yml @@ -0,0 +1,143 @@ +info: + name: Evaluate payment policies + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/payment-systems/search?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "items": [ + { + "id": "sku-01", + "collectionIds": [ + 139, + 45 + ], + "shippingData": { + "state": "NY" + } + }, + { + "id": "sku-02", + "collectionIds": [ + 200 + ], + "shippingData": { + "state": "NY" + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/payment-systems/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/payment-systems/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/payment-systems/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/payment-systems/search - Schema is valid", function () { + const schema = {"type":"object","description":"Payment policy evaluation result returned by the Payment Information Service.","required":["paymentSystemAssignments","paymentSystemDefinitions"],"properties":{"paymentSystemAssignments":{"type":"object","description":"Map of item IDs to the payment system IDs allowed for each item.","additionalProperties":{"type":"array","items":{"type":"integer","format":"int32"}}},"paymentSystemDefinitions":{"type":"array","description":"Payment system metadata for the payment systems returned in the assignments.","items":{"required":["id","name","groupName"],"type":"object","description":"Available payment methods response body information.","properties":{"id":{"type":"number","description":"Payment method identification."},"name":{"type":"string","description":"Payment method name."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"implementation":{"type":"string","description":"Payment method implementation class name."},"connectorImplementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"antifraudConnectorImplementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"groupName":{"type":"string","description":"Payment group name."},"redirect":{"type":"boolean","description":"Indicates whether the payment method allows redirection."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"isSelfAuthorized":{"type":"boolean","description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether it is necessary to log in to make the payment."},"allowInstallments":{"type":"boolean","description":"Indicates whether the payment method allows installments."},"allowBinExclusion":{"type":"boolean","description":"Indicates whether it is possible to restrict the use of specific BIN codes (only applicable for cards)."},"allowMultiple":{"type":"boolean","description":"Indicates whether the method allows multiple payments. Example of `false`: debit card."},"allowIssuer":{"type":"boolean","description":"Indicates whether it is possible to identify the name of the bank responsible for issuing the card."},"allowCountry":{"type":"boolean","description":"Indicates whether it is possible to restrict a payment rule by the country where the purchase is made."},"allowCommercialPolicy":{"type":"boolean","description":"Indicates whether to restrict a payment rule by commercial policy type."},"allowCommercialCondition":{"type":"boolean","description":"Indicates whether to restrict a payment rule by commercial condition type."},"allowPeriod":{"type":"boolean","description":"Indicates whether it is possible to restrict a period for making the payment."},"isAvailable":{"type":"boolean","description":"Indicates whether the payment method is available for use."},"description":{"type":["string","null"],"description":"Description of the payment method."},"supportRecurrence":{"type":"boolean","description":"Indicates whether the payment method supports recurrence."},"validator":{"required":["regex","mask","cardCodeMask","cardCodeRegex","weights","useCvv","useExpirationDate","useCardHolderName","useBillingAddress","validCardLengths"],"type":"object","description":"Validator information.","properties":{"regex":{"type":["string","null"],"description":"[Regex](https://regexr.com/) information."},"mask":{"type":["string","null"],"description":"Validator mask."},"cardCodeMask":{"type":["string","null"],"description":"Card code regular mask."},"cardCodeRegex":{"type":["string","null"],"description":"Card code regular expression."},"weights":{"type":["array","null"],"description":"Array containing weigths information.","items":{"type":"integer","description":"Weigths information."}},"useCvv":{"type":"boolean","description":"Indicates whether it is necessary to use the CVV code to complete a transaction with payment made by card."},"useExpirationDate":{"type":"boolean","description":"Indicates whether it is necessary to use the expiration date to complete a card payment transaction."},"useCardHolderName":{"type":"boolean","description":"Indicates whether it is necessary to use the card holder name to complete a payment transaction made by card."},"useBillingAddress":{"type":"boolean","description":"Indicates whether it is necessary to use the billing address to complete a card payment transaction."},"validCardLengths":{"type":["string","null"],"description":"Information about valid card lengths."}}},"appDependencies":{"type":["string","null"],"description":"App dependencies information."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"dueDate":{"type":"string","description":"Payment due date."},"allowNotification":{"type":"boolean","description":"Indicates the possibility of payment notification (used by bank invoices and notes payable)."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (payment provider) identification."},"availablePayments":{"type":["string","null"],"description":"Information about payment availability."},"dueDateMinutes":{"type":"number","description":"Amount of time (in minutes) until the payment date (`dueDate`)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Evaluates active payment policy rules against cart item context and returns payment systems available for each item. Payment systems not mentioned in any matching rule remain available by default. You can also use this endpoint to validate which payment systems are available for cart items before checkout continues. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentSystemAssignments": { + "sku-01": [ + 1, + 4 + ], + "sku-02": [ + 1, + 4, + 100 + ] + }, + "paymentSystemDefinitions": [ + { + "id": 1, + "name": "Debit Card", + "groupName": "debitCard" + }, + { + "id": 4, + "name": "Mastercard", + "groupName": "creditCard" + }, + { + "id": 100, + "name": "EBT Card", + "groupName": "ebt" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/folder.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/folder.yml new file mode 100644 index 0000000000..e92635713e --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy evaluation/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment policy evaluation + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Create policy rule.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Create policy rule.yml new file mode 100644 index 0000000000..e028f6d1ff --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Create policy rule.yml @@ -0,0 +1,151 @@ +info: + name: Create policy rule + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/payment-configuration-service/policy-rules?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/payment-configuration-service/policy-rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/payment-configuration-service/policy-rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/payment-configuration-service/policy-rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/payment-configuration-service/policy-rules - Schema is valid", function () { + const schema = {"type":"object","description":"Payment policy rule returned by the API.","required":["id","name","expression","enabled","priority","action","paymentSystems","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"^[a-f0-9]{32}$","description":"Unique identifier of the policy rule."},"name":{"type":"string","description":"Policy rule name.","minLength":1},"expression":{"type":"object","description":"JSONLogic expression evaluated against item context. Currently supports `and`, `or`, `==`, and `in`, with `collectionIds` and `shippingState` as available variables.","additionalProperties":true},"enabled":{"type":"boolean","description":"Indicates whether the policy rule is active."},"priority":{"type":"integer","format":"int32","description":"Rule priority, from `0` to `999`. Lower values have higher precedence when conflicting rules match the same item.","minimum":0,"maximum":999},"action":{"type":"string","description":"Action applied to the payment systems when the rule expression matches. Accepts `Include` or `Exclude`; value matching is case-insensitive.","enum":["Include","Exclude"]},"paymentSystems":{"type":"array","description":"Payment system IDs affected by the rule.","items":{"type":"integer","format":"int32","description":"Payment system ID."},"minItems":1},"createdAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was created in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"updatedAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was last updated in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a payment policy rule for the VTEX account identified by the `an` query parameter. Policy rules define conditions that determine which payment systems are included or excluded when those conditions match a cart item. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Payment Policies | **ManageStore** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "a1b2c3d4e5f6478990abcdef12345678", + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ], + "createdAt": "2026-04-01T10:00:00Z", + "updatedAt": "2026-04-01T10:00:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Delete policy rule.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Delete policy rule.yml new file mode 100644 index 0000000000..16da773301 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Delete policy rule.yml @@ -0,0 +1,65 @@ +info: + name: Delete policy rule + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/payment-configuration-service/policy-rules/:id?an=apiexamples" + headers: + - name: Accept + value: application/problem+json + params: + - name: an + value: apiexamples + type: query + - name: id + value: nulla aliquip + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/payment-configuration-service/policy-rules/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/payment-configuration-service/policy-rules/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a payment policy rule for the VTEX account identified by the `an` query parameter. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Payment Policies | **ManageStore** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the policy rule. | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Get policy rule by ID.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Get policy rule by ID.yml new file mode 100644 index 0000000000..499d106bed --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Get policy rule by ID.yml @@ -0,0 +1,120 @@ +info: + name: Get policy rule by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/payment-configuration-service/policy-rules/:id?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: id + value: nulla aliquip + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/payment-configuration-service/policy-rules/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/payment-configuration-service/policy-rules/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/payment-configuration-service/policy-rules/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/payment-configuration-service/policy-rules/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Payment policy rule returned by the API.","required":["id","name","expression","enabled","priority","action","paymentSystems","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"^[a-f0-9]{32}$","description":"Unique identifier of the policy rule."},"name":{"type":"string","description":"Policy rule name.","minLength":1},"expression":{"type":"object","description":"JSONLogic expression evaluated against item context. Currently supports `and`, `or`, `==`, and `in`, with `collectionIds` and `shippingState` as available variables.","additionalProperties":true},"enabled":{"type":"boolean","description":"Indicates whether the policy rule is active."},"priority":{"type":"integer","format":"int32","description":"Rule priority, from `0` to `999`. Lower values have higher precedence when conflicting rules match the same item.","minimum":0,"maximum":999},"action":{"type":"string","description":"Action applied to the payment systems when the rule expression matches. Accepts `Include` or `Exclude`; value matching is case-insensitive.","enum":["Include","Exclude"]},"paymentSystems":{"type":"array","description":"Payment system IDs affected by the rule.","items":{"type":"integer","format":"int32","description":"Payment system ID."},"minItems":1},"createdAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was created in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"updatedAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was last updated in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a payment policy rule by ID for the VTEX account identified by the `an` query parameter. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the policy rule. | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "a1b2c3d4e5f6478990abcdef12345678", + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ], + "createdAt": "2026-04-01T10:00:00Z", + "updatedAt": "2026-04-01T10:00:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/List policy rules.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/List policy rules.yml new file mode 100644 index 0000000000..61b9643bcb --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/List policy rules.yml @@ -0,0 +1,118 @@ +info: + name: List policy rules + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/payment-configuration-service/policy-rules?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/payment-configuration-service/policy-rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/payment-configuration-service/policy-rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/payment-configuration-service/policy-rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/payment-configuration-service/policy-rules - Schema is valid", function () { + const schema = {"type":"array","description":"List of policy rules configured for the account.","items":{"type":"object","description":"Payment policy rule returned by the API.","required":["id","name","expression","enabled","priority","action","paymentSystems","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"^[a-f0-9]{32}$","description":"Unique identifier of the policy rule."},"name":{"type":"string","description":"Policy rule name.","minLength":1},"expression":{"type":"object","description":"JSONLogic expression evaluated against item context. Currently supports `and`, `or`, `==`, and `in`, with `collectionIds` and `shippingState` as available variables.","additionalProperties":true},"enabled":{"type":"boolean","description":"Indicates whether the policy rule is active."},"priority":{"type":"integer","format":"int32","description":"Rule priority, from `0` to `999`. Lower values have higher precedence when conflicting rules match the same item.","minimum":0,"maximum":999},"action":{"type":"string","description":"Action applied to the payment systems when the rule expression matches. Accepts `Include` or `Exclude`; value matching is case-insensitive.","enum":["Include","Exclude"]},"paymentSystems":{"type":"array","description":"Payment system IDs affected by the rule.","items":{"type":"integer","format":"int32","description":"Payment system ID."},"minItems":1},"createdAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was created in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"updatedAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was last updated in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the payment policy rules configured for the VTEX account identified by the `an` query parameter. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "a1b2c3d4e5f6478990abcdef12345678", + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ], + "createdAt": "2026-04-01T10:00:00Z", + "updatedAt": "2026-04-01T10:00:00Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Update policy rule.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Update policy rule.yml new file mode 100644 index 0000000000..f5f4923e6b --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/Update policy rule.yml @@ -0,0 +1,155 @@ +info: + name: Update policy rule + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/payment-configuration-service/policy-rules/:id?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: id + value: nulla aliquip + type: path + body: + type: json + data: |- + { + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/payment-configuration-service/policy-rules/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/payment-configuration-service/policy-rules/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/payment-configuration-service/policy-rules/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/payment-configuration-service/policy-rules/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Payment policy rule returned by the API.","required":["id","name","expression","enabled","priority","action","paymentSystems","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"^[a-f0-9]{32}$","description":"Unique identifier of the policy rule."},"name":{"type":"string","description":"Policy rule name.","minLength":1},"expression":{"type":"object","description":"JSONLogic expression evaluated against item context. Currently supports `and`, `or`, `==`, and `in`, with `collectionIds` and `shippingState` as available variables.","additionalProperties":true},"enabled":{"type":"boolean","description":"Indicates whether the policy rule is active."},"priority":{"type":"integer","format":"int32","description":"Rule priority, from `0` to `999`. Lower values have higher precedence when conflicting rules match the same item.","minimum":0,"maximum":999},"action":{"type":"string","description":"Action applied to the payment systems when the rule expression matches. Accepts `Include` or `Exclude`; value matching is case-insensitive.","enum":["Include","Exclude"]},"paymentSystems":{"type":"array","description":"Payment system IDs affected by the rule.","items":{"type":"integer","format":"int32","description":"Payment system ID."},"minItems":1},"createdAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was created in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"updatedAt":{"type":"string","format":"date-time","description":"Date and time when the policy rule was last updated in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Replaces a payment policy rule for the VTEX account identified by the `an` query parameter. Send the same request body used to create a rule. Do not include response-only fields such as `id`, `createdAt`, or `updatedAt`, and do not send a `version` field because concurrency is handled server-side. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Payments | Payment Policies | **ManageStore** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Unique identifier of the policy rule. | + | `an` | query | (Required) Name of the VTEX account whose payment policy rules are being managed. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "a1b2c3d4e5f6478990abcdef12345678", + "name": "Exclude EBT for collection 139 in NY", + "expression": { + "and": [ + { + "in": [ + 139, + { + "var": "collectionIds" + } + ] + }, + { + "==": [ + { + "var": "shippingState" + }, + "NY" + ] + } + ] + }, + "enabled": true, + "priority": 90, + "action": "Exclude", + "paymentSystems": [ + 100 + ], + "createdAt": "2026-04-01T10:00:00Z", + "updatedAt": "2026-04-01T10:00:00Z" + } + ``` diff --git a/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/folder.yml b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/folder.yml new file mode 100644 index 0000000000..7fb2a34c8f --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/Payment policy rules/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment policy rules + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Payment Policies API/environments/VTEX.yml b/BrunoCollections/VTEX - Payment Policies API/environments/VTEX.yml new file mode 100644 index 0000000000..a72b492de8 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: https://pcs.vtexcommercestable.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Payment Policies API/opencollection.yml b/BrunoCollections/VTEX - Payment Policies API/opencollection.yml new file mode 100644 index 0000000000..fa8f2bfbec --- /dev/null +++ b/BrunoCollections/VTEX - Payment Policies API/opencollection.yml @@ -0,0 +1,42 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Payment Policies API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Payment Policies API allows VTEX merchants to configure rules that include or exclude payment systems for specific cart items. The Payment Configuration Service (PCS) stores policy rules, while the Payment Information Service (PIS) evaluates those rules during checkout and returns the payment systems available for each item. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Index + + ### Payment policy rules + + - `POST` [Create policy rule](https://developers.vtex.com/docs/api-reference/payment-policies-api#post-/api/payment-configuration-service/policy-rules) + - `GET` [List policy rules](https://developers.vtex.com/docs/api-reference/payment-policies-api#get-/api/payment-configuration-service/policy-rules) + - `GET` [Get policy rule by ID](https://developers.vtex.com/docs/api-reference/payment-policies-api#get-/api/payment-configuration-service/policy-rules/-id-) + - `PUT` [Update policy rule](https://developers.vtex.com/docs/api-reference/payment-policies-api#put-/api/payment-configuration-service/policy-rules/-id-) + - `DELETE` [Delete policy rule](https://developers.vtex.com/docs/api-reference/payment-policies-api#delete-/api/payment-configuration-service/policy-rules/-id-) + + ### Payment policy evaluation + + - `POST` [Evaluate payment policies](https://developers.vtex.com/docs/api-reference/payment-policies-api#post-/api/pvt/payment-systems/search) + + ## Rule engine + + > ℹ️ Currently the Payment policies feature supports `and`, `or`, `==`, and `in` operators, with a limit of 500 operators per expression. Available context variables are `collectionIds`, containing the collection IDs associated with the item, and `shippingState`, containing the delivery state code. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Create authorization token.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Create authorization token.yml new file mode 100644 index 0000000000..1cecab7f71 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Create authorization token.yml @@ -0,0 +1,93 @@ +info: + name: Create authorization token + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/authorization/token" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "applicationId": "vtex", + "returnUrl": "https://admin.mystore.example.com/provider-return?authorizationCode=" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/authorization/token - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/authorization/token - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/authorization/token - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/authorization/token - Schema is valid", function () { + const schema = {"required":["applicationId","token"],"type":"object","description":"Create authorization token response body information.","properties":{"applicationId":{"type":"string","description":"The same `applicationId` sent in the request."},"token":{"type":"string","description":"You must generate a token that will be used to identify the same context when we redirect the merchant to your application."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates the authorization token that will be used for VTEX to redirect the merchant to the provider's authentication application. For more information about the Payment Provider Protocol (PPP) merchant authentication procedure, visit [Configuration Flow](https://developers.vtex.com/docs/guides/payments-integration-implementing-a-payment-provider#configuration-flow). + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "applicationId": "vtex", + "token": "358a5bea-07d0-4122-888a-54ab70b5f02f" + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Get credentials.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Get credentials.yml new file mode 100644 index 0000000000..7df065d909 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Get credentials.yml @@ -0,0 +1,98 @@ +info: + name: Get credentials + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/authorization/credentials?applicationId=vtex&authorizationCode={{authorizationCode}}" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: applicationId + value: vtex + type: query + - name: authorizationCode + value: "{{authorizationCode}}" + type: query + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/authorization/credentials - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/authorization/credentials - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/authorization/credentials - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/authorization/credentials - Schema is valid", function () { + const schema = {"required":["applicationId","appKey","appToken"],"type":"object","description":"Get credentials response body information.","properties":{"applicationId":{"type":"string","description":"The same `applicationId` sent in the request."},"appKey":{"type":"string","description":"The value we will send in the header `X-VTEX-API-AppKey` for the payment flow."},"appToken":{"type":"string","description":"The value we will send in the header `X-VTEX-API-AppToken` for the payment flow."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the merchant credentials (applicationId, appKey and appToken) registered with the payment provider. These credentials will be saved in the VTEX system and activated when the retailer decides to enable the connector. + + For more information about the Payment Provider Protocol (PPP) merchant authentication procedure, visit [Configuration Flow](https://developers.vtex.com/docs/guides/payments-integration-implementing-a-payment-provider#configuration-flow). + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `applicationId` | query | (Required) VTEX application identifier. | + | `authorizationCode` | query | (Required) Code generate by affiliation that will be used to identify the merchant authorization. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "applicationId": "vtex", + "appKey": "c5a5e3f1-4a77-4a00-8b53-0d1adb3e9628", + "appToken": "57ea254d-f3d3-488d-88d7-129766037ed1" + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Provider authentication.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Provider authentication.yml new file mode 100644 index 0000000000..3ead3917e4 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/Provider authentication.yml @@ -0,0 +1,84 @@ +info: + name: Provider authentication + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/authorization/redirect?applicationId=vtex&token={{token}}" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: applicationId + value: vtex + type: query + - name: token + value: "{{token}}" + type: query + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/authorization/redirect - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Use the application of provider for merchant's authentication. + + VTEX will redirect the merchant to your application using the `token` we retrieved earlier. + + You're expected to have a signup/signin process on your side in order to authenticate the merchant, either as a new or as an existent user. + + At this point, you can present your terms an conditions, a contract, and ask for merchant's final agreement to use your services. + + Finally, you need to generate an `authorizationCode` that you must concatenate to the `returnUrl` we send earlier. + + Example: + + `returnUrl` = `https://admin.mystore.example.com/provider-return?authorizationCode=` + + `authorizationCode` = `7940597D-A63B` + + Redirect the merchant to: + + `https://admin.mystore.example.com/provider-return?authorizationCode=7940597D-A63B` + + For more information about the Payment Provider Protocol (PPP) merchant authentication procedure, visit [Configuration Flow](https://developers.vtex.com/docs/guides/payments-integration-implementing-a-payment-provider#configuration-flow). + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `applicationId` | query | (Required) VTEX application identifier. | + | `token` | query | (Required) You must generate a token that will be used to identify the same context when we redirect the merchant to your application. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/folder.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/folder.yml new file mode 100644 index 0000000000..82888b16a3 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Configuration Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: Configuration Flow + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Cancel payment.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Cancel payment.yml new file mode 100644 index 0000000000..b2324b0e04 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Cancel payment.yml @@ -0,0 +1,133 @@ +info: + name: Cancel payment + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/payments/:paymentId/cancellations" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: F5C1A4E20D3B4E07B7E871F5B5BC9F91 + type: path + body: + type: json + data: |- + { + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "requestId": "D12D9B80972C462980F5067A3A126837", + "authorizationId": "5784589", + "tid": "10022005181543584603", + "transactionId": "D3AA1FC8372E430E8236649DB5EBD08E", + "value": 2300, + "nsu": "NSU987432", + "sandboxMode": false, + "merchantSettings": [ + { + "name": "Public Merchant ID Test.", + "value": "1" + }, + { + "name": "Public Merchant ID Test.", + "value": "1" + } + ], + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + }, + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/payments/:paymentId/cancellations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/payments/:paymentId/cancellations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/payments/:paymentId/cancellations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/payments/:paymentId/cancellations - Schema is valid", function () { + const schema = {"required":["paymentId","cancellationId","code","message","requestId"],"type":"object","description":"Cancel payment response body information.","properties":{"paymentId":{"type":"string","description":"The same `paymentId` sent in the request."},"cancellationId":{"type":"string","description":"Provider's cancellation identifier. If the operation has failed you **MUST** return `null`."},"code":{"type":["string","null"],"description":"Provider's operation/error code to be logged. Return `cancel-manually` if you do not support this operation, so we can send a notification to the merchant."},"message":{"type":"string","description":"Provider's operation/error message to be logged."},"requestId":{"type":"string","description":"The same `requestId` sent in the request."},"connectorMetadata":{"type":"array","description":"Array containing metadata fields sent from the provider to the payment gateway.","items":{"type":"object","description":"Metadata fields information.","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of the metadata to be stored in the gateway (limited to 20 characters)."},"value":{"type":"string","description":"The value of the metadata stored (limited to 200 characters)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a payment that was not yet approved or settled. + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) VTEX payment identifier. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "cancellationId": "1231323234234", + "code": null, + "message": "Successfully cancelled", + "requestId": "D12D9B80972C462980F5067A3A126837", + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Create payment.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Create payment.yml new file mode 100644 index 0000000000..9a7fe4713d --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Create payment.yml @@ -0,0 +1,281 @@ +info: + name: Create payment + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/payments" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "reference": "618272", + "orderId": "1072430428324", + "shopperInteraction": "ecommerce", + "transactionId": "2F023FD5A72A49D48A8633252B7CCBD6", + "paymentId": "01693EB95BE443AC85874E395CD91565", + "paymentMethod": "Diners", + "paymentMethodCustomCode": null, + "merchantName": "mystore", + "card": { + "holder": "John Doe", + "number": "364901****2661", + "csc": "***", + "expiration": { + "month": "12", + "year": "2020" + }, + "document": "39295416023", + "token": null + }, + "value": 31.9, + "referenceValue": 31.9, + "currency": "BRL", + "installments": 1, + "installmentsInterestRate": 0, + "installmentsValue": 31.9, + "deviceFingerprint": "75076388", + "ipAddress": "187.105.111.65", + "miniCart": { + "buyer": { + "id": "c1245228-1c68-11e6-94ac-0afa86a846a5", + "firstName": "John", + "lastName": "Doe", + "document": "01234567890", + "documentType": "cpf", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "isCorporate": false, + "email": "john.doe@example.com", + "phone": "+5521999999999", + "createdDate": "2020-02-18T18:17:45" + }, + "shippingAddress": { + "country": "BRA", + "street": "Praia de Botafogo St.", + "number": "300", + "complement": "3rd Floor", + "neighborhood": "Botafogo", + "postalCode": "22250040", + "city": "Rio de Janeiro", + "state": "RJ" + }, + "billingAddress": { + "country": "BRA", + "street": "Brigadeiro Faria Lima Avenue", + "number": "4440", + "complement": "10th Floor", + "neighborhood": "Itaim Bibi", + "postalCode": "04538132", + "city": "São Paulo", + "state": "SP" + }, + "items": [ + { + "id": "8", + "name": "Tenis Preto I", + "price": 30.9, + "quantity": 1, + "discount": 0, + "deliveryType": "Normal", + "categoryId": "5", + "sellerId": "1" + } + ], + "shippingValue": 1, + "taxValue": 0 + }, + "url": "https://admin.mystore.example.com/orders?q=1072430428324", + "callbackUrl": "https://api.mystore.example.com/some-path/to-notify/status-changes?an=mystore", + "returnUrl": "https://mystore.example.com/checkout/order/1072430428324", + "inboundRequestsUrl": "https://api.mystore.example.com/checkout/order/1072430428324/inbound-request/:action", + "recipients": [ + { + "id": "mymarketplace", + "name": "My Marketplace QA", + "documentType": "CNPJ", + "document": "99999999999999", + "role": "marketplace", + "chargeProcessingFee": true, + "chargebackLiable": true, + "amount": 31.9 + } + ], + "merchantSettings": [ + { + "name": "field1", + "value": "value1" + }, + { + "name": "field2", + "value": "value2" + } + ], + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/payments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/payments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/payments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/payments - Schema is valid", function () { + const schema = {"required":["paymentId","status","authorizationId","tid","nsu","acquirer","delayToAutoSettle","delayToAutoSettleAfterAntifraud","delayToCancel"],"type":"object","description":"Create payment response body information.","properties":{"paymentId":{"type":"string","description":"VTEX identifier for this payment. The same sent in the request."},"status":{"type":"string","description":"The Provider's status for this payment. Must be one of three values:\r\n\r\n- `approved`\r\n- `denied`\r\n- `undefined`."},"authorizationId":{"type":"string","description":"Provider's unique identifier for the authorization. Should be sent when the payment is authorized. In other statuses, it should be absent or `null`."},"bankIssueInvoiceId":{"type":"string","description":"This field is deprecated, please use `paymentUrl` instead. The bank invoice URL to be presented to the end user."},"paymentUrl":{"type":["string","null"],"description":"When the payment is via bank invoice, this should be the invoice URL to be presented to the user. If the payment requires the redirection of the user, this should be the URL to redirect the user. If neither is the case, then this should be absent."},"paymentAppData":{"type":"object","description":"Object which indicates that a [Payment App](https://developers.vtex.com/docs/guides/payments-integration-payment-app) is needed to finish the payment. This object contains the data to be used by the Payment App.","required":["appName","payload"],"properties":{"appName":{"type":"string","description":"Indicates which VTEX IO app that will handle the payment flow at Checkout."},"payload":{"type":"string","description":"The payload that will be sent to your app, like a serialized JSON, for example."}}},"identificationNumber":{"type":"string","description":"The bank invoice unformatted identification number. Should only be present when the payment is made via bank invoice."},"identificationNumberFormatted":{"type":"string","description":"The bank invoice formatted identification number that will be presented to the end user."},"barCodeImageType":{"type":"string","description":"The bank invoice barcode image type. For instance, \"i25\" for Brazilian *Boleto Bancário*. Should only be present when the payment is made via bank invoice."},"barCodeImageNumber":{"type":"string","description":"The bank invoice number to generate a barcode (must follow any regulations/specifications for targeted countries). Should only be present when the payment is made via bank invoice."},"tid":{"type":"string","description":"Provider's unique identifier for the transaction."},"nsu":{"type":["string","null"],"description":"Provider's unique sequential number for the transaction."},"acquirer":{"type":["string","null"],"description":"Acquirer name (mostly used for card payments)."},"redirectUrl":{"type":"string","description":"This field is deprecated, please use `paymentUrl` instead. The URL the end user needs to be redirected to (external authentication, 3DS, etc)."},"code":{"type":["string","null"],"description":"Provider's operation/error code to be logged."},"message":{"type":["string","null"],"description":"Provider's operation/error message to be logged."},"delayToAutoSettle":{"type":"integer","description":"Total time (in seconds) before we make an automatic call to `/settlements`, regardless of whether the payment was approved by the merchant's anti-fraud provider or not. The maximum time allowed to wait for an auto capture is 604800 seconds (7 days)."},"delayToAutoSettleAfterAntifraud":{"type":"integer","description":"Total time (in seconds) before we make an automatic call to `/settlements` after merchant's antifraud approval."},"delayToCancel":{"type":"integer","description":"Total time (in seconds) to wait for an authorization and make an automatic call to `/cancellations` to cancel the payment. The minimum value is 10 minutes (600 seconds).\r\n\r\n**NOTE 1**: If you set this field to a time period of less than 24 hours (86399 seconds or less), the gateway will retry processing the payment every 1 hour. If you use a value of 24 hours (86400 seconds) or more in this field, the gateway will retry processing the payment every 4 hours.\r\n\r\n**NOTE 2**: For `delayToCancel` values between 5 minutes and 1 hour (300 and 3600 seconds), or when payment is made by [PIX](https://developers.vtex.com/docs/guides/payments-integration-pix-instant-payments-in-brazil) (Brazilian instant payment method), retry calls will occur every 5 minutes.\r\n\r\n**NOTE 3**: The maximum value allowed for the `delayToCancel` field is 30 days (2592000 seconds). However, when payment is made by [PIX](https://developers.vtex.com/docs/guides/payments-integration-pix-instant-payments-in-brazil) (Brazilian instant payment method), the values must be set between 15 and 1 hour (900 seconds and 3600 seconds)."},"maxValue":{"type":"integer","description":"The maximum value for this payment. This field allows changes to be made to transactions to settle larger amounts as a result of order changes."},"connectorMetadata":{"type":"array","description":"Array containing metadata fields sent from the provider to the payment gateway.","items":{"type":"object","description":"Metadata fields information.","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of the metadata to be stored in the gateway (limited to 20 characters)."},"value":{"type":"string","description":"The value of the metadata stored (limited to 200 characters)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new payment and initiates the payment flow. + + > ℹ️ This request is made from VTEX to the payment provider. + + Payment providers must: + + - Execute authorization on payments made through credit/debit card or any synchronized payments; + + - Return the required information to the customer on payments made through bank-issued invoice, redirect, or any async payments. + + >ℹ️ This endpoint has to meet the principle of [idempotence](https://en.wikipedia.org/wiki/Idempotence). When calling this endpoint for the first time of a payment, without a `paymentId`, it should create a new payment. When calling this endpoint for an existing `paymentId`, it should not create another payment, but return the updated status of the existing payment instead. + + ## Callbacks (asynchronous flow) + + Callbacks are used for asynchronous payments, which do not receive the final status immediately. At first, an `undefined` status is returned, and the final status will be received from a callback request in the future as `authorized` or `denied`. There are two types of callbacks: + + - **Notification:** If a payment returns with `undefined` status, you are expected to send us a callback/notification to update it later, sending a POST with an updated version of your response (same structure as above) to the `callbackUrl` we have provided. + + - **Retry:** If a payment returns with `undefined` status, you are expected to call the retry endpoint provided by the `callbackUrl` when the processing of the payment is completed, so we make another Create Payment request to update the status with the new value (`authorized` or `denied`). + + Callback requests should be authenticated using a Key and Token which you can [generate from your VTEX partner account License Manager](https://help.vtex.com/en/tutorial/api-keys--2iffYzlvvz4BDMr6WGUtet#generating-app-keys-in-your-account). To do so, `POST` your request passing the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers with your credentials. **Note:** do not mix up these credentials with the ones we send on behalf of the merchant when sending our requests. + + >⚠ For integrations not using VTEX IO, use the **Notification** callback. For integrations developed using VTEX IO infrastructure, use the **Retry** callback. + + ### Callback URL + + The `callbackUrl` field contains an URL that the payment provider uses to make a callback and inform our gateway of the final payment status: `approved` or `denied`. + + This URL has some query parameters, including the `X-VTEX-signature`. This parameter is mandatory and contains a signature token to identify that the request has been generated from VTEX as a security measure. The signature token has at most 32 characters. You can check an example of callback URL with the signature token below: + + ``` + https://gatewayqa.vtexpayments.com.br/api/pvt/payment-provider/transactions/8FB0F111111122222333344449984ACB/payments/A2A9A25B11111111222222333327883C/callback?accountName=teampaymentsintegrations&X-VTEX-signature=R******tk + ``` + + In the [Transactions page of the Admin](https://help.vtex.com/en/tutorial/how-to-view-the-orders-details--tutorials_452), the signature token appears masked for security reasons, as in this example: `X-VTEX-signature=Rj******tk`. + + When making the callback request, we recommend that payment providers use the callback URL exactly as received, which guarantees that all the parameters are included. + + See below an example of a payload forwarded along with the callback URL: + + ```json + { + "paymentId": "8B3BA2F4352545A8B1C5A215F356A01C", + "status": "approved", + "authorizationId": "184520", + "nsu": "21705348", + "tid": "21705348", + "acquirer": "pagmm", + "code": "0000", + "message": "Successfully approved transaction", + "delayToAutoSettle": 1200, + "delayToAutoSettleAfterAntifraud": 1200, + "delayToCancel": 86400, + "cardBrand": "Mastercard", + "firstDigits": "534696", + "lastDigits": "6921", + "maxValue": 16.6 + } + ``` + + >ℹ️ The parameter values sent in the callback payload replace the original values informed in the **Create Payment** request. + + >⚠️ If the waiting parameters (`delayToAutoSettle` and `delayToAutoSettleAfterAntifraud`) are not sent with the callback URL, the values for these parameters will be automatically set to 24 hours. + + ## Beta features + + The beta features available for payment providers are: + + - `inboundRequestsUrl`: Allows to forward external requests back to your payment provider implementation, including the configured credentials (`X-VTEX-API-*` headers), and settings. + + >ℹ You can reach out to our team by [opening a ticket](https://help.vtex.com/en/tutorial/opening-tickets-to-vtex-support--16yOEqpO32UQYygSmMSSAM) to know more about any beta features. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "status": "approved", + "authorizationId": "AUT123567", + "nsu": "NSU987432", + "tid": "TID1578324421", + "acquirer": "FooBarPayments", + "delayToAutoSettle": 432000, + "delayToAutoSettleAfterAntifraud": 120, + "delayToCancel": 600, + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Inbound request (BETA).yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Inbound request (BETA).yml new file mode 100644 index 0000000000..cf8f5091cb --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Inbound request (BETA).yml @@ -0,0 +1,144 @@ +info: + name: Inbound request (BETA) + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/payments/:paymentId/inbound/:action" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: F5C1A4E20D3B4E07B7E871F5B5BC9F91 + type: path + - name: action + value: hook + type: path + body: + type: json + data: |- + { + "requestId": "LA4E20D3B4E07B7E871F5B5BC9F91", + "transactionId": "D3AA1FC8372E430E8236649DB5EBD08E", + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "authorizationId": "AUT123567", + "tid": "10022005181543584603", + "nsu": "NSU987432", + "requestData": { + "body": "{{originalRequestBody}}" + }, + "merchantSettings": [ + { + "name": "Public Merchant ID Test.", + "value": "1" + }, + { + "name": "Public Merchant ID Test.", + "value": "1" + } + ], + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + }, + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/payments/:paymentId/inbound/:action - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/payments/:paymentId/inbound/:action - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/payments/:paymentId/inbound/:action - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/payments/:paymentId/inbound/:action - Schema is valid", function () { + const schema = {"required":["requestId","paymentId","responseData"],"type":"object","description":"Inbound Request response body information.","properties":{"requestId":{"type":"string","description":"The same `requestId` sent in the request."},"paymentId":{"type":"string","description":"The same `paymentId` sent in the request."},"code":{"type":"string","description":"Provider's operation/error code to be logged."},"message":{"type":"string","description":"Provider's operation/error message to be logged."},"responseData":{"required":["statusCode","contentType","content"],"type":"object","description":"Response data information.","properties":{"statusCode":{"type":"integer","description":"Your desired status code."},"contentType":{"type":"string","description":"Your desired content-type."},"content":{"type":"string","description":"Your desired content body."}}},"connectorMetadata":{"type":"array","description":"Array containing metadata fields sent from the provider to the payment gateway.","items":{"type":"object","description":"Metadata fields information.","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of the metadata to be stored in the gateway (limited to 20 characters)."},"value":{"type":"string","description":"The value of the metadata stored (limited to 200 characters)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + The Inbound request (BETA) implements an URL that facilitates a direct connection between VTEX Gateway service and the Payment Provider. This functionality allows the payment provider to create other types of specific routes, in addition to those described in the other PPP endpoints, according to their type of operation (e.g. hook or enrollment routes, among others). + + This endpoint forwards a request back to your endpoint using the `inboundRequestsUrl` provided in the [Create Payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments?endpoint=post-/payments) endpoint payload. + + The `{action}` part of the path will be the same you have used to call the `inboundRequestsUrl` (e.g. hook, enrollment, among others). + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) VTEX payment identifier. | + | `action` | path | (Required) Describes the type of action that will be performed on the route (e.g. hook, enrollment, among others). It is the same `:action` information used in the `inboundRequestsUrl` provided in the [Create Payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments?endpoint=post-/payments) endpoint payload. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "requestId": "LA4E20D3B4E07B7E871F5B5BC9F91", + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "responseData": { + "statusCode": 200, + "contentType": "application/json", + "content": "{\"myAttribute\":\"anyValue\"}" + }, + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/List Payment Provider Manifest.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/List Payment Provider Manifest.yml new file mode 100644 index 0000000000..750e5c8a90 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/List Payment Provider Manifest.yml @@ -0,0 +1,175 @@ +info: + name: List Payment Provider Manifest + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/manifest" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/manifest - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/manifest - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/manifest - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/manifest - Schema is valid", function () { + const schema = {"required":["paymentMethods"],"type":"object","description":"Payment provider manifest response body information.","properties":{"paymentMethods":{"type":"array","description":"Describes each payment method supported by payment provider and exposed its respective metadata.","items":{"type":"object","description":"Payment methods information.","required":["name","allowsSplit"],"properties":{"name":{"type":"string","description":"Payment method name."},"allowsSplit":{"type":"string","description":"Describes which transaction flow stage the connector should receive payment split data. Check more details on the [Split Payouts on the Payment Provider Protocol](https://developers.vtex.com/vtex-rest-api/docs/split-payouts-on-payment-provider-protocol) article.","enum":["onAuthorize","onCapture","disabled"]}}}},"customFields":{"type":"array","description":"Describes the customized fields supported by the connector. Except for `appKey` or `appToken` values, which must be defined in homonymous fields, any other security data should be sent or stored as `password` type fields.","items":{"type":"object","description":"Custom fields information.","properties":{"name":{"type":"string","description":"Custom field name."},"type":{"type":"string","description":"Custom field type.","enum":["text","password","select"]},"options":{"type":"array","description":"In case of `select` type, the possible params are `text` and `value`.","items":{"type":"object","description":"Custom field information.","properties":{"text":{"type":"string","description":"Custom field description."},"value":{"type":"string","description":"Custom field value."}}}}}}},"autoSettleDelay":{"type":"object","description":"Describes the allowed delay value for the auto settle capture. Accepted values: `minimum` and `maximum` in whole hours (decimals are not allowed). Check more details on the [Custom Auto Capture Feature](https://developers.vtex.com/vtex-rest-api/docs/custom-auto-capture-feature) article.","required":["minimum","maximum"],"properties":{"minimum":{"type":"string","description":"Minimum amount of time to auto settle in hours."},"maximum":{"type":"string","description":"Maximum amount of time to auto settle in hours."}}},"metadataFields":{"type":"array","description":"Array containing the names of the metadata fields sent from the provider to the payment gateway. Limitations: the array must contain a maximum of 3 strings, and each of them, a maximum of 20 characters.","items":{"type":"string","description":"Metadata fields information."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Exposes the provider manifest, including metadata settings such as payment methods, split configuration, and custom fields. + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Available payment methods + + | Payment Method | Type | Country | + |---|---|---| + | `Visa` | Credit Card | Global | + | `Mastercard` | Credit Card | Global | + | `American Express` | Credit Card | Global | + | `Discover` | Credit Card | Global | + | `JCB` | Credit Card | Global | + | `Diners` | Credit Card | Global | + | `Elo` | Credit Card | Brazil | + | `Hipercard` | Credit Card | Brazil | + | `Aura` | Credit Card | Brazil | + | `Banricompras` | Credit Card | Brazil | + | `Credz` | Credit Card | Brazil | + | `Cabal` | Credit Card | Argentina, Brazil, Uruguay, Paraguay | + | `Patagonia 365` | Credit Card | Argentina | + | `Cartes Bancaires (CB)` | Credit Card | France | + | `VirtualDebitElo` | Debit Card | Brazil | + | `Visa Electron` | Debit Card | Global | + | `Maestro` | Debit Card | Global | + | `Mastercard Debit` | Debit Card | Global | + | `Débito Online` | Debit Card | Brazil | + | `Cobranded` | Card | Global | + | `Privatelabels` | Card | Global | + | `Apple Pay` | Digital Wallet | Global | + | `Google Pay` | Digital Wallet | Global | + | `Promissories` | Generic | Global | + | `Cash` | Generic | Global | + | `Pix` | Online Transfer | Brazil | + | `Safetypay` | Online Transfer | Americas and Europe | + | `BankInvoice` | Offline/Voucher | Brazil (Boleto Bancário) | + | `FichaDeposito` | Offline/Voucher | Mexico | + | `Rapipago` | Offline/Voucher | Argentina | + | `OXXO` | Offline/Voucher | Mexico | + | `Voucher` | Offline/Voucher | Mexico | + | `Bitcoin` | Cryptocurrency | Global | + | `Venda Direta Credito` | Credit Card (Physical) | Global | + | `Venda Direta Debito` | Debit Card (Physical) | Global | + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentMethods": [ + { + "name": "Visa", + "allowsSplit": "onCapture" + }, + { + "name": "Pix", + "allowsSplit": "disabled" + }, + { + "name": "Mastercard", + "allowsSplit": "onCapture" + }, + { + "name": "American Express", + "allowsSplit": "onCapture" + }, + { + "name": "BankInvoice", + "allowsSplit": "onAuthorize" + }, + { + "name": "Privatelabels", + "allowsSplit": "disabled" + }, + { + "name": "Promissories", + "allowsSplit": "disabled" + } + ], + "customFields": [ + { + "name": "Merchant's custom field", + "type": "text" + }, + { + "name": "Merchant's custom select field", + "type": "select", + "options": [ + { + "text": "Field option 1", + "value": "1" + }, + { + "text": "Field option 2", + "value": "2" + }, + { + "text": "Field option 3", + "value": "3" + } + ] + } + ], + "autoSettleDelay": { + "minimum": "0", + "maximum": "720" + }, + "metadataFields": [ + "MetadataName1", + "MetadataName2" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Refund payment.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Refund payment.yml new file mode 100644 index 0000000000..0a8bfe5ab7 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Refund payment.yml @@ -0,0 +1,150 @@ +info: + name: Refund payment + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/payments/:paymentId/refunds" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: F5C1A4E20D3B4E07B7E871F5B5BC9F91 + type: path + body: + type: json + data: |- + { + "requestId": "LA4E20D3B4E07B7E871F5B5BC9F91", + "settleId": "Q5C1A4E20D3B4E07B7E871F5B5BC9F91", + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "tid": "10022005181543584603", + "authorizationId": "AUT123567", + "nsu": "NSU987432", + "value": 20, + "transactionId": "D3AA1FC8372E430E8236649DB5EBD08E", + "recipients": [ + { + "id": "mystore", + "name": "Company XPTO", + "documentType": "CNPJ", + "document": "05314972000174", + "role": "marketplace", + "chargeProcessingFee": true, + "chargebackLiable": true, + "amount": 3.2 + }, + { + "id": "sellerA", + "name": "Company ABC", + "documentType": "CNPJ", + "document": "24830098000172", + "role": "seller", + "amount": 16.8, + "comissionAmount": 3 + } + ], + "sandboxMode": false, + "merchantSettings": [ + { + "name": "Public Merchant ID Test.", + "value": "1" + } + ], + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/payments/:paymentId/refunds - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/payments/:paymentId/refunds - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/payments/:paymentId/refunds - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/payments/:paymentId/refunds - Schema is valid", function () { + const schema = {"required":["paymentId","refundId","value","code","message","requestId"],"type":"object","description":"Refund payment response body information.","properties":{"paymentId":{"type":"string","description":"The same `paymentId` sent in the request."},"refundId":{"type":"string","description":"Provider's refund identifier. If the operation has failed you **MUST** return `null`."},"value":{"type":"number","description":"The amount that was refunded. If the operation has failed you **MUST** return `0`."},"code":{"type":["string","null"],"description":"Provider's operation/error code to be logged. Return `refund-manually` if you do not support this operation, so we can send a notification to the merchant."},"message":{"type":"string","description":"Provider's operation/error message to be logged."},"requestId":{"type":"string","description":"The same `requestId` sent in the request."},"connectorMetadata":{"type":"array","description":"Array containing metadata fields sent from the provider to the payment gateway.","items":{"type":"object","description":"Metadata fields information.","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of the metadata to be stored in the gateway (limited to 20 characters)."},"value":{"type":"string","description":"The value of the metadata stored (limited to 200 characters)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Refunds a payment (in full or in part) that was previously settled. + + > ℹ️ This request is made from VTEX to the payment provider. + + >⚠️ The request should return a success response (`200`) only after the settlement has been fully completed. If there is any delay or the settlement has not yet been finalized, the response must indicate an error message (`500`). This allows VTEX payment module to continue retrying the request for up to 24 hours, until the settlement is definitively confirmed. A `200` status code response explicitly means that the settlement has been successfully completed + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) VTEX payment identifier. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "refundId": "2EA354989E7E4BBC9F9D7B66674C2574", + "value": 57, + "code": null, + "message": "Successfully refunded", + "requestId": "LA4E20D3B4E07B7E871F5B5BC9F91", + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Settle payment.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Settle payment.yml new file mode 100644 index 0000000000..e0c7a2635f --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/Settle payment.yml @@ -0,0 +1,149 @@ +info: + name: Settle payment + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/payments/:paymentId/settlements" + headers: + - name: X-PROVIDER-API-AppKey + value: "{{X-PROVIDER-API-AppKey}}" + - name: X-PROVIDER-API-AppToken + value: "{{X-PROVIDER-API-AppToken}}" + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: F5C1A4E20D3B4E07B7E871F5B5BC9F91 + type: path + body: + type: json + data: |- + { + "transactionId": "D3AA1FC8372E430E8236649DB5EBD08E", + "requestId": "2019-02-04T22:53:42-40000", + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "value": 45, + "authorizationId": "5784589", + "tid": "5784589", + "nsu": "NSU987432", + "recipients": [ + { + "id": "mystore", + "name": "Company XPTO", + "documentType": "CNPJ", + "document": "05314972000174", + "role": "marketplace", + "chargeProcessingFee": true, + "chargebackLiable": true, + "amount": 7.2 + }, + { + "id": "sellerA", + "name": "Company ABC", + "documentType": "CNPJ", + "document": "24830098000172", + "role": "seller", + "chargeProcessingFee": false, + "chargebackLiable": false, + "amount": 37.8, + "commissionAmount": 7.2 + } + ], + "sandboxMode": false, + "merchantSettings": [ + { + "name": "Public Merchant ID Test.", + "value": "1" + } + ], + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/payments/:paymentId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/payments/:paymentId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/payments/:paymentId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/payments/:paymentId/settlements - Schema is valid", function () { + const schema = {"required":["paymentId","settleId","value","code","message","requestId"],"type":"object","description":"Settle payment response body information.","properties":{"paymentId":{"type":"string","description":"The same `paymentId` sent in the request."},"settleId":{"type":"string","description":"VTEX identifier for this settlement."},"value":{"type":"number","description":"The amount to be settled."},"code":{"type":["string","null"],"description":"Provider's operation/error code to be logged."},"message":{"type":"string","description":"Provider's operation/error message to be logged."},"requestId":{"type":"string","description":"The same `requestId` sent in the request."},"connectorMetadata":{"type":"array","description":"Array containing metadata fields sent from the provider to the payment gateway.","items":{"type":"object","description":"Metadata fields information.","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of the metadata to be stored in the gateway (limited to 20 characters)."},"value":{"type":"string","description":"The value of the metadata stored (limited to 200 characters)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Settles a payment that was previously approved. + + > ℹ️ This request is made from VTEX to the payment provider. + + ## Permissions + + Check with your service provider to know what permissions are needed. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) VTEX payment identifier. | + | `X-PROVIDER-API-AppKey` | header | (Required) Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json. | + | `X-PROVIDER-API-AppToken` | header | (Required) Unique token created by the provider and configured on the provider configuration page (Admin VTEX). To use this header as authorization, check that the `usesProviderHeadersName` field is set to `true` in the payment provider's `configuration.json`. To check the `configuration.json` file, access the route {{connector}}/paymentProvider/configuration.json | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91", + "settleId": "2EA354989E7E4BBC9F9D7B66674C2574", + "value": 57, + "code": null, + "message": "Successfully settled", + "requestId": "DCEAA1FC8372E430E8236649DB5EBD08E", + "connectorMetadata": [ + { + "name": "MetadataName", + "value": "MetadataValue" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/folder.yml b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/folder.yml new file mode 100644 index 0000000000..51243c22aa --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/Payment Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment Flow + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/environments/VTEX.yml b/BrunoCollections/VTEX - Payment Provider Protocol/environments/VTEX.yml new file mode 100644 index 0000000000..d442d3218a --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/environments/VTEX.yml @@ -0,0 +1,18 @@ +name: VTEX +variables: + - name: providerApiEndpoint + value: "{providerApiEndpoint}" + - name: baseUrl + value: https://{{providerApiEndpoint}} + - name: originalRequestBody + value: "" + - secret: true + name: X-PROVIDER-API-AppKey + - secret: true + name: X-PROVIDER-API-AppToken + - secret: true + name: apiKey + - secret: true + name: authorizationCode + - secret: true + name: token diff --git a/BrunoCollections/VTEX - Payment Provider Protocol/opencollection.yml b/BrunoCollections/VTEX - Payment Provider Protocol/opencollection.yml new file mode 100644 index 0000000000..b05290e0c5 --- /dev/null +++ b/BrunoCollections/VTEX - Payment Provider Protocol/opencollection.yml @@ -0,0 +1,69 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Payment Provider Protocol + +docs: + content: |- + >ℹ️ The Payment Provider Protocol is a set of definitions to help you integrate your payment processing API into the VTEX platform, including sub-acquirers, acquirers, gateways, and custom payment services. + + To achieve this, you must implement a web API (REST) following the specifications described in this documentation. + + To learn more about the Payment Provider Protocol, check our [Help Center article](https://help.vtex.com/en/tutorial/payment-provider-protocol--RdsT2spdq80MMwwOeEq0m). + + ## Endpoint requirements + + * Must use a standard subdomain/domain name, not an IP address. + * Must be served over HTTPS on port 443 with TLS 1.2 support. + * Must respond in less than 5 seconds when running the tests. + * Must respond in less than 20 seconds when in production. + * Must be [PCI-DSS compliant](https://developers.vtex.com/docs/guides/payments-integration-pci-dss-compliance) or use [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy) to accept branded cards like Visa, Mastercard, Amex, etc. + + ## Testing + + You can perform tests on your payment provider using our [VTEX - Payment Provider Test Suite](https://apps.vtex.com/vtex-payment-provider-test-suite/p). + + >ℹ An extra header `X-VTEX-API-Is-TestSuite` = `true` will be sent for every test suite request, to help you easily identify it and mock any required scenarios. + + For more details about testing a Payment Provider, check our [Payment Provider Homologation](https://developers.vtex.com/docs/guides/payments-integration-payment-provider-homologation) article. + + ## Common parameters in the documentation + + + + + + + + + + + + + + +
{{providerApiEndpoint}}Provider's endpoint for the implementation.
{{X-PROVIDER-API-AppKey}}Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX).
{{X-PROVIDER-API-AppToken}}Unique token created by the provider and configured on the provider configuration page (Admin VTEX).
+ + ## Payment Provider Protocol API Index + + ### Payment Flow + + - `GET` [List Payment Provider Manifest](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#get-/manifest) + - `POST` [Create payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments) + - `POST` [Cancel payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments/-paymentId-/cancellations) + - `POST` [Settle payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments/-paymentId-/settlements) + - `POST` [Refund payment](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments/-paymentId-/refunds) + - `POST` [Inbound request (BETA)](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/payments/-paymentId-/inbound/-action-) + + ### Configuration Flow + + - `POST` [Create authorization token](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#post-/authorization/token) + - `GET` [Provider authentication](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#get-/authorization/redirect) + - `GET` [Get credentials](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#get-/authorization/credentials) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Delete payment rule by ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Delete payment rule by ID.yml new file mode 100644 index 0000000000..78d6489542 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Delete payment rule by ID.yml @@ -0,0 +1,60 @@ +info: + name: Delete payment rule by ID + type: http + seq: 9 + +http: + method: DELETE + url: "{{baseUrl}}/api/pvt/rules/:ruleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ruleId + value: fe6c470b-f80b-4bb1-a75c-378617f8767a + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/pvt/rules/:ruleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific payment rule applied to the payment providers configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ManageStore | **Manage Store** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ruleId` | path | (Required) Rule identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get affiliation by ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get affiliation by ID.yml new file mode 100644 index 0000000000..b01fff138b --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get affiliation by ID.yml @@ -0,0 +1,146 @@ +info: + name: Get affiliation by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/affiliations/:affiliationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: affiliationId + value: e046d326-5421-45ab-95ae-f13d37f260b5 + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/affiliations/:affiliationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/affiliations/:affiliationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/affiliations/:affiliationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/affiliations/:affiliationId - Schema is valid", function () { + const schema = {"type":"object","description":"Affiliation by ID response body information.","required":["id","implementation","name","configuration","isdelivered","isConfigured"],"properties":{"id":{"type":"string","description":"Provider identification."},"implementation":{"type":"string","description":"Provider implementation class name."},"name":{"type":"string","description":"Provider name."},"configuration":{"type":"array","description":"Array containing provider configuration information.","items":{"type":"object","description":"Provider configuration information.","required":["name","value","valueKey"],"properties":{"name":{"type":"string","description":"Configuration parameter name."},"value":{"type":"string","description":"Configuration parameter value."},"valueKey":{"type":["string","null"],"description":"Value key information."}}}},"isdelivered":{"type":"boolean","description":"Indicates whether the provider is published and available for use."},"isConfigured":{"type":"boolean","description":"Indicates whether the provider is configured."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns data for a specific affiliation (payment or anti-fraud provider). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `affiliationId` | path | (Required) Affiliation (payment or anti-fraud provider) identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "fg8b4ea5-0b24-47dc-971e-2f6635ea1f14", + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "name": "CieloV3 - Test", + "configuration": [ + { + "name": "HowTo", + "value": "https://developercielo.github.io/payment-method-enablement/", + "valueKey": null + }, + { + "name": "MerchantId", + "value": "sampleData_2", + "valueKey": null + }, + { + "name": "MerchantKey", + "value": "**********", + "valueKey": null + }, + { + "name": "softDescriptor", + "value": "teste_update", + "valueKey": null + }, + { + "name": "bankInvoiceProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "bankIDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "useEarlySecurityCapture", + "value": "0", + "valueKey": null + }, + { + "name": "isProduction", + "value": "false", + "valueKey": null + }, + { + "name": "bankDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "Registered", + "value": "false", + "valueKey": null + } + ], + "isdelivered": true, + "isConfigured": true + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get card data.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get card data.yml new file mode 100644 index 0000000000..187012d949 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get card data.yml @@ -0,0 +1,124 @@ +info: + name: Get card data + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/api/payments/pvt/account/:cardId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cardId + value: 719f3698-d8cb-41af-13a7-41f63982bcd2 + type: path + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/payments/pvt/account/:cardId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/payments/pvt/account/:cardId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/payments/pvt/account/:cardId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/payments/pvt/account/:cardId - Schema is valid", function () { + const schema = {"type":"object","properties":{"bin":{"type":"string","description":"First six digits of the card number."},"lastDigits":{"type":"string","description":"Last four digits of the card."},"expiryMonth":{"type":"string","description":"Card expiration month (2-digits)."},"expiryYear":{"type":"string","description":"Card expiration year (4-digits)."},"mask":{"type":"string","description":"Masked card number."},"paymentSystem":{"type":"integer","description":"Payment system ID in the Payment Gateway."},"paymentSystemName":{"type":"string","description":"Payment system name (card brand)."},"address":{"type":"object","description":"Card address (optional).","properties":{"addressType":{"type":"string","description":"Address type.","enum":["Residential","Commercial"]},"addressId":{"type":"string","description":"Address ID."},"postalCode":{"type":"string","description":"Postal code."},"street":{"type":"string","description":"Street name."},"neighborhood":{"type":"string","description":"Neighborhood name."},"city":{"type":"string","description":"City name."},"state":{"type":"string","description":"State or province."},"country":{"type":"string","description":"Country code."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Address complement."}}},"document":{"type":"string","description":"Card holder's document."},"tokens":{"type":"object","description":"Card tokens information (optional).","properties":{"providerId":{"type":"string","description":"Name of the connector's owner account (`accountName`) used to create the token."},"type":{"type":"string","description":"Token type stored in the vault.","enum":["FILE","TOKEN_CLIENT_ID","TOKEN_VALUE"]},"value":{"type":"string","description":"Token value."},"expiration":{"type":"string","description":"Token expiration date in `YYYY-MM` format."},"label":{"type":"string","description":"Token alias (an alternative name to simplify token identification)."},"href":{"type":"string","description":"URL of the token file stored by the provider."},"providerCardTokenId":{"type":"string","description":"Client ID used to retrieve the token from the provider."},"useCvvForAuthorization":{"type":"boolean","description":"Flag indicating if CVV is required (`true`) or not (`false`)."},"extraData":{"type":"object","description":"Additional metadata stored with the token.","properties":{"customField1":{"type":"string","description":"Custom field information."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the public data of a specific credit card stored in the store. + + Before consulting the card details, consider the following information: + - Sensitive data such as full card number and CVV are not returned. + - The `tokens` field is optional. It is included in the response only if the card you are retrieving has already been tokenized. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ViewPaymentData | **View Payment Data** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `cardId` | path | (Required) Card identification. This is the `accountId` associated with the client's profile, which can be viewed by accessing [Profile System](https://developers.vtex.com/docs/guides/profile-system#profile-system-api-reference). As a client can have more than one card registered in their profile, check the desired `accountId` and send it in this request. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "bin": "370176", + "lastDigits": "3550", + "expiryMonth": "12", + "expiryYear": "2025", + "mask": "XXXX-XXXX-XXXX-1111", + "paymentSystem": 2, + "paymentSystemName": "Visa", + "address": { + "addressType": "Residential", + "addressId": "address-id", + "postalCode": "00000-000", + "street": "Av. Example", + "neighborhood": "Centro", + "city": "Example City", + "state": "SP", + "country": "BRA", + "number": "1000", + "complement": "Apt 1" + }, + "document": "12345678900", + "tokens": { + "providerId": "cosmetics2", + "type": "TOKEN_VALUE", + "value": "token-value", + "expiration": "2025-12", + "label": "Primary card", + "href": "https://provider.example/token-file", + "providerCardTokenId": "provider-token-id", + "useCvvForAuthorization": false, + "extraData": { + "customField1": "value1", + "customField2": "value2" + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get payment rule by ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get payment rule by ID.yml new file mode 100644 index 0000000000..d50931ea8d --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Get payment rule by ID.yml @@ -0,0 +1,175 @@ +info: + name: Get payment rule by ID + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/rules/:ruleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ruleId + value: fe6c470b-f80b-4bb1-a75c-378617f8767a + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/rules/:ruleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/rules/:ruleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/rules/:ruleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/rules/:ruleId - Schema is valid", function () { + const schema = {"required":["id","name","salesChannels","paymentSystem","connector","issuer","antifraud","installmentOptions","isSelfAuthorized","requiresAuthentication","enabled","installmentsService","isDefault","beginDate","endDate","condition","multiMerchantList","country","dateIntervals"],"type":"object","description":"Payment rules information.","properties":{"id":{"type":"string","description":"Rule identification."},"name":{"type":"string","description":"Rule name."},"salesChannels":{"type":"array","description":"Array containing information about the Sales channel.","items":{"type":"object","description":"Sales channel information.","required":["id"],"properties":{"id":{"type":"string","description":"Sales channel identification."}}}},"paymentSystem":{"required":["id","name","implementation"],"type":"object","description":"Payment system information.","properties":{"id":{"type":"number","description":"Payment system identification."},"name":{"type":"string","description":"Payment system name."},"implementation":{"type":["string","null"],"description":"Payment system implementation class name."}}},"connector":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Connector (payment provider) information.","properties":{"implementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"affiliationId":{"type":"string","description":"Affiliation connector (payment provider) identification."}}},"issuer":{"required":["name"],"type":"object","description":"Card issuer information.","properties":{"name":{"type":["string","null"],"description":"Card issuer name."}}},"antifraud":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Anti-fraud information.","properties":{"implementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (anti-fraud provider) identification."}}},"installmentOptions":{"required":["dueDateType","interestRateMethod","minimumInstallmentValue","installments"],"type":["object","null"],"description":"Installment options information.","properties":{"dueDateType":{"type":"number","description":"Indicates whether the billing date will be at the end (0) or beginning of the period (1).","enum":[0,1]},"interestRateMethod":{"type":["number","null"],"description":"Indicates the type of interest to calculate the value of the installments (Compound Interest = `null` or `0`, Simple Interest Rate with Tax = `1` and Single Interest = `2`).","enum":[null,0,1,2]},"minimumInstallmentValue":{"type":"number","description":"Minimum value of each installment."},"installments":{"type":"array","description":"Array containing installments information.","items":{"required":["ruleId","quantity","value","interestRate","isExternalInstallmentService","interestTax"],"type":"object","description":"Installments information.","properties":{"ruleId":{"type":["string","null"],"description":"Rule identification."},"quantity":{"type":"integer","description":"Number of installments."},"value":{"type":"number","description":"Value of each installment."},"interestRate":{"type":"number","description":"Interest rate (percent 0.1 = 10%)."},"isExternalInstallmentService":{"type":["number","null"],"description":"Indicates the external installment system (if applicable)."},"interestTax":{"type":["number","null"],"description":"Interest tax (percent 0.1 = 10%)."}}}}}},"isSelfAuthorized":{"type":["boolean","null"],"description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":["boolean","null"],"description":"Indicates whether it is necessary to log in to make the payment."},"enabled":{"type":"boolean","description":"Indicates whether the rule is enabled in the store."},"installmentsService":{"type":"boolean","description":"Indicates whether any specific type of installment service is used."},"isDefault":{"type":["boolean","null"],"description":"Indicates whether this rule should be considered the default for a given payment condition."},"beginDate":{"type":["string","null"],"description":"Rule start date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"endDate":{"type":["string","null"],"description":"Rule end date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"condition":{"required":["id","pullRate","name"],"type":["object","null"],"description":"Commercial condition information.","properties":{"id":{"type":"string","description":"Commercial condition identification."},"pullRate":{"type":"number","description":"Indicates the minimum percentage of SKUs required in the cart using this commercial condition for it to be activated."},"name":{"type":["string","null"],"description":"Commercial condition information."}}},"multiMerchantList":{"type":["array","null"],"description":"Indicates the names of the accounts to which the rule is being applied exclusively.","items":{"type":"string","description":"Account names."}},"country":{"required":["name","isoCode"],"type":["object","null"],"description":"Information about rule application in a country.","properties":{"name":{"type":["string","null"],"description":"Country name."},"isoCode":{"type":"string","description":"Country code (ISO 3166 alpha-2)."}}},"dateIntervals":{"type":["array","null"],"description":"Array containing information about the periods (days and hours) in which the rule is enabled.","items":{"required":["start","end"],"type":"object","description":"Rule enablement period information.","properties":{"start":{"type":"string","description":"Time, days of the week, and GMT time zone in which the rule is activated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."},"end":{"type":"string","description":"Time, days of the week and GMT time zone in which the rule is deactivated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."}}}},"externalInterest":{"type":"boolean","description":"Indicates whether interest can be calculated externally."},"minimumValue":{"type":["number","null"],"description":"Minimum payment transaction amount for the rule to be applied."},"deadlines":{"type":"array","description":"Array containing information about the payment deadlines (applicable for credit payment method).","items":{"type":"object","description":"Payment deadlines information.","required":["paymentOptions"],"properties":{"paymentOptions":{"type":"array","description":"Array containing payment options information.","items":{"required":["days","interestRate"],"type":"object","description":"Payment options information.","properties":{"days":{"type":"number","description":"Deadline in days to make payment."},"interestRate":{"type":"number","description":"Interest rate applied (in percentage, e.g. `3.0` means 3%)."}}}}}}},"cobrand":{"required":["name"],"type":"object","description":"Information about the cobranded card.","properties":{"name":{"type":["string","null"],"description":"Card name."}}},"cardLevel":{"required":["name"],"type":"object","description":"Information about the card category.","properties":{"name":{"type":["string","null"],"description":"Card category name (e.g. standard, gold, premium)."}}},"excludedBinsRanges":{"type":["number","null"],"description":"Range of card bins excluded from application of this rule."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns data for a specific payment rule applied to the payment providers configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ruleId` | path | (Required) Rule identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "9e11ed95-4b7f-4445-a53e-2512f260ff1c", + "name": "American Express - ", + "salesChannels": [ + { + "id": ":ALL:" + } + ], + "paymentSystem": { + "id": 1, + "name": "American Express", + "implementation": null + }, + "connector": { + "implementation": "Vtex.PaymentGateway.Connectors.AuthorizeDotNet.AuthorizeDotNetConnector", + "affiliationId": "08a0844b-4aab-4f1b-beed-b3889649534b" + }, + "issuer": { + "name": null + }, + "antifraud": { + "implementation": null, + "affiliationId": null + }, + "installmentOptions": { + "dueDateType": 0, + "interestRateMethod": 0, + "minimumInstallmentValue": 1, + "installments": [ + { + "ruleId": null, + "quantity": 12, + "value": 0, + "interestRate": 1.86, + "isExternalInstallmentService": null, + "interestTax": 0 + }, + { + "ruleId": null, + "quantity": 18, + "value": 0, + "interestRate": 1.9, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + "isSelfAuthorized": null, + "requiresAuthentication": null, + "enabled": true, + "installmentsService": false, + "isDefault": null, + "beginDate": "2023-12-10T17:00:00Z", + "endDate": "2023-12-22T01:00:00Z", + "condition": { + "id": "1", + "pullRate": 0, + "name": null + }, + "multiMerchantList": [ + "test_store_1", + "test_store_2" + ], + "country": { + "name": null, + "isoCode": "us" + }, + "dateIntervals": [ + { + "start": "* * 11 * * 1,3,4 * -0300", + "end": "* * 18 * * 1,3,4 * -0300" + }, + { + "start": "* * 05 * * * * -0300", + "end": "* * 23 * * * * -0300" + } + ], + "externalInterest": false, + "minimumValue": null, + "deadlines": [], + "cobrand": { + "name": null + }, + "cardLevel": { + "name": "Premium" + }, + "excludedBinsRanges": null + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert a new payment rule.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert a new payment rule.yml new file mode 100644 index 0000000000..235cf7f3ce --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert a new payment rule.yml @@ -0,0 +1,239 @@ +info: + name: Insert a new payment rule + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/rules" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "name": "Test_API_2", + "salesChannels": [ + { + "id": "1" + } + ], + "paymentSystem": { + "id": 8, + "name": "Hipercard", + "implementation": null + }, + "connector": { + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "affiliationId": "0a8488e6-0c30-4150-be96-b0dcaaa6a0cd" + }, + "issuer": { + "name": "barclays" + }, + "antifraud": { + "implementation": null, + "affiliationId": null + }, + "installmentOptions": { + "dueDateType": 1, + "interestRateMethod": 2, + "minimumInstallmentValue": 50, + "installments": [ + { + "ruleId": null, + "quantity": 6, + "value": 0, + "interestRate": 15, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + "isSelfAuthorized": null, + "requiresAuthentication": null, + "enabled": false, + "installmentsService": false, + "isDefault": null, + "beginDate": "2023-12-10T17:00:00Z", + "endDate": "2023-12-22T01:00:00Z", + "condition": { + "id": "1", + "pullRate": 0, + "name": null + }, + "multiMerchantList": [ + "cosmetics2" + ], + "country": { + "name": null, + "isoCode": "us" + }, + "dateIntervals": [ + { + "start": "* * 11 * * 1,3,4 * -0300", + "end": "* * 18 * * 1,3,4 * -0300" + }, + { + "start": "* * 05 * * * * -0300", + "end": "* * 23 * * * * -0300" + } + ], + "externalInterest": false, + "minimumValue": null, + "deadlines": [], + "cobrand": { + "name": null + }, + "cardLevel": { + "name": "business" + }, + "excludedBinsRanges": null + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/rules - Schema is valid", function () { + const schema = {"required":["id","name","salesChannels","paymentSystem","connector","issuer","antifraud","installmentOptions","isSelfAuthorized","requiresAuthentication","enabled","installmentsService","isDefault","beginDate","endDate","condition","multiMerchantList","country","dateIntervals"],"type":"object","description":"Payment rules information.","properties":{"id":{"type":"string","description":"Rule identification."},"name":{"type":"string","description":"Rule name."},"salesChannels":{"type":"array","description":"Array containing information about the Sales channel.","items":{"type":"object","description":"Sales channel information.","required":["id"],"properties":{"id":{"type":"string","description":"Sales channel identification."}}}},"paymentSystem":{"required":["id","name","implementation"],"type":"object","description":"Payment system information.","properties":{"id":{"type":"number","description":"Payment system identification."},"name":{"type":"string","description":"Payment system name."},"implementation":{"type":["string","null"],"description":"Payment system implementation class name."}}},"connector":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Connector (payment provider) information.","properties":{"implementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"affiliationId":{"type":"string","description":"Affiliation connector (payment provider) identification."}}},"issuer":{"required":["name"],"type":"object","description":"Card issuer information.","properties":{"name":{"type":["string","null"],"description":"Card issuer name."}}},"antifraud":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Anti-fraud information.","properties":{"implementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (anti-fraud provider) identification."}}},"installmentOptions":{"required":["dueDateType","interestRateMethod","minimumInstallmentValue","installments"],"type":["object","null"],"description":"Installment options information.","properties":{"dueDateType":{"type":"number","description":"Indicates whether the billing date will be at the end (0) or beginning of the period (1).","enum":[0,1]},"interestRateMethod":{"type":["number","null"],"description":"Indicates the type of interest to calculate the value of the installments (Compound Interest = `null` or `0`, Simple Interest Rate with Tax = `1` and Single Interest = `2`).","enum":[null,0,1,2]},"minimumInstallmentValue":{"type":"number","description":"Minimum value of each installment."},"installments":{"type":"array","description":"Array containing installments information.","items":{"required":["ruleId","quantity","value","interestRate","isExternalInstallmentService","interestTax"],"type":"object","description":"Installments information.","properties":{"ruleId":{"type":["string","null"],"description":"Rule identification."},"quantity":{"type":"integer","description":"Number of installments."},"value":{"type":"number","description":"Value of each installment."},"interestRate":{"type":"number","description":"Interest rate (percent 0.1 = 10%)."},"isExternalInstallmentService":{"type":["number","null"],"description":"Indicates the external installment system (if applicable)."},"interestTax":{"type":["number","null"],"description":"Interest tax (percent 0.1 = 10%)."}}}}}},"isSelfAuthorized":{"type":["boolean","null"],"description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":["boolean","null"],"description":"Indicates whether it is necessary to log in to make the payment."},"enabled":{"type":"boolean","description":"Indicates whether the rule is enabled in the store."},"installmentsService":{"type":"boolean","description":"Indicates whether any specific type of installment service is used."},"isDefault":{"type":["boolean","null"],"description":"Indicates whether this rule should be considered the default for a given payment condition."},"beginDate":{"type":["string","null"],"description":"Rule start date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"endDate":{"type":["string","null"],"description":"Rule end date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"condition":{"required":["id","pullRate","name"],"type":["object","null"],"description":"Commercial condition information.","properties":{"id":{"type":"string","description":"Commercial condition identification."},"pullRate":{"type":"number","description":"Indicates the minimum percentage of SKUs required in the cart using this commercial condition for it to be activated."},"name":{"type":["string","null"],"description":"Commercial condition information."}}},"multiMerchantList":{"type":["array","null"],"description":"Indicates the names of the accounts to which the rule is being applied exclusively.","items":{"type":"string","description":"Account names."}},"country":{"required":["name","isoCode"],"type":["object","null"],"description":"Information about rule application in a country.","properties":{"name":{"type":["string","null"],"description":"Country name."},"isoCode":{"type":"string","description":"Country code (ISO 3166 alpha-2)."}}},"dateIntervals":{"type":["array","null"],"description":"Array containing information about the periods (days and hours) in which the rule is enabled.","items":{"required":["start","end"],"type":"object","description":"Rule enablement period information.","properties":{"start":{"type":"string","description":"Time, days of the week, and GMT time zone in which the rule is activated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."},"end":{"type":"string","description":"Time, days of the week and GMT time zone in which the rule is deactivated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."}}}},"externalInterest":{"type":"boolean","description":"Indicates whether interest can be calculated externally."},"minimumValue":{"type":["number","null"],"description":"Minimum payment transaction amount for the rule to be applied."},"deadlines":{"type":"array","description":"Array containing information about the payment deadlines (applicable for credit payment method).","items":{"type":"object","description":"Payment deadlines information.","required":["paymentOptions"],"properties":{"paymentOptions":{"type":"array","description":"Array containing payment options information.","items":{"required":["days","interestRate"],"type":"object","description":"Payment options information.","properties":{"days":{"type":"number","description":"Deadline in days to make payment."},"interestRate":{"type":"number","description":"Interest rate applied (in percentage, e.g. `3.0` means 3%)."}}}}}}},"cobrand":{"required":["name"],"type":"object","description":"Information about the cobranded card.","properties":{"name":{"type":["string","null"],"description":"Card name."}}},"cardLevel":{"required":["name"],"type":"object","description":"Information about the card category.","properties":{"name":{"type":["string","null"],"description":"Card category name (e.g. standard, gold, premium)."}}},"excludedBinsRanges":{"type":["number","null"],"description":"Range of card bins excluded from application of this rule."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new payment rule to be applied to the payment providers configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ManageStore | **Manage Store** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "c997267e-39bf-4217-a890-a503f6a7dc47", + "name": "Test_API_2", + "salesChannels": [ + { + "id": "1" + } + ], + "paymentSystem": { + "id": 8, + "name": "Hipercard", + "implementation": null + }, + "connector": { + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "affiliationId": "0a8488e6-0c30-4150-be96-b0dcaaa6a0cd" + }, + "issuer": { + "name": "barclays" + }, + "antifraud": null, + "installmentOptions": { + "dueDateType": 1, + "interestRateMethod": 2, + "minimumInstallmentValue": 50, + "installments": [ + { + "ruleId": null, + "quantity": 6, + "value": 0, + "interestRate": 15, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + "isSelfAuthorized": null, + "requiresAuthentication": null, + "enabled": false, + "installmentsService": false, + "isDefault": null, + "beginDate": "2023-12-10T17:00:00Z", + "endDate": "2023-12-22T01:00:00Z", + "condition": { + "id": "1", + "pullRate": 0, + "name": null + }, + "multiMerchantList": [ + "cosmetics2" + ], + "country": { + "name": null, + "isoCode": "us" + }, + "dateIntervals": [ + { + "start": "* * 11 * * 1,3,4 * -0300", + "end": "* * 18 * * 1,3,4 * -0300" + }, + { + "start": "* * 05 * * * * -0300", + "end": "* * 23 * * * * -0300" + } + ], + "externalInterest": false, + "minimumValue": null, + "deadlines": [], + "cobrand": { + "name": null + }, + "cardLevel": { + "name": "business" + }, + "excludedBinsRanges": null + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert new affiliation.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert new affiliation.yml new file mode 100644 index 0000000000..f6bece8b9e --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Insert new affiliation.yml @@ -0,0 +1,192 @@ +info: + name: Insert new affiliation + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/affiliations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "name": "CieloV3 - Test", + "configuration": [ + { + "name": "HowTo", + "value": "https://developercielo.github.io/payment-method-enablement/" + }, + { + "name": "MerchantId", + "value": "sampleData" + }, + { + "name": "MerchantKey", + "value": "**********" + }, + { + "name": "softDescriptor", + "value": "teste" + }, + { + "name": "bankInvoiceProvider", + "value": "Disabled" + }, + { + "name": "bankIDebitProvider", + "value": "Disabled" + }, + { + "name": "useEarlySecurityCapture", + "value": "0" + }, + { + "name": "isProduction", + "value": "false" + }, + { + "name": "bankDebitProvider", + "value": "Disabled" + }, + { + "name": "Registered", + "value": "false" + } + ], + "isdelivered": true, + "isConfigured": true + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/affiliations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/affiliations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/affiliations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/affiliations - Schema is valid", function () { + const schema = {"type":"object","description":"Affiliation by ID response body information.","required":["id","implementation","name","configuration","isdelivered","isConfigured"],"properties":{"id":{"type":"string","description":"Provider identification."},"implementation":{"type":"string","description":"Provider implementation class name."},"name":{"type":"string","description":"Provider name."},"configuration":{"type":"array","description":"Array containing provider configuration information.","items":{"type":"object","description":"Provider configuration information.","required":["name","value","valueKey"],"properties":{"name":{"type":"string","description":"Configuration parameter name."},"value":{"type":"string","description":"Configuration parameter value."},"valueKey":{"type":["string","null"],"description":"Value key information."}}}},"isdelivered":{"type":"boolean","description":"Indicates whether the provider is published and available for use."},"isConfigured":{"type":"boolean","description":"Indicates whether the provider is configured."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers a new affiliation (payment or anti-fraud provider) in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ManageStore | **Manage Store** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "fg8b4ea5-0b24-47dc-971e-2f6635ea1f14", + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "name": "CieloV3 - Test", + "configuration": [ + { + "name": "HowTo", + "value": "https://developercielo.github.io/payment-method-enablement/", + "valueKey": null + }, + { + "name": "MerchantId", + "value": "sampleData", + "valueKey": null + }, + { + "name": "MerchantKey", + "value": "**********", + "valueKey": null + }, + { + "name": "softDescriptor", + "value": "teste", + "valueKey": null + }, + { + "name": "bankInvoiceProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "bankIDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "useEarlySecurityCapture", + "value": "0", + "valueKey": null + }, + { + "name": "isProduction", + "value": "false", + "valueKey": null + }, + { + "name": "bankDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "Registered", + "value": "false", + "valueKey": null + } + ], + "isdelivered": true, + "isConfigured": true + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all affiliations.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all affiliations.yml new file mode 100644 index 0000000000..e7849c2e88 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all affiliations.yml @@ -0,0 +1,81 @@ +info: + name: List all affiliations + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/affiliations" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/affiliations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/affiliations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/affiliations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/affiliations - Schema is valid", function () { + const schema = {"type":"array","required":["id","implementation","name","configuration","isdelivered","isConfigured"],"items":{"type":"object","description":"Affiliations information.","properties":{"id":{"type":"string","description":"Provider identification."},"implementation":{"type":"string","description":"Provider implementation class name."},"name":{"type":"string","description":"Provider name."},"configuration":{"type":"array","description":"Array containing configuration information fields.","items":{"type":"object","description":"Provider configuration information.","required":["name","value","valueKey"],"properties":{"name":{"type":"string","description":"Configuration parameter name."},"value":{"type":["string","null"],"description":"Configuration parameter value."},"valueKey":{"type":["string","null"],"description":"Value key information."}}}},"isdelivered":{"type":"boolean","description":"Indicates whether the provider is published and available for use."},"isConfigured":{"type":"boolean","description":"Indicates whether the provider is configured."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all affiliations (payment and anti-fraud providers) that are already configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 8 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all available payment methods.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all available payment methods.yml new file mode 100644 index 0000000000..56302764fe --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all available payment methods.yml @@ -0,0 +1,87 @@ +info: + name: List all available payment methods + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/merchants/payment-systems" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: salesChannel + value: "1" + type: query + disabled: true + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/merchants/payment-systems - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/merchants/payment-systems - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/merchants/payment-systems - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/merchants/payment-systems - Schema is valid", function () { + const schema = {"type":"array","description":"Payment methods information.","items":{"required":["id","name","requiresDocument","implementation","connectorImplementation","antifraudConnectorImplementation","groupName","redirect","isCustom","isSelfAuthorized","requiresAuthentication","allowInstallments","allowBinExclusion","allowMultiple","allowIssuer","allowCountry","allowCommercialPolicy","allowCommercialCondition","allowPeriod","isAvailable","description","supportRecurrence","validator","appDependencies","displayDocument","dueDate","allowNotification","affiliationId","availablePayments","dueDateMinutes"],"type":"object","description":"Available payment methods response body information.","properties":{"id":{"type":"number","description":"Payment method identification."},"name":{"type":"string","description":"Payment method name."},"requiresDocument":{"type":"boolean","description":"Indicates whether a document is required."},"implementation":{"type":"string","description":"Payment method implementation class name."},"connectorImplementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"antifraudConnectorImplementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"groupName":{"type":"string","description":"Payment group name."},"redirect":{"type":"boolean","description":"Indicates whether the payment method allows redirection."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"isSelfAuthorized":{"type":"boolean","description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether it is necessary to log in to make the payment."},"allowInstallments":{"type":"boolean","description":"Indicates whether the payment method allows installments."},"allowBinExclusion":{"type":"boolean","description":"Indicates whether it is possible to restrict the use of specific BIN codes (only applicable for cards)."},"allowMultiple":{"type":"boolean","description":"Indicates whether the method allows multiple payments. Example of `false`: debit card."},"allowIssuer":{"type":"boolean","description":"Indicates whether it is possible to identify the name of the bank responsible for issuing the card."},"allowCountry":{"type":"boolean","description":"Indicates whether it is possible to restrict a payment rule by the country where the purchase is made."},"allowCommercialPolicy":{"type":"boolean","description":"Indicates whether to restrict a payment rule by commercial policy type."},"allowCommercialCondition":{"type":"boolean","description":"Indicates whether to restrict a payment rule by commercial condition type."},"allowPeriod":{"type":"boolean","description":"Indicates whether it is possible to restrict a period for making the payment."},"isAvailable":{"type":"boolean","description":"Indicates whether the payment method is available for use."},"description":{"type":["string","null"],"description":"Description of the payment method."},"supportRecurrence":{"type":"boolean","description":"Indicates whether the payment method supports recurrence."},"validator":{"required":["regex","mask","cardCodeMask","cardCodeRegex","weights","useCvv","useExpirationDate","useCardHolderName","useBillingAddress","validCardLengths"],"type":"object","description":"Validator information.","properties":{"regex":{"type":["string","null"],"description":"[Regex](https://regexr.com/) information."},"mask":{"type":["string","null"],"description":"Validator mask."},"cardCodeMask":{"type":["string","null"],"description":"Card code regular mask."},"cardCodeRegex":{"type":["string","null"],"description":"Card code regular expression."},"weights":{"type":["array","null"],"description":"Array containing weigths information.","items":{"type":"integer","description":"Weigths information."}},"useCvv":{"type":"boolean","description":"Indicates whether it is necessary to use the CVV code to complete a transaction with payment made by card."},"useExpirationDate":{"type":"boolean","description":"Indicates whether it is necessary to use the expiration date to complete a card payment transaction."},"useCardHolderName":{"type":"boolean","description":"Indicates whether it is necessary to use the card holder name to complete a payment transaction made by card."},"useBillingAddress":{"type":"boolean","description":"Indicates whether it is necessary to use the billing address to complete a card payment transaction."},"validCardLengths":{"type":["string","null"],"description":"Information about valid card lengths."}}},"appDependencies":{"type":["string","null"],"description":"App dependencies information."},"displayDocument":{"type":"boolean","description":"Indicates whether a document is shown."},"dueDate":{"type":"string","description":"Payment due date."},"allowNotification":{"type":"boolean","description":"Indicates the possibility of payment notification (used by bank invoices and notes payable)."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (payment provider) identification."},"availablePayments":{"type":["string","null"],"description":"Information about payment availability."},"dueDateMinutes":{"type":"number","description":"Amount of time (in minutes) until the payment date (`dueDate`)."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all payment methods (such as Visa, Master, among others) that can be used in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `salesChannel` | query | Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) identification. This parameter must be filled in if you wish to obtain information on payment methods available in a specific store sales channel. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all payment rules.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all payment rules.yml new file mode 100644 index 0000000000..efb4e82235 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/List all payment rules.yml @@ -0,0 +1,81 @@ +info: + name: List all payment rules + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/rules" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/rules - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/rules - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/rules - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/rules - Schema is valid", function () { + const schema = {"required":["id","name","salesChannels","paymentSystem","connector","issuer","antifraud","installmentOptions","isSelfAuthorized","requiresAuthentication","enabled","installmentsService","isDefault","beginDate","endDate","condition","multiMerchantList","country","dateIntervals"],"type":"array","description":"Array containing payment rules information.","items":{"type":"object","description":"Payment rules information.","properties":{"id":{"type":"string","description":"Rule identification."},"name":{"type":"string","description":"Rule name."},"salesChannels":{"type":"array","description":"Array containing information about the Sales channel.","items":{"type":"object","description":"Sales channel information.","required":["id"],"properties":{"id":{"type":"string","description":"Sales channel identification."}}}},"paymentSystem":{"required":["id","name","implementation"],"type":"object","description":"Payment system information.","properties":{"id":{"type":"number","description":"Payment system identification."},"name":{"type":"string","description":"Payment system name."},"implementation":{"type":["string","null"],"description":"Payment system implementation class name."}}},"connector":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Connector (payment provider) information.","properties":{"implementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"affiliationId":{"type":"string","description":"Affiliation connector (payment provider) identification."}}},"issuer":{"required":["name"],"type":"object","description":"Card issuer information.","properties":{"name":{"type":["string","null"],"description":"Card issuer name."}}},"antifraud":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Anti-fraud information.","properties":{"implementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (anti-fraud provider) identification."}}},"installmentOptions":{"required":["dueDateType","interestRateMethod","minimumInstallmentValue","installments"],"type":["object","null"],"description":"Installment options information.","properties":{"dueDateType":{"type":"number","description":"Indicates whether the billing date will be at the end (0) or beginning of the period (1).","enum":[0,1]},"interestRateMethod":{"type":["number","null"],"description":"Indicates the type of interest to calculate the value of the installments (Compound Interest = `null` or `0`, Simple Interest Rate with Tax = `1` and Single Interest = `2`).","enum":[null,0,1,2]},"minimumInstallmentValue":{"type":"number","description":"Minimum value of each installment."},"installments":{"type":"array","description":"Array containing installments information.","items":{"required":["ruleId","quantity","value","interestRate","isExternalInstallmentService","interestTax"],"type":"object","description":"Installments information.","properties":{"ruleId":{"type":["string","null"],"description":"Rule identification."},"quantity":{"type":"integer","description":"Number of installments."},"value":{"type":"number","description":"Value of each installment."},"interestRate":{"type":"number","description":"Interest rate (percent 0.1 = 10%)."},"isExternalInstallmentService":{"type":["number","null"],"description":"Indicates the external installment system (if applicable)."},"interestTax":{"type":["number","null"],"description":"Interest tax (percent 0.1 = 10%)."}}}}}},"isSelfAuthorized":{"type":["boolean","null"],"description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":["boolean","null"],"description":"Indicates whether it is necessary to log in to make the payment."},"enabled":{"type":"boolean","description":"Indicates whether the rule is enabled in the store."},"installmentsService":{"type":"boolean","description":"Indicates whether any specific type of installment service is used."},"isDefault":{"type":["boolean","null"],"description":"Indicates whether this rule should be considered the default for a given payment condition."},"beginDate":{"type":["string","null"],"description":"Rule start date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"endDate":{"type":["string","null"],"description":"Rule end date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"condition":{"required":["id","pullRate","name"],"type":["object","null"],"description":"Commercial condition information.","properties":{"id":{"type":"string","description":"Commercial condition identification."},"pullRate":{"type":"number","description":"Indicates the minimum percentage of SKUs required in the cart using this commercial condition for it to be activated."},"name":{"type":["string","null"],"description":"Commercial condition information."}}},"multiMerchantList":{"type":["array","null"],"description":"Indicates the names of the accounts to which the rule is being applied exclusively.","items":{"type":"string","description":"Account names."}},"country":{"required":["name","isoCode"],"type":["object","null"],"description":"Information about rule application in a country.","properties":{"name":{"type":["string","null"],"description":"Country name."},"isoCode":{"type":"string","description":"Country code (ISO 3166 alpha-2)."}}},"dateIntervals":{"type":["array","null"],"description":"Array containing information about the periods (days and hours) in which the rule is enabled.","items":{"required":["start","end"],"type":"object","description":"Rule enablement period information.","properties":{"start":{"type":"string","description":"Time, days of the week, and GMT time zone in which the rule is activated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."},"end":{"type":"string","description":"Time, days of the week and GMT time zone in which the rule is deactivated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."}}}},"externalInterest":{"type":"boolean","description":"Indicates whether interest can be calculated externally."},"minimumValue":{"type":["number","null"],"description":"Minimum payment transaction amount for the rule to be applied."},"deadlines":{"type":"array","description":"Array containing information about the payment deadlines (applicable for credit payment method).","items":{"type":"object","description":"Payment deadlines information.","required":["paymentOptions"],"properties":{"paymentOptions":{"type":"array","description":"Array containing payment options information.","items":{"required":["days","interestRate"],"type":"object","description":"Payment options information.","properties":{"days":{"type":"number","description":"Deadline in days to make payment."},"interestRate":{"type":"number","description":"Interest rate applied (in percentage, e.g. `3.0` means 3%)."}}}}}}},"cobrand":{"required":["name"],"type":"object","description":"Information about the cobranded card.","properties":{"name":{"type":["string","null"],"description":"Card name."}}},"cardLevel":{"required":["name"],"type":"object","description":"Information about the card category.","properties":{"name":{"type":["string","null"],"description":"Card category name (e.g. standard, gold, premium)."}}},"excludedBinsRanges":{"type":["number","null"],"description":"Range of card bins excluded from application of this rule."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all payment rules applied to the payment providers configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 14 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update affiliation by ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update affiliation by ID.yml new file mode 100644 index 0000000000..b52b9d63f5 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update affiliation by ID.yml @@ -0,0 +1,208 @@ +info: + name: Update affiliation by ID + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/api/pvt/affiliations/:affiliationId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: affiliationId + value: e046d326-5421-45ab-95ae-f13d37f260b5 + type: path + body: + type: json + data: |- + { + "id": "fg8b4ea5-0b24-47dc-971e-2f6635ea1f14", + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "name": "CieloV3 - Test", + "configuration": [ + { + "name": "HowTo", + "value": "https://developercielo.github.io/payment-method-enablement/", + "valueKey": null + }, + { + "name": "MerchantId", + "value": "sampleData", + "valueKey": null + }, + { + "name": "MerchantKey", + "value": "**********", + "valueKey": null + }, + { + "name": "softDescriptor", + "value": "teste", + "valueKey": null + }, + { + "name": "bankInvoiceProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "bankIDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "useEarlySecurityCapture", + "value": "0", + "valueKey": null + }, + { + "name": "isProduction", + "value": "false", + "valueKey": null + }, + { + "name": "bankDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "Registered", + "value": "false", + "valueKey": null + } + ], + "isdelivered": true, + "isConfigured": true + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/pvt/affiliations/:affiliationId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/pvt/affiliations/:affiliationId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/pvt/affiliations/:affiliationId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/pvt/affiliations/:affiliationId - Schema is valid", function () { + const schema = {"type":"object","description":"Affiliation by ID response body information.","required":["id","implementation","name","configuration","isdelivered","isConfigured"],"properties":{"id":{"type":"string","description":"Provider identification."},"implementation":{"type":"string","description":"Provider implementation class name."},"name":{"type":"string","description":"Provider name."},"configuration":{"type":"array","description":"Array containing provider configuration information.","items":{"type":"object","description":"Provider configuration information.","required":["name","value","valueKey"],"properties":{"name":{"type":"string","description":"Configuration parameter name."},"value":{"type":"string","description":"Configuration parameter value."},"valueKey":{"type":["string","null"],"description":"Value key information."}}}},"isdelivered":{"type":"boolean","description":"Indicates whether the provider is published and available for use."},"isConfigured":{"type":"boolean","description":"Indicates whether the provider is configured."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information about an affiliation (payment or anti-fraud provider) configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ManageStore | **Manage Store** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `affiliationId` | path | (Required) Affiliation (payment or anti-fraud provider) identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "fg8b4ea5-0b24-47dc-971e-2f6635ea1f14", + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "name": "CieloV3 - Test", + "configuration": [ + { + "name": "HowTo", + "value": "https://developercielo.github.io/payment-method-enablement/", + "valueKey": null + }, + { + "name": "MerchantId", + "value": "sampleData_2", + "valueKey": null + }, + { + "name": "MerchantKey", + "value": "**********", + "valueKey": null + }, + { + "name": "softDescriptor", + "value": "teste_update", + "valueKey": null + }, + { + "name": "bankInvoiceProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "bankIDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "useEarlySecurityCapture", + "value": "0", + "valueKey": null + }, + { + "name": "isProduction", + "value": "false", + "valueKey": null + }, + { + "name": "bankDebitProvider", + "value": "Disabled", + "valueKey": null + }, + { + "name": "Registered", + "value": "false", + "valueKey": null + } + ], + "isdelivered": true, + "isConfigured": true + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update payment rule by ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update payment rule by ID.yml new file mode 100644 index 0000000000..6beb3be91c --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/Update payment rule by ID.yml @@ -0,0 +1,238 @@ +info: + name: Update payment rule by ID + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/pvt/rules/:ruleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ruleId + value: fe6c470b-f80b-4bb1-a75c-378617f8767a + type: path + body: + type: json + data: |- + { + "id": "c997267e-39bf-4217-a890-a503f6a7dc47", + "name": "Test_API_2_Updated", + "salesChannels": [ + { + "id": "1" + } + ], + "paymentSystem": { + "id": 8, + "name": "Hipercard", + "implementation": null + }, + "connector": { + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "affiliationId": "0a8488e6-0c30-4150-be96-b0dcaaa6a0cd" + }, + "issuer": { + "name": "barclays" + }, + "antifraud": null, + "installmentOptions": { + "dueDateType": 0, + "interestRateMethod": 1, + "minimumInstallmentValue": 400, + "installments": [ + { + "ruleId": null, + "quantity": 12, + "value": 0, + "interestRate": 25, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + "isSelfAuthorized": null, + "requiresAuthentication": null, + "enabled": false, + "installmentsService": false, + "isDefault": null, + "beginDate": "2023-12-15T17:00:00Z", + "endDate": "2023-12-30T01:00:00Z", + "condition": { + "id": "1", + "pullRate": 15, + "name": null + }, + "multiMerchantList": [], + "country": { + "name": null, + "isoCode": "br" + }, + "dateIntervals": [ + { + "start": "* * 12 * * 1,3,4 * -0300", + "end": "* * 19 * * 1,3,4 * -0300" + }, + { + "start": "* * 09 * * * * -0300", + "end": "* * 21 * * * * -0300" + } + ], + "externalInterest": false, + "minimumValue": null, + "deadlines": [], + "cobrand": { + "name": null + }, + "cardLevel": { + "name": "gold" + }, + "excludedBinsRanges": null + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/pvt/rules/:ruleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/pvt/rules/:ruleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/pvt/rules/:ruleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/pvt/rules/:ruleId - Schema is valid", function () { + const schema = {"required":["id","name","salesChannels","paymentSystem","connector","issuer","antifraud","installmentOptions","isSelfAuthorized","requiresAuthentication","enabled","installmentsService","isDefault","beginDate","endDate","condition","multiMerchantList","country","dateIntervals"],"type":"object","description":"Payment rules information.","properties":{"id":{"type":"string","description":"Rule identification."},"name":{"type":"string","description":"Rule name."},"salesChannels":{"type":"array","description":"Array containing information about the Sales channel.","items":{"type":"object","description":"Sales channel information.","required":["id"],"properties":{"id":{"type":"string","description":"Sales channel identification."}}}},"paymentSystem":{"required":["id","name","implementation"],"type":"object","description":"Payment system information.","properties":{"id":{"type":"number","description":"Payment system identification."},"name":{"type":"string","description":"Payment system name."},"implementation":{"type":["string","null"],"description":"Payment system implementation class name."}}},"connector":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Connector (payment provider) information.","properties":{"implementation":{"type":"string","description":"Connector (payment provider) implementation class name."},"affiliationId":{"type":"string","description":"Affiliation connector (payment provider) identification."}}},"issuer":{"required":["name"],"type":"object","description":"Card issuer information.","properties":{"name":{"type":["string","null"],"description":"Card issuer name."}}},"antifraud":{"required":["implementation","affiliationId"],"type":["object","null"],"description":"Anti-fraud information.","properties":{"implementation":{"type":["string","null"],"description":"Connector (anti-fraud provider) implementation class name."},"affiliationId":{"type":["string","null"],"description":"Affiliation connector (anti-fraud provider) identification."}}},"installmentOptions":{"required":["dueDateType","interestRateMethod","minimumInstallmentValue","installments"],"type":["object","null"],"description":"Installment options information.","properties":{"dueDateType":{"type":"number","description":"Indicates whether the billing date will be at the end (0) or beginning of the period (1).","enum":[0,1]},"interestRateMethod":{"type":["number","null"],"description":"Indicates the type of interest to calculate the value of the installments (Compound Interest = `null` or `0`, Simple Interest Rate with Tax = `1` and Single Interest = `2`).","enum":[null,0,1,2]},"minimumInstallmentValue":{"type":"number","description":"Minimum value of each installment."},"installments":{"type":"array","description":"Array containing installments information.","items":{"required":["ruleId","quantity","value","interestRate","isExternalInstallmentService","interestTax"],"type":"object","description":"Installments information.","properties":{"ruleId":{"type":["string","null"],"description":"Rule identification."},"quantity":{"type":"integer","description":"Number of installments."},"value":{"type":"number","description":"Value of each installment."},"interestRate":{"type":"number","description":"Interest rate (percent 0.1 = 10%)."},"isExternalInstallmentService":{"type":["number","null"],"description":"Indicates the external installment system (if applicable)."},"interestTax":{"type":["number","null"],"description":"Interest tax (percent 0.1 = 10%)."}}}}}},"isSelfAuthorized":{"type":["boolean","null"],"description":"Indicates whether the payment is automatically authorized."},"requiresAuthentication":{"type":["boolean","null"],"description":"Indicates whether it is necessary to log in to make the payment."},"enabled":{"type":"boolean","description":"Indicates whether the rule is enabled in the store."},"installmentsService":{"type":"boolean","description":"Indicates whether any specific type of installment service is used."},"isDefault":{"type":["boolean","null"],"description":"Indicates whether this rule should be considered the default for a given payment condition."},"beginDate":{"type":["string","null"],"description":"Rule start date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"endDate":{"type":["string","null"],"description":"Rule end date in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format (`YYYY-MM-DDThh:mm:ss.fff`), if applicable."},"condition":{"required":["id","pullRate","name"],"type":["object","null"],"description":"Commercial condition information.","properties":{"id":{"type":"string","description":"Commercial condition identification."},"pullRate":{"type":"number","description":"Indicates the minimum percentage of SKUs required in the cart using this commercial condition for it to be activated."},"name":{"type":["string","null"],"description":"Commercial condition information."}}},"multiMerchantList":{"type":["array","null"],"description":"Indicates the names of the accounts to which the rule is being applied exclusively.","items":{"type":"string","description":"Account names."}},"country":{"required":["name","isoCode"],"type":["object","null"],"description":"Information about rule application in a country.","properties":{"name":{"type":["string","null"],"description":"Country name."},"isoCode":{"type":"string","description":"Country code (ISO 3166 alpha-2)."}}},"dateIntervals":{"type":["array","null"],"description":"Array containing information about the periods (days and hours) in which the rule is enabled.","items":{"required":["start","end"],"type":"object","description":"Rule enablement period information.","properties":{"start":{"type":"string","description":"Time, days of the week, and GMT time zone in which the rule is activated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."},"end":{"type":"string","description":"Time, days of the week and GMT time zone in which the rule is deactivated. This data is available in [CRON format](https://en.wikipedia.org/wiki/Cron)."}}}},"externalInterest":{"type":"boolean","description":"Indicates whether interest can be calculated externally."},"minimumValue":{"type":["number","null"],"description":"Minimum payment transaction amount for the rule to be applied."},"deadlines":{"type":"array","description":"Array containing information about the payment deadlines (applicable for credit payment method).","items":{"type":"object","description":"Payment deadlines information.","required":["paymentOptions"],"properties":{"paymentOptions":{"type":"array","description":"Array containing payment options information.","items":{"required":["days","interestRate"],"type":"object","description":"Payment options information.","properties":{"days":{"type":"number","description":"Deadline in days to make payment."},"interestRate":{"type":"number","description":"Interest rate applied (in percentage, e.g. `3.0` means 3%)."}}}}}}},"cobrand":{"required":["name"],"type":"object","description":"Information about the cobranded card.","properties":{"name":{"type":["string","null"],"description":"Card name."}}},"cardLevel":{"required":["name"],"type":"object","description":"Information about the card category.","properties":{"name":{"type":["string","null"],"description":"Card category name (e.g. standard, gold, premium)."}}},"excludedBinsRanges":{"type":["number","null"],"description":"Range of card bins excluded from application of this rule."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information about a specific payment rule applied to the payment providers configured in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-ManageStore | **Manage Store** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ruleId` | path | (Required) Rule identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "c997267e-39bf-4217-a890-a503f6a7dc47", + "name": "Test_API_2_Updated", + "salesChannels": [ + { + "id": "1" + } + ], + "paymentSystem": { + "id": 8, + "name": "Hipercard", + "implementation": null + }, + "connector": { + "implementation": "Vtex.PaymentGateway.Connectors.CieloV3Connector", + "affiliationId": "0a8488e6-0c30-4150-be96-b0dcaaa6a0cd" + }, + "issuer": { + "name": "barclays" + }, + "antifraud": null, + "installmentOptions": { + "dueDateType": 0, + "interestRateMethod": 1, + "minimumInstallmentValue": 400, + "installments": [ + { + "ruleId": null, + "quantity": 12, + "value": 0, + "interestRate": 25, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + "isSelfAuthorized": null, + "requiresAuthentication": null, + "enabled": false, + "installmentsService": false, + "isDefault": null, + "beginDate": "2023-12-15T17:00:00Z", + "endDate": "2023-12-30T01:00:00Z", + "condition": { + "id": "1", + "pullRate": 15, + "name": null + }, + "multiMerchantList": [], + "country": { + "name": null, + "isoCode": "br" + }, + "dateIntervals": [ + { + "start": "* * 12 * * 1,3,4 * -0300", + "end": "* * 19 * * 1,3,4 * -0300" + }, + { + "start": "* * 09 * * * * -0300", + "end": "* * 21 * * * * -0300" + } + ], + "externalInterest": false, + "minimumValue": null, + "deadlines": [], + "cobrand": { + "name": null + }, + "cardLevel": { + "name": "gold" + }, + "excludedBinsRanges": null + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Configuration/folder.yml b/BrunoCollections/VTEX - Payments Gateway API/Configuration/folder.yml new file mode 100644 index 0000000000..a0319e6bbb --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Configuration + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Payments Gateway API/Installments/Get installments options.yml b/BrunoCollections/VTEX - Payments Gateway API/Installments/Get installments options.yml new file mode 100644 index 0000000000..0726a02d8d --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Installments/Get installments options.yml @@ -0,0 +1,202 @@ +info: + name: Get installments options + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/installments?request.value=10" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: request.value + value: "10" + type: query + - name: request.salesChannel + value: "1" + type: query + disabled: true + - name: request.paymentDetails[0].id + value: "2" + type: query + disabled: true + - name: request.paymentDetails[0].value + value: "10" + type: query + disabled: true + - name: request.paymentDetails[0].bin + value: "411111" + type: query + disabled: true + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/installments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/installments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/installments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/installments - Schema is valid", function () { + const schema = {"required":["value","installments"],"type":"object","description":"Installments options response body information.","properties":{"value":{"type":"number","description":"Value to be paid in installments."},"installments":{"type":"array","items":{"required":["payment","options"],"type":"object","description":"Installment options information.","properties":{"payment":{"required":["id","name","bin","value","isDefault","self"],"type":"object","description":"Payment system information.","properties":{"id":{"type":"integer","description":"Payment system identification."},"name":{"type":["string","null"],"description":"Payment system name."},"bin":{"type":["string","null"],"description":"First six digits of the card number."},"value":{"type":"number","description":"Value to be paid in installments."},"isDefault":{"type":"boolean","description":"Indicates whether the payment system is automatically applied by default.","default":false},"self":{"required":["href"],"type":"object","description":"Object containing the payment system reference route.","properties":{"href":{"type":"string","description":"Payment system reference route."}}}}},"options":{"type":"array","description":"Array containing information about installment options.","items":{"required":["ruleId","quantity","value","interestRate","isExternalInstallmentService","interestTax"],"type":"object","description":"Installment options information.","properties":{"ruleId":{"type":["string","null"],"description":"Rule identification."},"quantity":{"type":"integer","description":"Number of installments."},"value":{"type":"number","description":"Value of each installment."},"interestRate":{"type":"number","description":"Interest rate (percent 0.1 = 10%)."},"isExternalInstallmentService":{"type":["number","null"],"description":"Indicates the external installment system (if applicable)."},"interestTax":{"type":["number","null"],"description":"Interest tax (percent 0.1 = 10%)."}}}}}},"description":"Installments information."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the best installment options according to the parameters informed in the request. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `request.value` | query | (Required) Value to be divided into installments. | + | `request.salesChannel` | query | Sales channel identification. Attribute created by the seller in their VTEX store configuration. | + | `request.paymentDetails[0].id` | query | Payment system identification. | + | `request.paymentDetails[0].value` | query | Total value paid in installments. If applied in the search, it must be equal to the `request.value` field. | + | `request.paymentDetails[0].bin` | query | First six digits of the card number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "value": 250, + "installments": [ + { + "payment": { + "id": 72, + "name": null, + "bin": null, + "value": 250, + "isDefault": false, + "self": { + "href": "/api/pvt/payment-systems/72" + } + }, + "options": [ + { + "ruleId": "01a8d68b-9116-4655-83f8-3380f658ec04", + "quantity": 1, + "value": 250, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": 0 + }, + { + "ruleId": "01a8d68b-9116-4655-83f8-3380f658ec04", + "quantity": 2, + "value": 125, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": 0 + }, + { + "ruleId": "01a8d68b-9116-4655-83f8-3380f658ec04", + "quantity": 3, + "value": 83.33, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": 0 + }, + { + "ruleId": "01a8d68b-9116-4655-83f8-3380f658ec04", + "quantity": 4, + "value": 62.5, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": 0 + } + ] + }, + { + "payment": { + "id": 5, + "name": "ERedeV2 - Visa", + "bin": null, + "value": 10, + "isDefault": false, + "self": { + "href": "/api/pvt/payment-systems/2" + } + }, + "options": [ + { + "ruleId": "993d4d35-b64d-454d-8108-c560580160e0", + "quantity": 1, + "value": 250, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": null + } + ] + }, + { + "payment": { + "id": 12, + "name": "PayPal - 6U0DTI3M3OKO6R", + "bin": null, + "value": 10, + "isDefault": false, + "self": { + "href": "/api/pvt/payment-systems/12" + } + }, + "options": [ + { + "ruleId": "9ac0fa1b-dd9d-4549-abb8-e73bbb63c280", + "quantity": 1, + "value": 250, + "interestRate": 0, + "isExternalInstallmentService": null, + "interestTax": null + } + ] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Installments/folder.yml b/BrunoCollections/VTEX - Payments Gateway API/Installments/folder.yml new file mode 100644 index 0000000000..ea36b9cbc7 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Installments/folder.yml @@ -0,0 +1,4 @@ +info: + name: Installments + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID, date, and value paid.yml b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID, date, and value paid.yml new file mode 100644 index 0000000000..50a88e4c0a --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID, date, and value paid.yml @@ -0,0 +1,72 @@ +info: + name: Send payment notification with payment ID, date, and value paid + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/payments/pvt/payments/:paymentId/payment-notification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: B075A551595A43B0AD48DCD8EB481C7F + type: path + body: + type: json + data: |- + { + "paymentDate": "01/01/2025", + "valuePaid": 50.1 + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/payments/pvt/payments/:paymentId/payment-notification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends a payment notification for an order using the payment ID, including the payment date and the value paid. + + >ℹ️ This endpoint should only be used when the payment was not completed on its creation date or was partially completed (e.g., $50 out of $100). If the payment was made in full on the creation date, use the `GET` [Send payment notification with payment ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/payments/pvt/payments/-paymentId-/payment-notification) endpoint instead. + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-NotifyPayments | **Payments Notification** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Payments Notifier | **Payments Notification** | + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) Payment identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID.yml b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID.yml new file mode 100644 index 0000000000..c2cbad7d2a --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/Send payment notification with payment ID.yml @@ -0,0 +1,65 @@ +info: + name: Send payment notification with payment ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/payments/pvt/payments/:paymentId/payment-notification" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: paymentId + value: B075A551595A43B0AD48DCD8EB481C7F + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/payments/pvt/payments/:paymentId/payment-notification - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends a payment notification for an order based on the payment ID. + + >ℹ If the payment was made on its creation date and for the full amount, use this endpoint. Otherwise, use the alternative endpoint: `POST` [Send payment notification with payment ID, date, and value paid](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/payments/pvt/payments/-paymentId-/payment-notification). + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-NotifyPayments | **Payments Notification** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Payments Notifier | **Payments Notification** | + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `paymentId` | path | (Required) Payment identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Payment notification/folder.yml b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/folder.yml new file mode 100644 index 0000000000..10958b6935 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Payment notification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Payment notification + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Cancel the transaction.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Cancel the transaction.yml new file mode 100644 index 0000000000..a8b8d0beac --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Cancel the transaction.yml @@ -0,0 +1,105 @@ +info: + name: Cancel the transaction + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/cancellation-request" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: "2300" + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/transactions/:transactionId/cancellation-request - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/cancellation-request - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/cancellation-request - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/transactions/:transactionId/cancellation-request - Schema is valid", function () { + const schema = {"required":["id","token","status","statusDetail","processingDate","refundedValue","refundedToken","message","code","connectorRefundedValue","cancelledValue"],"type":"object","description":" Transaction response body information.","properties":{"id":{"type":["string","null"],"description":"Settle request identification."},"token":{"type":"string","description":"Token identification."},"status":{"type":"number","description":"Status code."},"statusDetail":{"type":"string","description":"Status detail information."},"processingDate":{"type":"string","description":"Settlement processing date."},"refundedValue":{"type":"integer","description":"Refunded value."},"refundedToken":{"type":["string","null"],"description":"Refund operation token."},"message":{"type":["string","null"],"description":"Custom message."},"code":{"type":["string","null"],"description":"Custom code."},"connectorRefundedValue":{"type":"number","description":"Refunded value by connector (provider)."},"cancelledValue":{"type":"integer","description":"Cancelled value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a transaction that was previously approved, but not settled. It is possible to cancel partially or complete value of the transaction. + + Due to acquirer rules it is not possible to perform this step online against the acquirer. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": null, + "token": "2BCA48B4FBCB42D0B8A19EE965712AD8", + "status": 13, + "statusDetail": "Finished", + "processingDate": "2023-12-14T22:45:50.9977213Z", + "refundedValue": 0, + "refundedToken": null, + "message": null, + "code": null, + "connectorRefundedValue": 0, + "cancelledValue": 74269 + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Refund the transaction.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Refund the transaction.yml new file mode 100644 index 0000000000..5f4fdac7a4 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Refund the transaction.yml @@ -0,0 +1,132 @@ +info: + name: Refund the transaction + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/refunding-request" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + { + "value": 2300, + "freight": 200, + "tax": 0, + "minicart": { + "items": [ + { + "id": "122323", + "name": "Tenis Preto I", + "value": 1000, + "quantity": 1, + "shippingDiscount": 0, + "discount": 50 + }, + { + "id": "122324", + "name": "Tenis Nike Azul", + "value": 1100, + "quantity": 1, + "shippingDiscount": 0, + "discount": 50 + } + ] + } + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/transactions/:transactionId/refunding-request - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/refunding-request - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/refunding-request - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/transactions/:transactionId/refunding-request - Schema is valid", function () { + const schema = {"required":["id","token","status","statusDetail","processingDate","refundedValue","refundedToken","message","code","connectorRefundedValue","cancelledValue"],"type":"object","description":" Transaction response body information.","properties":{"id":{"type":["string","null"],"description":"Settle request identification."},"token":{"type":"string","description":"Token identification."},"status":{"type":"number","description":"Status code."},"statusDetail":{"type":"string","description":"Status detail information."},"processingDate":{"type":"string","description":"Settlement processing date."},"refundedValue":{"type":"integer","description":"Refunded value."},"refundedToken":{"type":["string","null"],"description":"Refund operation token."},"message":{"type":["string","null"],"description":"Custom message."},"code":{"type":["string","null"],"description":"Custom code."},"connectorRefundedValue":{"type":"number","description":"Refunded value by connector (provider)."},"cancelledValue":{"type":"integer","description":"Cancelled value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Refunds the amount of the transaction that was previously settled. + + After a transaction is settled, this request can be used to partially or fully refund the transaction amount. + + Due to acquirer rules, it is not possible to perform this step online against the acquirer, and, if an error occurrs, we notify the seller company responsible by email to manually check the transaction status against the acquirer. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": null, + "token": "2BCA48B4FBCB42D0B8A19EE965712AD8", + "status": 11, + "statusDetail": "Settling", + "processingDate": "2023-12-14T22:45:50.9977213Z", + "refundedValue": 2500, + "refundedToken": null, + "message": null, + "code": null, + "connectorRefundedValue": 0, + "cancelledValue": 0 + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Settle the transaction.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Settle the transaction.yml new file mode 100644 index 0000000000..d77b4c914f --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/Settle the transaction.yml @@ -0,0 +1,108 @@ +info: + name: Settle the transaction + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/settlement-request" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + { + "value": 10050 + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/transactions/:transactionId/settlement-request - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/settlement-request - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/settlement-request - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/transactions/:transactionId/settlement-request - Schema is valid", function () { + const schema = {"required":["id","token","status","statusDetail","processingDate","refundedValue","refundedToken","message","code","connectorRefundedValue","cancelledValue"],"type":"object","description":" Transaction response body information.","properties":{"id":{"type":["string","null"],"description":"Settle request identification."},"token":{"type":"string","description":"Token identification."},"status":{"type":"number","description":"Status code."},"statusDetail":{"type":"string","description":"Status detail information."},"processingDate":{"type":"string","description":"Settlement processing date."},"refundedValue":{"type":"integer","description":"Refunded value."},"refundedToken":{"type":["string","null"],"description":"Refund operation token."},"message":{"type":["string","null"],"description":"Custom message."},"code":{"type":["string","null"],"description":"Custom code."},"connectorRefundedValue":{"type":"number","description":"Refunded value by connector (provider)."},"cancelledValue":{"type":"integer","description":"Cancelled value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Settles the transaction amount. A payment settled means that the seller will receive the value of the purchase value after bank conciliation. + + >ℹ️ This call is mandatory to complete a transaction and its payments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": null, + "token": "2BCA48B4FBCB42D0B8A19EE965712AD8", + "status": 11, + "statusDetail": "Settling", + "processingDate": "2023-12-14T22:45:50.9977213Z", + "refundedValue": 0, + "refundedToken": null, + "message": null, + "code": null, + "connectorRefundedValue": 0, + "cancelledValue": 0 + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/folder.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/folder.yml new file mode 100644 index 0000000000..f4821acd76 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Flow/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transaction Flow + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Authorize new transaction.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Authorize new transaction.yml new file mode 100644 index 0000000000..5aeff03d08 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Authorize new transaction.yml @@ -0,0 +1,112 @@ +info: + name: Authorize new transaction + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/authorization-request" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + { + "transactionId": "7ECE7DF3EEE14647B05DB904164923E8", + "softDescriptor": "company_name_description_code", + "prepareForRecurrency": false + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/transactions/:transactionId/authorization-request - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/authorization-request - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/transactions/:transactionId/authorization-request - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/transactions/:transactionId/authorization-request - Schema is valid", function () { + const schema = {"required":["id","token","status","statusDetail","processingDate","refundedValue","refundedToken","message","code","connectorRefundedValue","cancelledValue"],"type":"object","description":" Transaction response body information.","properties":{"id":{"type":["string","null"],"description":"Settle request identification."},"token":{"type":"string","description":"Token identification."},"status":{"type":"number","description":"Status code."},"statusDetail":{"type":"string","description":"Status detail information."},"processingDate":{"type":"string","description":"Settlement processing date."},"refundedValue":{"type":"integer","description":"Refunded value."},"refundedToken":{"type":["string","null"],"description":"Refund operation token."},"message":{"type":["string","null"],"description":"Custom message."},"code":{"type":["string","null"],"description":"Custom code."},"connectorRefundedValue":{"type":"number","description":"Refunded value by connector (provider)."},"cancelledValue":{"type":"integer","description":"Cancelled value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request authorizes the creation of a new transaction according to the data previously informed in the last requests. + + This step is the trigger to process each of payments that were received in step 2. + + Each payment will be sent to acquirer. If all payments are authorized, the transaction will be authorized. If one of the payments is denied, all payments in transaction will be cancelled. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": null, + "token": "2BCA48B4FBCB42D0B8A19EE965712AD8", + "status": 8, + "statusDetail": "Approved", + "processingDate": "2023-12-14T22:45:50.9977213Z", + "refundedValue": 0, + "refundedToken": null, + "message": null, + "code": null, + "connectorRefundedValue": 0, + "cancelledValue": 0 + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get payment details.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get payment details.yml new file mode 100644 index 0000000000..9bb675c9d3 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get payment details.yml @@ -0,0 +1,90 @@ +info: + name: Get payment details + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/payments/:paymentId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + - name: paymentId + value: B2E754DCD7304D22866CB6F221CF0FEB + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/transactions/:transactionId/payments/:paymentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments/:paymentId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments/:paymentId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/transactions/:transactionId/payments/:paymentId - Schema is valid", function () { + const schema = {"required":["id","paymentSystem","paymentSystemName","merchantName","group","userProfileId","isCustom","allowInstallments","requiresAuthentication","allowIssuer","allowNotification","isAvailable","description","authorizationDate","self","tid","returnCode","returnMessage","status","connector","ConnectorResponses","connectorResponse","ShowConnectorResponses","value","installmentsInterestRate","installmentsValue","referenceValue","installments","currencyCode","provider","isBillingAddressDifferent","isRegexValid","isLuhnValid","fields","sheets","originalPaymentId"],"type":"object","description":"Payment details information.","properties":{"id":{"type":"string","description":"Payment identification."},"paymentSystem":{"type":"number","description":"Payment system identification."},"paymentSystemName":{"type":"string","description":"Payment system name."},"merchantName":{"type":["string","null"],"description":"Merchant name."},"group":{"type":"string","description":"Payment group name."},"userProfileId":{"type":["string","null"],"description":"Unique ID associated with the customer profile."},"isCustom":{"type":"boolean","description":"Indicates whether it is custom."},"allowInstallments":{"type":"boolean","description":"Indicates whether the payment method allows installments."},"requiresAuthentication":{"type":"boolean","description":"Indicates whether it is necessary to log in to make the payment."},"allowIssuer":{"type":"boolean","description":"Indicates whether it is possible to identify the name of the bank responsible for issuing the card."},"allowNotification":{"type":"boolean","description":"Indicates the possibility of payment notification (used by bank invoices and notes payable)."},"isAvailable":{"type":"boolean","description":"Indicates whether the payment method is available for use."},"description":{"type":["string","null"],"description":"Description of the payment method."},"authorizationDate":{"type":["string","null"],"description":"Payment authorization date."},"self":{"required":["href"],"type":"object","description":"Object containing the payment system reference route.","properties":{"href":{"type":"string","description":"Payment system reference route."}}},"tid":{"type":["string","null"],"description":"Provider's unique identifier for the transaction."},"nsu":{"type":["string","null"],"description":"Provider's unique sequential number for the transaction."},"returnCode":{"type":["string","null"],"description":"Connector return code."},"returnMessage":{"type":["string","null"],"description":"Connector return message."},"status":{"type":"string","description":"Payment status."},"connector":{"type":["string","null"],"description":"Connector name."},"ConnectorResponses":{"type":["array","null"],"description":"Array containing connector responses information.","items":{"type":"object","description":"Connector responses information.","properties":{"Tid":{"type":"string","description":"Provider's unique identifier for the transaction."},"ReturnCode":{"type":["string","null"],"description":"Connector return code."},"Message":{"type":["string","null"],"description":"Connector return message."},"authId":{"type":["string","null"],"description":"Authorization identification."},"nsu":{"type":"string","description":"Provider's unique sequential number for the transaction."}}}},"connectorResponse":{"type":["array","null"],"description":"Array containing connector response information.","items":{"type":"object","description":"Connector response information.","properties":{"Tid":{"type":"string","description":"Provider's unique identifier for the transaction."},"ReturnCode":{"type":["string","null"],"description":"Connector return code."},"Message":{"type":["string","null"],"description":"Connector return message."},"authId":{"type":["string","null"],"description":"Authorization identification."},"nsu":{"type":"string","description":"Provider's unique sequential number for the transaction."}}}},"ShowConnectorResponses":{"type":"boolean","description":"Indicates whether to display connector responses."},"value":{"type":"number","description":"Payment value."},"installmentsInterestRate":{"type":"number","description":"The interest rate."},"installmentsValue":{"type":"number","description":"The value of each installment."},"referenceValue":{"type":"number","description":"Value amount of the payment without interest applied. This value is the same as the {value` field when `installmentsInterestRate` is 0.0."},"installments":{"type":"number","description":"Number of installments."},"currencyCode":{"type":["string","null"],"description":"Currency Code in ISO 4217 standard."},"provider":{"type":["string","null"],"description":"Provider name."},"isBillingAddressDifferent":{"type":["boolean","null"],"description":"Indicates whether the invoice address is different from the purchase delivery address."},"isRegexValid":{"type":["boolean","null"],"description":"Confirms that the [Regex](https://regexr.com/) rule is valid."},"isLuhnValid":{"type":["boolean","null"],"description":"Confirms that the [Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) rule is valid."},"fields":{"type":"array","items":{"required":["name","value"],"type":"object","description":"Payment parameters information.","properties":{"name":{"type":"string","description":"Payment parameter name."},"value":{"type":"string","description":"Payment parameter value."}}},"description":"Field containing information and values ​​of payment parameters."},"sheets":{"type":["string","null"],"description":"Sheets information."},"originalPaymentId":{"type":["string","null"],"description":"Original payment identification, if applicable."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns data about a specific payment made in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `paymentId` | path | (Required) Payment identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction details.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction details.yml new file mode 100644 index 0000000000..c16e63b8b7 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction details.yml @@ -0,0 +1,88 @@ +info: + name: Get transaction details + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/transactions/:transactionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/transactions/:transactionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/transactions/:transactionId - Schema is valid", function () { + const schema = {"required":["id","transactionId","referenceKey","interactions","settlements","payments","refunds","cancellations","capabilities","timeoutStatus","totalRefunds","status","value","receiverUri","startDate","authorizationToken","authorizationDate","commitmentToken","commitmentDate","refundingToken","refundingDate","cancelationToken","cancelationDate","fields","shopperInteraction","ipAddress","sessionId","macId","vtexFingerprint","chargeback","whiteSignature","owner","orderId","userAgent","acceptHeader","antifraudTid","antifraudResponse","antifraudReference","antifraudAffiliationId","channel","salesChannel","urn","softDescriptor","markedForRecurrence","buyer"],"type":"object","description":"Transaction details response body information.","properties":{"id":{"type":"string","description":"Transaction identification."},"transactionId":{"type":"string","description":"Transaction identification (same value of the `id` field)."},"referenceKey":{"type":"string","description":"Field used for anti-fraud to identify the transaction."},"interactions":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction interactions.","properties":{"href":{"type":"string","description":"Transaction interaction reference route."}}},"settlements":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction settlements.","properties":{"href":{"type":"string","description":"Transaction settlement reference route."}}},"payments":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction payments.","properties":{"href":{"type":"string","description":"Transaction payment reference route."}}},"refunds":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction refunds.","properties":{"href":{"type":"string","description":"Transaction refund reference route."}}},"cancellations":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction cancellations.","properties":{"href":{"type":"string","description":"Transaction cancellation reference route."}}},"capabilities":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction capabilities.","properties":{"href":{"type":"string","description":"Transaction capabilities reference route."}}},"timeoutStatus":{"type":"number","description":"Field that represents the possible transaction timeout statuses. Possible statuses and meanings: `0` = NotStarted, `1` = CancellingOrFinishing, `2` = CancellingOrFinishingByTimeout, `3` = CancelledOrFinished and `4` = TriesExceeded.","enum":[0,1,2,3,4]},"totalRefunds":{"type":"number","description":"Total refunded transaction amount."},"status":{"type":"string","description":"Transaction status."},"value":{"type":"number","description":"Transaction value."},"receiverUri":{"type":["string","null"],"description":"Receiver [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) information."},"startDate":{"type":"string","description":"Transaction start date."},"authorizationToken":{"type":["string","null"],"description":"Transaction authorization token."},"authorizationDate":{"type":["string","null"],"description":"Transaction authorization date."},"commitmentToken":{"type":["string","null"],"description":"Transaction completion token."},"commitmentDate":{"type":["string","null"],"description":"Transaction completion date."},"refundingToken":{"type":["string","null"],"description":"Transaction refund token."},"refundingDate":{"type":["string","null"],"description":"Transaction refund date."},"cancelationToken":{"type":["string","null"],"description":"Transaction cancellation token."},"cancelationDate":{"type":["string","null"],"description":"Transaction cancellation date."},"fields":{"type":"array","items":{"required":["name","value"],"type":"object","description":"Payment parameters information.","properties":{"name":{"type":"string","description":"Payment parameter name."},"value":{"type":"string","description":"Payment parameter value."}}},"description":"Field containing information and values of payment parameters."},"shopperInteraction":{"type":"string","description":"Transaction origin."},"ipAddress":{"type":["string","null"],"description":"Ip address information."},"sessionId":{"type":["string","null"],"description":"Session identification."},"macId":{"type":"string","description":"Random [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) V4 generated when the Request Capture receives a session that does not contain the macID already set. This value is set to the cookie `VtexRCMacIdv7`. The cookie has 1 year of expiration."},"vtexFingerprint":{"type":["string","null"],"description":"VTEX fingerprint information."},"chargeback":{"type":["string","null"],"description":"Chargeback information."},"whiteSignature":{"type":["string","null"],"description":"White signature (anti-fraud list) information."},"owner":{"type":"string","description":"Responsible for transaction request."},"orderId":{"type":["string","null"],"description":"Order identitication."},"userAgent":{"type":"string","description":"HTTP client used in the transaction."},"acceptHeader":{"type":"string","description":"Type of content accepted in the transaction request header."},"antifraudTid":{"type":["string","null"],"description":"Anti-fraud transaction identification."},"antifraudResponse":{"type":["string","null"],"description":"Anti-fraud response information."},"antifraudReference":{"type":["string","null"],"description":"Anti-fraud reference information."},"antifraudAffiliationId":{"type":["string","null"],"description":"Anti-fraud affiliation identification."},"channel":{"type":"string","description":"Store where the transaction was initiated."},"salesChannel":{"type":"string","description":"Sales channel information."},"urn":{"type":["string","null"],"description":"[URN](https://en.wikipedia.org/wiki/Uniform_Resource_Name) information."},"softDescriptor":{"type":["string","null"],"description":"Custom field for a transaction that can be displayed on the customer's invoice."},"markedForRecurrence":{"type":"boolean","description":"Indicates whether the payment transaction should be recurring."},"buyer":{"type":["object","null"],"description":"Buyer information.","properties":{"firstName":{"type":"string","description":"Buyer first name."},"lastName":{"type":"string","description":"Buyer last name."},"documentType":{"type":"string","description":"Type of the document informed by the buyer."},"document":{"type":"string","description":"Document informed by the buyer."},"email":{"type":"string","description":"Buyer email address."},"address":{"type":"string","description":"Buyer address."},"phone":{"type":"string","description":"Buyer phone number."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns data about a specific transaction made in your store. + + >⚠️ Do not use the `interactions.href` route which is part of this endpoint's response. This is an internal-only route not meant to be used by external developers. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction settlement details.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction settlement details.yml new file mode 100644 index 0000000000..178477c7f3 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Get transaction settlement details.yml @@ -0,0 +1,116 @@ +info: + name: Get transaction settlement details + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/settlements" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/pvt/transactions/:transactionId/settlements - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/settlements - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/pvt/transactions/:transactionId/settlements - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/pvt/transactions/:transactionId/settlements - Schema is valid", function () { + const schema = {"required":["requests","actions"],"type":"object","description":"Transaction settlement details response body information.","properties":{"requests":{"type":"array","items":{"required":["id","date","value"],"type":"object","description":"Requests information.","properties":{"id":{"type":"string","description":"Transaction identification. This is the same `transactionId` value sent in the request path."},"date":{"type":"string","description":"Transaction settlement date."},"value":{"type":"number","description":"Transaction settlement value."}}},"description":"Array containing requests information."},"actions":{"type":"array","items":{"required":["paymentId","payment","date","type","value","connectorResponse"],"type":"object","description":"Actions information.","properties":{"paymentId":{"type":"string","description":"Payment identification."},"payment":{"required":["href"],"type":"object","description":"Object containing the transaction settlement reference route.","properties":{"href":{"type":"string","description":"Transaction reference settlement route."}}},"date":{"type":"string","description":"Transaction settlement date."},"type":{"type":"string","description":"Settlement action date."},"value":{"type":"integer","description":"Transaction settlement value."},"connectorResponse":{"type":["string","null"],"description":"Connector transaction response information. This object can return different fields according to the internal configuration of each connector (payment provider), for example, `Tid`, `ReturnCode`, `authId`, among others)."}}},"description":"Array containing actions information."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns settlement data associated with a specific transaction. + + The response body of this endpoint may return different information depending on the status of the settlement request for the queried transaction: + + - **Transaction settlement not requested or initiated:** The response body does not return any data. + + - **Settlement request initiated, but not completed as there are items that have not yet been invoiced in the order:** The response body will only display the `request` array information. + + - **Transaction settlement completed:** The response body will display the `request` and `actions` arrays information. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **View Payment Data** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "requests": [ + { + "id": "AFB933448FFD4867BF82BCC7026A082C", + "date": "2018-06-05T13:08:22", + "value": 4499000 + } + ], + "actions": [ + { + "paymentId": "87055E7199A446519EB07F1243D5B8BE", + "payment": { + "href": "/api/pvt/transactions/074D48049B19403A930FA848C6BE4AF9/payments/87055E7199A446519EB07F1243D5B8BE" + }, + "date": "2018-06-05T12:55:58.6262759Z", + "type": "auto-settlement", + "value": 4499000, + "connectorResponse": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send additional data.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send additional data.yml new file mode 100644 index 0000000000..86ca7261b1 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send additional data.yml @@ -0,0 +1,73 @@ +info: + name: Send additional data + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/additional-data" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + [ + { + "name": "cart", + "value": "{\"items\":[{\"id\":\"6257034\",\"name\":\"Tamanco Couro Preto Poá\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"C503YC002_34\",\"productId\":\"6257000\",\"sellingPrice\":59.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"18\",\"categoryName\":\"Tamanco\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":167},{\"id\":\"7136034\",\"name\":\"Sandália Off White Espadrile Salto Forrado\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S5146R881_34\",\"productId\":\"7136000\",\"sellingPrice\":59.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"12\",\"categoryName\":\"Anabela\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":166},{\"id\":\"8305038\",\"name\":\"Tamanco Caramelo Salto Fachete\",\"value\":9999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S534IZ012_38\",\"productId\":\"8305000\",\"sellingPrice\":99.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"18\",\"categoryName\":\"Tamanco\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":166},{\"id\":\"7641034\",\"name\":\"Tênis Slip On Couro Preto Recorte\",\"value\":9999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"C524B9002_34\",\"productId\":\"7641000\",\"sellingPrice\":99.99,\"sellerId\":\"coinshop\",\"dockId\":\"0405\",\"categoryId\":\"30\",\"categoryName\":\"Clássico\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Correios - PAC\",\"deliverySlaInMinutes\":18720,\"deliveryWindow\":null,\"tax\":0,\"freight\":7138},{\"id\":\"8278038\",\"name\":\"Tênis Slip Caramelo Matelassê\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S534IR012_38\",\"productId\":\"8278000\",\"sellingPrice\":59.99,\"sellerId\":\"coinmarket\",\"dockId\":\"0571\",\"categoryId\":\"32\",\"categoryName\":\"Slip On\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"PAC\",\"deliverySlaInMinutes\":14400,\"deliveryWindow\":null,\"tax\":0,\"freight\":7090}],\"sellers\":[{\"id\":\"1\",\"name\":\"CONSTANCE\",\"documentType\":\"CNPJ\",\"document\":\"30901791000191\"},{\"id\":\"coinshop\",\"name\":\"coinshop\",\"documentType\":\"CNPJ\",\"document\":\"48275547000126\"},{\"id\":\"coinmarket\",\"name\":\"coinmarket\",\"documentType\":\"CNPJ\",\"document\":\"48314133000169\"}],\"freight\":14727,\"shippingdate\":null,\"shippingestimated\":\"4bd\",\"orderUrl\":\"http://www.constance.com.br/admin/checkout/#/orders?q=1373160984904\",\"tax\":0,\"isGiftRegistry\":null,\"giftRegistryDescription\":null,\"giftRegistryId\":null,\"isPickupStore\":null,\"isCallCenter\":null}" + }, + { + "name": "clientProfileData", + "value": "{\"email\":\"test@test.com\",\"firstName\":\"Izidio\",\"lastName\":\"Test Trace\",\"document\":\"111111111\",\"phone\":\"+56987654321\",\"corporateName\":null,\"tradeName\":null,\"corporateDocument\":null,\"stateInscription\":\"Exento\",\"postalCode\":\"8320000\",\"address\":{\"receiverName\":\"wqqw weqw\",\"postalCode\":\"8320000\",\"city\":\"wdade\",\"state\":\"Región Metropolitana\",\"country\":\"CHL\",\"street\":\"asdafd\",\"number\":\"sadas\",\"neighborhood\":\"Santiago\",\"complement\":\"604\",\"reference\":\"efa\"},\"gender\":null,\"birthDate\":null,\"createdDate\":null,\"corporatePhone\":null,\"isCorporate\":false,\"documentType\":\"rutCHL\",\"id\":\"d48a1cd3-c04e-4949-a275-df4b197a7ec9\"}" + } + ] + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/pvt/transactions/:transactionId/additional-data - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request sends additional data related to the transaction, such as profile information, shopping cart, shipping data, among others. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send payments information.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send payments information.yml new file mode 100644 index 0000000000..e52b61b9e6 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Send payments information.yml @@ -0,0 +1,176 @@ +info: + name: Send payments information + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/payments/transactions/:transactionId/payments?an=cosmetics2&orderId=1248716513905" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: cosmetics2 + type: query + - name: orderId + value: "1248716513905" + type: query + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + [ + { + "paymentSystem": 17, + "installments": 1, + "currencyCode": "BRL", + "value": 15000, + "installmentsInterestRate": 0, + "installmentsValue": 0, + "referenceValue": 15000, + "fields": { + "holderName": "UserTest", + "cardNumber": "111111111111", + "validationCode": "231", + "dueDate": "10/19", + "document": "8041734561", + "accountId": "08134AF761A148B9A5DCE14A81F31DD9", + "address": [ + { + "addressType": "Residential", + "receiverName": "Clark Kent", + "postalCode": "5555555", + "city": "Sao Paulo", + "state": "SP", + "country": "BRA", + "street": "Avenue Splendor Garden", + "number": 111, + "neighborhood": "Sumare", + "complement": "House", + "reference": "Close to the bank.", + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ] + }, + { + "addressType": "Residential", + "receiverName": "Clark Kent", + "postalCode": "5555555", + "city": "Sao Paulo", + "state": "SP", + "country": "BRA", + "street": "Avenue Splendor Garden", + "number": 111, + "neighborhood": "Sumare", + "complement": "House", + "reference": "Close to the bank.", + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ] + } + ], + "callbackUrl": "https://coinshop.vtexpayments.com.br/payment-provider/transactions/900BA26FEAC84332A53AE1007E740DE3/payments/E713830E32764BF99028A0A275841BFC/notification" + }, + "transaction": { + "id": "72E84719BDF14B2FB170B38AD12598C9", + "merchantName": "cosmetics2" + } + }, + { + "paymentSystem": 17, + "installments": 1, + "currencyCode": "BRL", + "value": 15000, + "installmentsInterestRate": 0, + "installmentsValue": 0, + "referenceValue": 15000, + "fields": { + "holderName": "UserTest", + "cardNumber": "111111111111", + "validationCode": "231", + "dueDate": "10/19", + "document": "8041734561", + "accountId": "08134AF761A148B9A5DCE14A81F31DD9", + "address": [ + { + "addressType": "Residential", + "receiverName": "Clark Kent", + "postalCode": "5555555", + "city": "Sao Paulo", + "state": "SP", + "country": "BRA", + "street": "Avenue Splendor Garden", + "number": 111, + "neighborhood": "Sumare", + "complement": "House", + "reference": "Close to the bank.", + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ] + }, + { + "addressType": "Residential", + "receiverName": "Clark Kent", + "postalCode": "5555555", + "city": "Sao Paulo", + "state": "SP", + "country": "BRA", + "street": "Avenue Splendor Garden", + "number": 111, + "neighborhood": "Sumare", + "complement": "House", + "reference": "Close to the bank.", + "geoCoordinates": [ + -47.924747467041016, + -15.832582473754883 + ] + } + ], + "callbackUrl": "https://coinshop.vtexpayments.com.br/payment-provider/transactions/900BA26FEAC84332A53AE1007E740DE3/payments/E713830E32764BF99028A0A275841BFC/notification" + }, + "transaction": { + "id": "72E84719BDF14B2FB170B38AD12598C9", + "merchantName": "cosmetics2" + } + } + ] + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/payments/transactions/:transactionId/payments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is used to send the payment data. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `an` | query | (Required) Account name. | + | `orderId` | query | (Required) Order identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Start a new transaction.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Start a new transaction.yml new file mode 100644 index 0000000000..a0738baa00 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Start a new transaction.yml @@ -0,0 +1,171 @@ +info: + name: Start a new transaction + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/pvt/transactions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "value": 20000, + "referenceId": "1234567", + "channel": "cosmetics2", + "salesChannel": "1", + "urn": "urn:amazon:webservices:clientvpn" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pvt/transactions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pvt/transactions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pvt/transactions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pvt/transactions - Schema is valid", function () { + const schema = {"required":["id","transactionId","referenceKey","interactions","settlements","payments","refunds","cancellations","capabilities","timeoutStatus","totalRefunds","status","value","receiverUri","startDate","authorizationToken","authorizationDate","commitmentToken","commitmentDate","refundingToken","refundingDate","cancelationToken","cancelationDate","fields","ipAddress","sessionId","macId","vtexFingerprint","chargeback","whiteSignature","owner","orderId","userAgent","acceptHeader","antifraudTid","antifraudResponse","antifraudReference","antifraudAffiliationId","channel","salesChannel","urn","softDescriptor","markedForRecurrence","buyer"],"type":"object","description":"New transaction response body information.","properties":{"id":{"type":"string","description":"Transaction identification."},"transactionId":{"type":"string","description":"Transaction identification (same value of the `id` field)."},"referenceKey":{"type":"string","description":"Identification number that relates the transaction to a purchase order. It can be also used for anti-fraud to identify the transaction."},"interactions":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction interactions.","properties":{"href":{"type":"string","description":"Transaction interaction reference route."}}},"settlements":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction settlements.","properties":{"href":{"type":"string","description":"Transaction settlement reference route."}}},"payments":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction payments.","properties":{"href":{"type":"string","description":"Transaction payment reference route."}}},"refunds":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction refunds.","properties":{"href":{"type":"string","description":"Transaction refund reference route."}}},"cancellations":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction cancellations.","properties":{"href":{"type":"string","description":"Transaction cancellation reference route."}}},"capabilities":{"required":["href"],"type":"object","description":"Object containing the reference route of transaction capabilities.","properties":{"href":{"type":"string","description":"Transaction capabilities reference route."}}},"timeoutStatus":{"type":"number","description":"Field that represents the possible transaction timeout statuses. Possible statuses and meanings: `0` = NotStarted, `1` = CancellingOrFinishing, `2` = CancellingOrFinishingByTimeout, `3` = CancelledOrFinished and `4` = TriesExceeded.","enum":[0,1,2,3,4]},"totalRefunds":{"type":"number","description":"Total refunded transaction amount."},"status":{"type":"string","description":"Transaction status."},"value":{"type":"number","description":"Transaction value."},"receiverUri":{"type":["string","null"],"description":"Receiver [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) information."},"startDate":{"type":"string","description":"Transaction start date."},"authorizationToken":{"type":["string","null"],"description":"Transaction authorization token."},"authorizationDate":{"type":["string","null"],"description":"Transaction authorization date."},"commitmentToken":{"type":["string","null"],"description":"Transaction completion token."},"commitmentDate":{"type":["string","null"],"description":"Transaction completion date."},"refundingToken":{"type":["string","null"],"description":"Transaction refund token."},"refundingDate":{"type":["string","null"],"description":"Transaction refund date."},"cancelationToken":{"type":["string","null"],"description":"Transaction cancellation token."},"cancelationDate":{"type":["string","null"],"description":"Transaction cancellation date."},"fields":{"type":"array","items":{"required":["name","value"],"type":"object","description":"Transaction parameters information.","properties":{"name":{"type":"string","description":"Transaction parameter name."},"value":{"type":"string","description":"Transaction parameter value."}}},"description":"Field containing transaction information."},"ipAddress":{"type":["string","null"],"description":"IP address information."},"sessionId":{"type":["string","null"],"description":"Session identification."},"macId":{"type":["string","null"],"description":"Random [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) V4 generated when the Request Capture receives a session that does not contain the macID already set. This value is set to the cookie `VtexRCMacIdv7`. The cookie has 1 year of expiration."},"vtexFingerprint":{"type":["string","null"],"description":"VTEX fingerprint information."},"chargeback":{"type":["string","null"],"description":"Chargeback information."},"whiteSignature":{"type":["string","null"],"description":"White signature (anti-fraud list) information."},"owner":{"type":"string","description":"Responsible for transaction request."},"orderId":{"type":["string","null"],"description":"Order identitication."},"userAgent":{"type":["string","null"],"description":"HTTP client used in the transaction."},"acceptHeader":{"type":["string","null"],"description":"Type of content accepted in the transaction request header."},"antifraudTid":{"type":["string","null"],"description":"Anti-fraud transaction identification."},"antifraudResponse":{"type":["string","null"],"description":"Anti-fraud response information."},"antifraudReference":{"type":["string","null"],"description":"Anti-fraud reference information."},"antifraudAffiliationId":{"type":["string","null"],"description":"Anti-fraud affiliation identification."},"channel":{"type":"string","description":"Store where the transaction was initiated."},"salesChannel":{"type":"string","description":"Sales channel information."},"urn":{"type":["string","null"],"description":"[URN](https://en.wikipedia.org/wiki/Uniform_Resource_Name) information."},"softDescriptor":{"type":["string","null"],"description":"Custom field for a transaction that can be displayed on the customer's invoice."},"markedForRecurrence":{"type":"boolean","description":"Indicates whether the payment transaction should be recurring."},"buyer":{"type":["object","null"],"description":"Buyer information.","properties":{"firstName":{"type":"string","description":"Buyer first name."},"lastName":{"type":"string","description":"Buyer last name."},"documentType":{"type":"string","description":"Type of the document informed by the buyer."},"document":{"type":"string","description":"Document informed by the buyer."},"email":{"type":"string","description":"Buyer email address."},"address":{"type":"string","description":"Buyer address."},"phone":{"type":"string","description":"Buyer phone number."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is the first step to create a new transaction. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "46351F157C624CBA926359ADED377265", + "transactionId": "46351F157C624CBA926359ADED377265", + "referenceKey": "1234567", + "interactions": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/interactions" + }, + "settlements": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/settlements" + }, + "payments": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/payments" + }, + "refunds": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/refunds" + }, + "cancellations": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/cancellations" + }, + "capabilities": { + "href": "/api/pvt/transactions/46351F157C624CBA926359ADED377265/capabilities" + }, + "timeoutStatus": 0, + "totalRefunds": 0, + "status": "Started", + "value": 20000, + "receiverUri": "https://cosmetics2.vtexpayments.com.br/split/46351F157C624CBA926359ADED377265/payments", + "startDate": "2023-12-15T19:53:59.4307279Z", + "authorizationToken": null, + "authorizationDate": null, + "commitmentToken": null, + "commitmentDate": null, + "refundingToken": null, + "refundingDate": null, + "cancelationToken": null, + "cancelationDate": null, + "fields": [ + { + "name": "owner", + "value": "teste_1@test.com" + }, + { + "name": "lastTransitionDate", + "value": "12/15/2023 7:53:59 PM" + }, + { + "name": "TotalTimeSpentInTransitionsUntilThisTransition", + "value": "0" + }, + { + "name": "channel", + "value": "cosmetics2" + }, + { + "name": "salesChannel", + "value": "1" + } + ], + "ipAddress": null, + "sessionId": null, + "macId": null, + "vtexFingerprint": null, + "chargeback": null, + "whiteSignature": null, + "owner": "teste_1@test.com", + "orderId": null, + "userAgent": null, + "acceptHeader": null, + "antifraudTid": null, + "antifraudResponse": null, + "antifraudReference": null, + "antifraudAffiliationId": null, + "channel": "cosmetics2", + "salesChannel": "1", + "urn": null, + "softDescriptor": null, + "markedForRecurrence": false, + "buyer": null + } + ``` diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Update additional data (optional).yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Update additional data (optional).yml new file mode 100644 index 0000000000..a581d69a64 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/Update additional data (optional).yml @@ -0,0 +1,73 @@ +info: + name: Update additional data (optional) + type: http + seq: 4 + +http: + method: PATCH + url: "{{baseUrl}}/api/pvt/transactions/:transactionId/additional-data" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: transactionId + value: A3BDE325F76B4B758B398D900DF06150 + type: path + body: + type: json + data: |- + [ + { + "name": "cart", + "value": "{\"items\":[{\"id\":\"6257034\",\"name\":\"Tamanco Couro Preto Poá\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"C503YC002_34\",\"productId\":\"6257000\",\"sellingPrice\":59.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"18\",\"categoryName\":\"Tamanco\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":167},{\"id\":\"7136034\",\"name\":\"Sandália Off White Espadrile Salto Forrado\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S5146R881_34\",\"productId\":\"7136000\",\"sellingPrice\":59.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"12\",\"categoryName\":\"Anabela\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":166},{\"id\":\"8305038\",\"name\":\"Tamanco Caramelo Salto Fachete\",\"value\":9999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S534IZ012_38\",\"productId\":\"8305000\",\"sellingPrice\":99.99,\"sellerId\":\"1\",\"dockId\":\"999800000-5\",\"categoryId\":\"18\",\"categoryName\":\"Tamanco\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Convencional\",\"deliverySlaInMinutes\":5760,\"deliveryWindow\":null,\"tax\":0,\"freight\":166},{\"id\":\"7641034\",\"name\":\"Tênis Slip On Couro Preto Recorte\",\"value\":9999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"C524B9002_34\",\"productId\":\"7641000\",\"sellingPrice\":99.99,\"sellerId\":\"coinshop\",\"dockId\":\"0405\",\"categoryId\":\"30\",\"categoryName\":\"Clássico\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Correios - PAC\",\"deliverySlaInMinutes\":18720,\"deliveryWindow\":null,\"tax\":0,\"freight\":7138},{\"id\":\"8278038\",\"name\":\"Tênis Slip Caramelo Matelassê\",\"value\":5999,\"quantity\":1,\"priceTags\":[],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":0,\"refId\":\"S534IR012_38\",\"productId\":\"8278000\",\"sellingPrice\":59.99,\"sellerId\":\"coinmarket\",\"dockId\":\"0571\",\"categoryId\":\"32\",\"categoryName\":\"Slip On\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"PAC\",\"deliverySlaInMinutes\":14400,\"deliveryWindow\":null,\"tax\":0,\"freight\":7090}],\"sellers\":[{\"id\":\"1\",\"name\":\"CONSTANCE\",\"documentType\":\"CNPJ\",\"document\":\"30901791000191\"},{\"id\":\"coinshop\",\"name\":\"coinshop\",\"documentType\":\"CNPJ\",\"document\":\"48275547000126\"},{\"id\":\"coinmarket\",\"name\":\"coinmarket\",\"documentType\":\"CNPJ\",\"document\":\"48314133000169\"}],\"freight\":14727,\"shippingdate\":null,\"shippingestimated\":\"4bd\",\"orderUrl\":\"http://www.constance.com.br/admin/checkout/#/orders?q=1373160984904\",\"tax\":0,\"isGiftRegistry\":null,\"giftRegistryDescription\":null,\"giftRegistryId\":null,\"isPickupStore\":null,\"isCallCenter\":null}" + }, + { + "name": "clientProfileData", + "value": "{\"email\":\"test@test.com\",\"firstName\":\"Izidio\",\"lastName\":\"Test Trace\",\"document\":\"111111111\",\"phone\":\"+56987654321\",\"corporateName\":null,\"tradeName\":null,\"corporateDocument\":null,\"stateInscription\":\"Exento\",\"postalCode\":\"8320000\",\"address\":{\"receiverName\":\"wqqw weqw\",\"postalCode\":\"8320000\",\"city\":\"wdade\",\"state\":\"Región Metropolitana\",\"country\":\"CHL\",\"street\":\"asdafd\",\"number\":\"sadas\",\"neighborhood\":\"Santiago\",\"complement\":\"604\",\"reference\":\"efa\"},\"gender\":null,\"birthDate\":null,\"createdDate\":null,\"corporatePhone\":null,\"isCorporate\":false,\"documentType\":\"rutCHL\",\"id\":\"d48a1cd3-c04e-4949-a275-df4b197a7ec9\"}" + } + ] + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/pvt/transactions/:transactionId/additional-data - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This request is used to update any information that has previously been sent on endpoint [Send additional data](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/additional-data). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | PCI Gateway | Payment-Make Payments | **Process payments** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `transactionId` | path | (Required) Transaction identification. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/folder.yml b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/folder.yml new file mode 100644 index 0000000000..25e4d704fb --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/Transaction Process/folder.yml @@ -0,0 +1,4 @@ +info: + name: Transaction Process + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Payments Gateway API/environments/VTEX.yml b/BrunoCollections/VTEX - Payments Gateway API/environments/VTEX.yml new file mode 100644 index 0000000000..7e6bfac241 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://{{accountName}}.vtexpayments.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Payments Gateway API/opencollection.yml b/BrunoCollections/VTEX - Payments Gateway API/opencollection.yml new file mode 100644 index 0000000000..b8cb5ea3d3 --- /dev/null +++ b/BrunoCollections/VTEX - Payments Gateway API/opencollection.yml @@ -0,0 +1,61 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Payments Gateway API + +docs: + content: |- + >ℹ️ Onboarding guide + > + > Check the [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey. + + The Payments Gateway API allows you to get payment data and process your store's transactions. + + ## Payments Gateway API Index + + ### Installments + + - `GET` [Get installments options](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/installments) + + ### Configuration + + - `GET` [List all affiliations](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/affiliations) + - `POST` [Insert a new affiliation](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/affiliations) + - `PUT` [Update affiliation by ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#put-/api/pvt/affiliations/-affiliationId-) + - `GET` [Get affiliation by ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/affiliations/-affiliationId-) + - `GET` [List all payment rules](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/rules) + - `POST` [Insert a new payment rule](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/rules) + - `GET` [Get payment rule by ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/rules/-ruleId-) + - `PUT` [Update payment rule by ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#put-/api/pvt/rules/-ruleId-) + - `DELETE` [Delete payment rule by ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#delete-/api/pvt/rules/-ruleId-) + - `GET` [List all available payment methods](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/merchants/payment-systems) + - `GET` [Get card data](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/payments/pvt/account/-cardId-) + + ### Transaction Process + + - `POST` [Starts a new transaction](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions) + - `POST` [Send payments information](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pub/transactions/-transactionId-/payments) + - `POST` [Send additional data](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/additional-data) + - `PATCH` [Update additional data (optional)](https://developers.vtex.com/docs/api-reference/payments-gateway-api#patch-/api/pvt/transactions/-transactionId-/additional-data) + - `POST` [Authorize new transaction](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/authorization-request) + - `GET` [Get transaction details](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/transactions/-transactionId-) + - `GET` [Get payment details](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/transactions/-transactionId-/payments/-paymentId-) + - `GET` [Get transaction settlement details](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/pvt/transactions/-transactionId-/settlements) + + ### Transaction Flow + + - `POST` [Settle the transaction](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/settlement-request) + - `POST` [Refund the transaction](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/refunding-request) + - `POST` [Cancel the transaction](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/pvt/transactions/-transactionId-/cancellation-request) + + ### Payment Notification + + - `GET` [Send payment notification with payment ID](https://developers.vtex.com/docs/api-reference/payments-gateway-api#get-/api/payments/pvt/payments/-paymentId-/payment-notification) + - `POST` [Send payment notification with payment ID, date, and value paid](https://developers.vtex.com/docs/api-reference/payments-gateway-api#post-/api/payments/pvt/payments/-paymentId-/payment-notification) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pick and Pack API/Authentication/Generate JWT token.yml b/BrunoCollections/VTEX - Pick and Pack API/Authentication/Generate JWT token.yml new file mode 100644 index 0000000000..83fb578e59 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Authentication/Generate JWT token.yml @@ -0,0 +1,65 @@ +info: + name: Generate JWT token + type: http + seq: 1 + +http: + method: POST + url: https://auth.pickingnpacking.com/prod/token + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "apiKey": "{pnpApiKey}" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Generates a `JWT` (JSON Web Token) necessary to access the Pick and Pack API information. To generate the `JWT` it's necessary to have the `API KEY`. To obtain this information, access **VTEX Admin > Shipping > Pick and Pack > Settings > Integration > API Key**. + + >ℹ️ The authentication token expires after 15 minutes + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "message": "success", + "data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJob3N0bmFtZSI6Imxhc3RtaWxlIiwidXNlcm5hbWUiOiJsYXN0bWlsZS5jcmlzdGlhbnJvbWVyb3Z0ZXhjb20iLCJpYXQiOjE3Mzk0NDkyNTMsImV4cCI6MTczOTQ1MDE1M30.lkb1e5XDuUBddthwaxrvi_Ub0YBEAEessJy_bvzb-do" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Authentication/folder.yml b/BrunoCollections/VTEX - Pick and Pack API/Authentication/folder.yml new file mode 100644 index 0000000000..3f929f49d6 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pick and Pack API/Facilities/Get facility by ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Facilities/Get facility by ID.yml new file mode 100644 index 0000000000..2b6daf4c23 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Facilities/Get facility by ID.yml @@ -0,0 +1,82 @@ +info: + name: Get facility by ID + type: http + seq: 1 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/facilities/:facilityId + headers: + - name: Accept + value: application/json + params: + - name: facilityId + value: 783262b09ddc4b8facee2fa50541fd1e + type: path + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves facility details by ID. + + >ℹ️ The response is cached for 30 seconds based on the `facilityId` parameter. The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `facilityId` | path | (Required) Facility ID. | + + ## Example response (`200`) + + ```json + { + "id": "783262b09ddc4b8facee2fa50541fd1e", + "address": "Centro Comercial El Tesoro", + "addressComplement": "Local 650", + "city": "Medellín", + "contactInformation": { + "email": "test@test.com", + "name": "lastmile", + "phone": "310001293" + }, + "country": "COL", + "location": { + "latitude": 6.196547799999999, + "longitude": -75.558908 + }, + "name": "lastmile", + "neighborhood": "El Poblado", + "number": "650", + "postalCode": "050022", + "reference": "Centro Comercial El Tesoro", + "state": "Antioquia" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Facilities/folder.yml b/BrunoCollections/VTEX - Pick and Pack API/Facilities/folder.yml new file mode 100644 index 0000000000..6457a3afb4 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Facilities/folder.yml @@ -0,0 +1,4 @@ +info: + name: Facilities + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Pick and Pack API/Orders/Get order by ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Orders/Get order by ID.yml new file mode 100644 index 0000000000..68425d5093 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Orders/Get order by ID.yml @@ -0,0 +1,63 @@ +info: + name: Get order by ID + type: http + seq: 1 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/orders/:orderId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1509750516095-01 + type: path + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves order details by its ID. + + >ℹ️ The response is cached for 30 seconds based on the `orderId` parameter. The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 4 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Pick and Pack API/Orders/Set order delivery.yml b/BrunoCollections/VTEX - Pick and Pack API/Orders/Set order delivery.yml new file mode 100644 index 0000000000..fd9c8f0fbb --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Orders/Set order delivery.yml @@ -0,0 +1,86 @@ +info: + name: Set order delivery + type: http + seq: 2 + +http: + method: PATCH + url: https://api.pick-and-pack.com/prod/v1/orders/:orderId/tracking + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: orderId + value: 1506390515917-01 + type: path + body: + type: json + data: |- + { + "deliveredDate": "2025-02-13T02:00:00.000Z", + "events": [ + { + "city": "São Paulo", + "state": "SP", + "description": "Delivery", + "date": "2025-02-10T00:00:00.000Z" + } + ] + } + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint finalizes the Pick and Pack workflow by marking the order as delivered. Additionally, it allows you to update the OMS with shipping details. All fields are optional. For more information, see [Update order tracking status](https://developers.vtex.com/docs/api-reference/orders-api#put-/api/oms/pvt/orders/-orderId-/invoice/-invoiceNumber-/tracking) endpoint. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Order ID. | + + ## Example response (`200`) + + ```json + { + "deliveredDate": "2025-02-13T02:00:00.000Z", + "events": [ + { + "city": "São Paulo", + "state": "SP", + "description": "Delivery", + "date": "2025-02-10T00:00:00.000Z" + } + ], + "orderId": "1507400515991-01" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Orders/folder.yml b/BrunoCollections/VTEX - Pick and Pack API/Orders/folder.yml new file mode 100644 index 0000000000..253a49efca --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: Orders + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Pick and Pack API/Shipments/Get shipment by shipment ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Shipments/Get shipment by shipment ID.yml new file mode 100644 index 0000000000..5564be0dbe --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Shipments/Get shipment by shipment ID.yml @@ -0,0 +1,180 @@ +info: + name: Get shipment by shipment ID + type: http + seq: 1 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/shipments/:shipmentId + headers: + - name: X-PNP-FilterMethod + value: BY_EXTERNAL_ID + - name: Accept + value: application/json + params: + - name: shipmentId + value: "5.506934477697174e+29" + type: path + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves detailed information about a shipment using either the internal system ID or the carrier's tracking ID. + + >ℹ️ The response is cached for 30 seconds based on the `shipmentId` parameter and `X-PNP-FilterMethod` header. The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `shipmentId` | path | (Required) Shipment ID. Its value depends on the `X-PNP-FilterMethod` header. Use internal UUID when using `BY_INTERNAL_ID` filter or carrier tracking number when using `BY_EXTERNAL_ID` filter. | + | `X-PNP-FilterMethod` | header | (Required) Determines how the `shipmentId` will be interpreted. Its values can be `BY_INTERNAL_ID` or `BY_EXTERNAL_ID`. | + + ## Example response (`200`) + + ```json + { + "id": "d39e8dd7-0ab9-48c8-b16b-3e46933e113a", + "orderId": "1506500515925-01", + "carrierId": "627eb3b93a19fdc0cf5fe087", + "serviceId": "550693447769717380942093217914", + "carrierName": "Lastmile", + "seller": "lastmile", + "status": "DELIVERED", + "agent": { + "id": "1977157", + "name": "adrianprod adrianprod", + "vehicle": "CAR" + }, + "trackingUrl": "https://lastmile.northlatam.com/tracking/index.html?jobID=41d9275cc4557ac5827e60c273646a33", + "totalDistanceTraveled": 0, + "comments": "-", + "evidences": [ + { + "date": "2025-01-31T19:41:41.780Z", + "type": "IMAGE", + "content": "https://jungl.s3.dualstack.us-west-2.amazonaws.com/acknowledgement_images/1738352496351563420251131-550693447Signature.jpg", + "author": "adrianprod adrianprod" + } + ], + "packages": [ + { + "totalValue": 1040000, + "envelope": "BOX QATEST", + "orderId": "1506500515925-01", + "weight": "0", + "description": "Caja", + "id": "17aa920c-a364-4412-a288-7b269b88f403", + "categories": [ + "Caja" + ], + "items": [ + { + "name": "Bolígrafo", + "image": "https://lastmile.vteximg.com.br/arquivos/ids/156015-55-55/7713133.jpg?v=638375748726030000", + "ean": "4145670347237", + "quantity": 1, + "id": "2366", + "price": 20000 + }, + { + "name": "Woolite Detergente Liquido Ropa Oscura", + "image": "https://lastmile.vteximg.com.br/arquivos/ids/155732-55-55/45.jpg?v=637917078466000000", + "ean": "EAN144", + "quantity": 1, + "id": "45", + "price": 1000000 + }, + { + "name": "Cerveza Heineken Sixpack 269ml", + "image": "https://lastmile.vteximg.com.br/arquivos/ids/155704-55-55/17.jpg?v=637917044926730000", + "ean": "EAN116", + "quantity": 2, + "id": "17", + "price": 10000 + }, + { + "name": "Crema De Whisky Baileys 1lt", + "image": "https://lastmile.vteximg.com.br/arquivos/ids/155706-55-55/19.jpg?v=637917046641670000", + "ean": "EAN118", + "quantity": 2, + "id": "19", + "price": 10000 + } + ], + "dimensions": { + "width": "60", + "length": "60", + "height": "60" + } + } + ], + "type": "PICKUP_DELIVERY", + "notes": [ + { + "date": "2025-01-31T19:41:42.301Z", + "type": "COMMENT", + "content": "Testing", + "author": "adrianprod adrianprod" + }, + { + "date": "2025-01-31T19:42:06.162Z", + "type": "COMMENT", + "content": "Qqqqqq", + "author": "adrianprod adrianprod" + } + ], + "paymentMethod": "ONLINE", + "carrierServiceType": "NATIONAL", + "timezone": { + "offset": 0, + "value": "America/Bogota" + }, + "tags": [], + "deliveredDate": "2025-01-31T19:42:04.953Z", + "sender": { + "name": "lastmile", + "city": "Vancouver", + "state": "BC", + "country": "CAN", + "pickupDate": "2025-01-28T20:24:28.838Z", + "zipCode": "V5Z 2M9" + }, + "receiver": { + "name": "deww", + "city": "Medellín", + "state": "ANTIOQUIA", + "country": "COL", + "deliveryDate": "2025-01-29T19:55:16.000Z", + "zipCode": "05001" + }, + "labels": [] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Shipments/List shipments by order ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Shipments/List shipments by order ID.yml new file mode 100644 index 0000000000..162cad75fd --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Shipments/List shipments by order ID.yml @@ -0,0 +1,84 @@ +info: + name: List shipments by order ID + type: http + seq: 2 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/shipments?orderId=1468301611294-01 + headers: + - name: Accept + value: application/json + params: + - name: orderId + value: 1468301611294-01 + type: query + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all shipments by order ID. + + >ℹ️ The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | query | (Required) Order ID. | + + ## Example response (`200`) + + ```json + [ + { + "id": "d39e8dd7-0ab9-48c8-b16b-3e46933e113a", + "serviceId": "550693447769717380942093217914", + "orderId": "1506500515925-01", + "carrierId": "627eb3b93a19fdc0cf5fe087", + "status": "DELIVERED", + "carrierName": "Lastmile", + "paymentMethod": "ONLINE", + "tags": [], + "deliveredDate": "2025-01-31T19:42:04.953Z", + "customerId": "-", + "customerAddressId": "Bello - Medellin", + "source": "Vancouver-CAN", + "destination": "Medellín-COL", + "courierId": "1977157", + "courierName": "adrianprod adrianprod", + "seller": "lastmile", + "packagesQuantity": 1, + "itemsQuantity": 6, + "serviceType": "PICKUP_DELIVERY", + "creationDate": "2025-01-28T19:56:48.033Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Shipments/folder.yml b/BrunoCollections/VTEX - Pick and Pack API/Shipments/folder.yml new file mode 100644 index 0000000000..7442a95b7a --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Shipments/folder.yml @@ -0,0 +1,4 @@ +info: + name: Shipments + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheet by ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheet by ID.yml new file mode 100644 index 0000000000..37122e3df9 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheet by ID.yml @@ -0,0 +1,59 @@ +info: + name: Get worksheet by ID + type: http + seq: 1 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/worksheets/:worksheetId + headers: + - name: Accept + value: application/json + params: + - name: worksheetId + value: "546744628006" + type: path + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves worksheet details by ID. + + >ℹ️ The response is cached for 30 seconds based on the `worksheetId` parameter. The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `worksheetId` | path | (Required) Worksheet ID. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheets by order ID.yml b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheets by order ID.yml new file mode 100644 index 0000000000..aaf7795b80 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/Get worksheets by order ID.yml @@ -0,0 +1,104 @@ +info: + name: Get worksheets by order ID + type: http + seq: 2 + +http: + method: GET + url: https://api.pick-and-pack.com/prod/v1/worksheets?orderId=1506500515925-01 + headers: + - name: Accept + value: application/json + params: + - name: orderId + value: 1506500515925-01 + type: query + auth: + type: bearer + token: "{{bearerToken}}" + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all worksheets by order ID. + + >ℹ️ The response is cached for 30 seconds based on the `orderId` query parameter. The endpoint supports up to 500 requests per second, with a maximum of 100 concurrent requests. + + >ℹ️ [Generate a JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) to endpoint authentication. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog | Administration | **Homepage** | + | Catalog | Administration | **Help home page** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | Admin - Start page only | Homepage | + | Admin - Start page only | Help home page | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or API keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | query | (Required) Order ID. | + + ## Example response (`200`) + + ```json + [ + { + "id": "c13ed6d8-1c86-4ad9-be63-5e2f4c5451b2", + "facilityId": "783262b09ddc4b8facee2fa50541fd1e", + "worksheetId": "546744628006", + "categoriesIds": [ + "12", + "6", + "7", + "9" + ], + "finishedDate": null, + "initDate": "2025-02-11T00:33:18.584Z", + "status": "COMPLETED", + "ordersIds": [ + { + "orderId": "1509780516107-01", + "unitsQuantity": 16, + "itemsQuantity": 4 + } + ], + "hostname": "lastmile", + "items": [], + "pickerAssignment": [ + { + "notes": [], + "method": "MANUAL", + "active": true, + "assignmentDate": "2025-02-11T00:32:48.194Z", + "pickerId": "pickertalleruno", + "finishedDate": null + } + ], + "itemsQuantity": 4, + "unitsQuantity": 16, + "completedUnitsQuantity": 16, + "packedUnitsQuantity": 4, + "deliveryWindow": { + "minDate": "2025-02-13T16:03:55.202Z", + "maxDate": "2025-02-13T16:03:55.202Z" + }, + "createdAt": "2025-02-11T00:32:47.542Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack API/Worksheets/folder.yml b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/folder.yml new file mode 100644 index 0000000000..eaecd6ea12 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/Worksheets/folder.yml @@ -0,0 +1,4 @@ +info: + name: Worksheets + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Pick and Pack API/environments/VTEX.yml b/BrunoCollections/VTEX - Pick and Pack API/environments/VTEX.yml new file mode 100644 index 0000000000..b4d3f12c24 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: https://auth.pickingnpacking.com/prod + - secret: true + name: bearerToken diff --git a/BrunoCollections/VTEX - Pick and Pack API/opencollection.yml b/BrunoCollections/VTEX - Pick and Pack API/opencollection.yml new file mode 100644 index 0000000000..9d8a2838ba --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack API/opencollection.yml @@ -0,0 +1,71 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pick and Pack API + +request: + auth: + type: bearer + token: "{{bearerToken}}" + +docs: + content: |- + The Pick and Pack API provides comprehensive functionality for order management, picking operations, shipment tracking, and returns processing. The main capabilities include: + + - Retrieving detailed order information, including items, packages, and status + - Accessing worksheet data for picking operations + - Querying shipment tracking and delivery details + - Getting facility information + + ## Authentication + + - `POST` [Generate JWT token](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#post-/token) + + ## Orders + + - `GET` [Get order by ID](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/orders/-orderId-) + - `PATCH` [Set order delivery](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#patch-/orders/-orderId-/tracking) + + ## Worksheets + + - `GET` [Get worksheet by ID](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/worksheets/-worksheetId-) + - `GET` [Get worksheets by order ID](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/worksheets) + + ## Facilities + + - `GET` [Get facility by ID](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/facilities/-facilityId-) + + ## Shipments + + - `GET` [Get shipment](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/shipments/-shipmentId-) + - `GET` [List shipments](https://developers.vtex.com/docs/api-reference/pick-and-pack-api#get-/shipments/-orderId-) + + ## Common issues and solutions + + In case of errors making a request, check the list of common issues and their solutions below. + + ### 1. Token expiration + + - Authentication token expires after 15 minutes. + - Check console logs for refresh attempt. + - Verify `APIKEY_ACCOUNT` format. + - Ensure that endpoint URLs are correct. + + ### 2. Variable errors + + - Check variable syntax. + - Validate API key format. + + ### 3. Cache-related issues + + - Response data might appear stale due to API caching. + - Endpoints have a specific cache duration of 30 seconds. + - For real-time data, consider the cache duration when implementing polling strategies. + - Cache is based on specific parameters (e.g., `orderId`, `shipmentId`). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pick and Pack Changes API/Update items of the order.yml b/BrunoCollections/VTEX - Pick and Pack Changes API/Update items of the order.yml new file mode 100644 index 0000000000..7c90f545a5 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Changes API/Update items of the order.yml @@ -0,0 +1,106 @@ +info: + name: Update items of the order + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/order/changes" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + body: + type: json + data: |- + { + "type": "ADD_ITEM", + "orderId": "1481110515526-01", + "itemId": "49", + "quantity": 2, + "warehouseId": "9029", + "price": 500000, + "sellingPrice": 200000, + "note": "TEST from VTEX PROXY 3", + "pickingOptions": { + "onNotFound": "REPLACE", + "alternateOptions": [ + "74" + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/order/changes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/order/changes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/order/changes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/order/changes - Schema is valid", function () { + const schema = {"required":["type","orderId","itemId","quantity","warehouseId","price","sellingPrice","note","pickingOptions"],"type":"object","properties":{"type":{"type":"string","description":"Action type (`ADD_ITEM`)."},"orderId":{"type":"string","description":"Unique identifier of the order."},"itemId":{"type":"string","description":"Unique identifier of the item."},"quantity":{"type":"integer","description":"Quantity of items to add."},"warehouseId":{"type":"string","description":"Unique identifier of the warehouse."},"price":{"type":"integer","description":"Price of the item."},"sellingPrice":{"type":"integer","description":"Selling price of the item."},"note":{"type":"string","description":"Note to add to the item."},"pickingOptions":{"required":["onNotFound","alternateOptions"],"type":"object","description":"Items picking options.","properties":{"onNotFound":{"type":"string","description":"List of alternate options."},"alternateOptions":{"type":"array","items":{"type":"string","description":"ID of alternative items."},"description":"List of IDs of alternative items."}}}},"example":{"type":"ADD_ITEM","orderId":"1481110515526-01","itemId":"49","quantity":2,"warehouseId":"9029","price":500000,"sellingPrice":200000,"note":"TEST from VTEX PROXY 3","pickingOptions":{"onNotFound":"REPLACE","alternateOptions":["74"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Modifies an order by adding, updating, or removing items. The endpoint supports actions like adding items, modifying quantities, rejecting or replacing items, and updating item details, adding notes and suggest product replacements. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + >⚠️ Before using this endpoint, you must make a request with the [Cart simulation](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation) endpoint to check inventory availability. For more information of how to simulate a cart, check the [Simulate a shopping cart](https://developers.vtex.com/docs/guides/simulate-a-shopping-cart) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "message": "Error requesting picking action" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Changes API/Update order deadline.yml b/BrunoCollections/VTEX - Pick and Pack Changes API/Update order deadline.yml new file mode 100644 index 0000000000..631bbcaa61 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Changes API/Update order deadline.yml @@ -0,0 +1,121 @@ +info: + name: Update order deadline + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/orders/:orderId/deadline" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1481050515517-01 + type: path + body: + type: json + data: |- + { + "UpdateDeadline": { + "description": "Extend deadline due to delayed shipment", + "max": "2024-12-24T23:03:02Z", + "min": "2024-12-23T23:03:02Z" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/orders/:orderId/deadline - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/orders/:orderId/deadline - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/orders/:orderId/deadline - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/orders/:orderId/deadline - Schema is valid", function () { + const schema = {"type":"object","properties":{"order":{"description":"Object with current deadline information.","type":"object","properties":{"currentDeadline":{"description":"Current deadline information.","type":"object","properties":{"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"}}},"deadlineChanges":{"description":"Object containg information of the deadline changes.","type":"array","items":{"description":"Deadline change.","type":"object","properties":{"current":{"description":"If the deadline changes were update.","type":"boolean"},"description":{"description":"Reason or purpose for the update.","type":"string"},"handled":{"description":"If the deadline changes were handled by the picker.","type":"boolean"},"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"},"oldDates":{"description":"Object containg previous deadline information.","type":"object","properties":{"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"}}},"updatedAt":{"description":"An explanation about the purpose of this instance.","type":"string"}}}},"orderId":{"description":"Unique identifier of the order.","type":"string"}}},"success":{"description":"Condition if the request was successful.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the deadline for an order. The `min` and `max` fields specify the deadline window, while the description provides additional information. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Unique identifier of the order. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "order": { + "currentDeadline": { + "max": "2024-12-24T23:03:02Z", + "min": "2024-12-23T23:03:02Z" + }, + "deadlineChanges": [ + { + "current": true, + "description": "Extend deadline due to delayed shipment", + "handled": true, + "max": "2024-12-24T23:03:02.000Z", + "min": "2024-12-23T23:03:02.000Z", + "oldDates": { + "max": "2024-12-04T17:20:48.088Z", + "min": "2024-12-04T17:20:48.088Z" + }, + "updatedAt": "2024-12-03T17:35:59.786Z" + } + ], + "orderId": "1481050515517-01" + }, + "success": true + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Changes API/environments/VTEX.yml b/BrunoCollections/VTEX - Pick and Pack Changes API/environments/VTEX.yml new file mode 100644 index 0000000000..660f043d60 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Changes API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/vtex_pickandpack + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Pick and Pack Changes API/opencollection.yml b/BrunoCollections/VTEX - Pick and Pack Changes API/opencollection.yml new file mode 100644 index 0000000000..f61a82a7b8 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Changes API/opencollection.yml @@ -0,0 +1,29 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pick and Pack Changes API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Pick and Pack Order Changes API manages order modifications in a Pick an Pack order. This API supports actions like updating deadlines, adding items, modifying quantities, rejecting or replacing items, and updating item details. + + >ℹ️ This API is currently in beta and subject to changes. Use with caution in production environments. + + ## Index + + - `PUT` [Update order deadline](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#put-/orders/-orderId-/deadline?endpoint=put-/orders/-orderId-/deadline) + - `POST`[Update items of the order](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#post-/order/changes?endpoint=post/order/changes) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/Create JWT token.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/Create JWT token.yml new file mode 100644 index 0000000000..873bfe772f --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/Create JWT token.yml @@ -0,0 +1,51 @@ +info: + name: Create JWT token + type: http + seq: 1 + +http: + method: POST + url: https://auth.pickingnpacking.com/:environment/token + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "apiKey": "{pnpApiKey}" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a `JWT` (JSON Web Token) necessary to access the Pick and Pack Last Mile Protocol API information. + + >ℹ️ To generate the `JWT` it is necessary to have the `API KEY` previously generated by the Pick and Pack team. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {token} + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/folder.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/folder.yml new file mode 100644 index 0000000000..3f929f49d6 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/Calculate rates.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/Calculate rates.yml new file mode 100644 index 0000000000..0761d32136 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/Calculate rates.yml @@ -0,0 +1,173 @@ +info: + name: Calculate rates + type: http + seq: 1 + +http: + method: POST + url: https://:store_endpoint/rates + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + body: + type: json + data: |- + { + "orderId": "SLR-29384924-01", + "carrierId": "servientrega-50461c9f3335", + "seller": "qaolimpica", + "sender": { + "name": "Tabitha Sears", + "phone": "+57 2305781612", + "email": "tabitha_sears@fortean.brother", + "city": "Jenkinsville", + "state": "Northern Mariana Islands", + "country": "US", + "address": "77 Sullivan Place, Jenkinsville, Northern Mariana Islands", + "addressComplement": "Flat 45", + "number": "1029", + "reference": "3", + "location": { + "latitude": -75.269008, + "longitude": 137.499833 + }, + "pickupDate": "2024-04-25T18:06:41.202Z" + }, + "receiver": { + "name": "Pansy Graves", + "phone": "+57 4240807147", + "email": "pansy_graves@zentime.moda", + "city": "Valle", + "state": "Marshall Islands", + "country": "Iceland", + "neighborhood": "Billings", + "number": "9840", + "reference": "63 Billings Place, Valle, Marshall Islands", + "addressComplement": "Flat 32", + "location": { + "latitude": -33.249891, + "longitude": -135.052901 + }, + "identification": "9541933267", + "deliveryDate": "2024-04-16T20:49:36.117Z", + "contactName": "Savannah Porter", + "deliveryWindow": { + "name": "consectetur", + "initialDate": "2024-04-25T22:50:41.209Z", + "finalDate": "2024-05-05T21:50:41.210Z" + } + }, + "packages": [ + { + "id": "6266df719ac55224b793ad36", + "orderId": "SLR-1221800709659-01", + "envelope": "Large", + "description": "Delicate package", + "categories": [ + "Foods" + ], + "dimensions": { + "width": "68", + "height": "43", + "length": "13" + }, + "weight": "19", + "totalValue": 5616.01, + "items": [ + { + "id": "6266df71a19ebe35637e1f42", + "name": "Tomatos", + "ean": "473390795673", + "refId": "6266", + "image": "https://static9.depositphotos.com/1628352/1107/i/600/depositphotos_11071361-stock-photo-tomato.jpg", + "type": "Food", + "price": 774230.01, + "weight": "4 kg", + "quantity": 4 + } + ] + } + ], + "type": "PICKUP_DELIVERY", + "carrierServiceType": "OTHERS", + "comments": "Delivery comments.", + "paymentMethod": "CASH_ON_DELIVERY", + "orderValue": 8000, + "settings": [ + { + "label": "Key secret", + "value": "keysecret-0122", + "key": "secrekey" + } + ], + "timezone": { + "offset": 300, + "value": "America/Bogota" + } + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/rates - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/rates - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/rates - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/rates - Schema is valid", function () { + const schema = {"required":["message","data"],"type":"object","properties":{"message":{"type":"string","description":"Status message about the request."},"data":{"type":"object","description":"Service general information.","required":["id","orderId","carrierId","serviceId","carrierName","seller","status","type","tags","labels","evidences","packages","timeline","notes","timezone","carrierLogo","trackingUrl","comments","paymentMethod","carrierServiceType","rate","shippingEstimatedDate","shippingFinishedDate","metaData"],"properties":{"id":{"type":"string","description":"Service ID."},"orderId":{"type":"string","description":"Order ID."},"carrierId":{"type":"string","description":"Carrier ID."},"serviceId":{"type":"string","description":"Service ID."},"carrierName":{"type":"string","description":"Carrier name."},"seller":{"type":"string","description":"Identifier representing the seller associated with the order."},"status":{"type":"string","description":"Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"type":{"type":"string","description":"Order's type of delivery, `Delivery` or [`Pickup`](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)."},"tags":{"type":"array","items":{"type":"string","description":"Extra information added in the order."},"description":"Array of tags."},"labels":{"type":"array","items":{"required":["id","name","url","type"],"type":"object","properties":{"id":{"type":"string","description":"Label ID."},"name":{"type":"string","description":"Name of the label."},"url":{"type":"string","description":"Label URL."},"type":{"type":"string","description":"Label's type of file."}}},"description":"Array containing information about all shipping labels printed in the order."},"evidences":{"type":"array","items":{"type":"string","description":"Message explaining the delivery incident."},"description":"Array with additional notes when an incident occurs in the delivery of the package."},"packages":{"type":"array","items":{"required":["id","orderId","envelope","dimensions","weight","totalValue","items","categories","description"],"type":"object","description":"Package information.","properties":{"id":{"type":"string","description":"Package ID."},"orderId":{"type":"string","description":"Order ID."},"envelope":{"type":"string","description":"Name of the envelope used."},"dimensions":{"description":"Package dimensions.","required":["height","length","width"],"type":"object","properties":{"height":{"type":"string","description":"Package height in centimeters."},"length":{"type":"string","description":"Package length in centimeters."},"width":{"type":"string","description":"Package width in centimeters."}}},"weight":{"type":"string","description":"Package weight in grams."},"totalValue":{"type":"integer","format":"int32","description":"Total value of the order."},"items":{"type":"array","items":{"description":"Product general information.","title":"Item","required":["id","name","ean","quantity","price","refId","image","type","weight"],"type":"object","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product name."},"ean":{"type":"string","description":"Unique SKU identification code (barcode). Up to 13 numerical characters."},"quantity":{"type":"integer","format":"int32","description":"Quantity of units of the product."},"price":{"type":"integer","format":"int32","description":"Product price in cents."},"refId":{"type":"string","description":"Product reference ID."},"image":{"type":"string","description":"SKU image."},"type":{"type":"string","description":"Item type."},"weight":{"type":"string","description":"Product weight in grams."}}},"description":"Array containing information about the order's products."},"categories":{"type":"array","items":{"type":"string","description":"Category name."},"description":"Array of categories."},"description":{"type":"string","description":"Package description."}}},"description":"Array containing information about all order's packages."},"timeline":{"type":"array","items":{"required":["id","date","createdAt","updatedAt","type","description","author","metaData"],"type":"object","properties":{"id":{"type":"string","description":"Timeline ID."},"date":{"type":"string","description":"Timeline actual date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"createdAt":{"type":"string","description":"Order's creation date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"updatedAt":{"type":"string","description":"Date of the order's last update in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"type":{"type":"string","description":"Order status."},"description":{"type":"string","description":"Description of the status."},"author":{"type":"string","description":"Status author."},"metaData":{"description":"Metadata about the delivery information.","title":"MetaData","type":"object","properties":{"0":{"description":"Item ID in the cart.","required":["type","note","author"],"type":"object","properties":{"type":{"type":"string","description":"Type of extra information about the item's shipping."},"note":{"type":"string","description":"Text with extra information about the item's shipping."},"author":{"type":"string","description":"Author."}}},"shippingEstimatedDate":{"type":["string","null"],"description":"Order's Shipping estimated date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"metaData":{"type":["string","null"],"description":"Metadata."},"serviceId":{"type":"string","description":"Service ID."},"shippingPrice":{"type":"number","description":"Order's shipping price in cents."},"status":{"type":"string","description":"Shipping status."},"labels":{"type":"array","items":{"required":["id","name","url","type"],"type":"object","properties":{"id":{"type":"string","description":"Label ID."},"name":{"type":"string","description":"Name of the label."},"url":{"type":"string","description":"Label URL."},"type":{"type":"string","description":"Label's type of file."}}},"description":"Shipping labels, there may be more than one per order due to breakage in packages."},"trackingUrl":{"type":"string","description":"Carrier's tracking URL of the order."},"name":{"type":"string","description":"Carrier name."},"id":{"type":"string","description":"Tracking ID."},"type":{"type":"string","description":"Type of transportation."},"url":{"type":"string","description":"Carrier URL."}}}}},"description":"Array containing information about the timeline of order changes."},"notes":{"type":"array","items":{"required":["type","date","content","author"],"type":"object","description":"Notes with delivery information.","properties":{"type":{"type":"string","description":"Type of note."},"date":{"type":"string","description":"Date of creation of the note in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"content":{"type":"string","description":"Content of the note."},"author":{"type":"string","description":"Author of the note."}}},"description":"Array with services information."},"timezone":{"required":["offset","value","label"],"type":"object","description":"Time zone information.","properties":{"offset":{"type":"integer","format":"int32","description":"Time zone offset."},"value":{"type":"string","description":"Time zone."},"label":{"type":["string","null"],"description":"Label."}}},"carrierLogo":{"type":"string","description":"Carrier logo."},"trackingUrl":{"type":"string","description":"Tracking URL."},"comments":{"type":"string","description":"Comments."},"paymentMethod":{"type":"string","description":"Payment method."},"carrierServiceType":{"type":"string","description":"Carrier service type. The `carrierServiceType` value is not limited to these specific values. It will be defined by the carrier integrating with the Pick and Pack Last Mile Protocol API.","enum":["BROKER","PICKUP_IN_STORE","NATIONAL","INTERNATIONAL","EXPRESS","SPECIALIZED","OTHERS"]},"rate":{"required":["shippingPrice","insurancePrice"],"type":"object","description":"Rate cost information.","properties":{"shippingPrice":{"required":["value","currency"],"type":"object","description":"Shipping cost information.","properties":{"value":{"type":"integer","format":"int32","description":"Shipping cost in cents."},"currency":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."}}},"insurancePrice":{"required":["value","currency"],"type":"object","description":"Insurance cost information.","properties":{"value":{"type":"integer","format":"int32","description":"Insurance cost in cents."},"currency":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."}}}}},"shippingEstimatedDate":{"type":"string","description":"Shipping estimated date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"shippingFinishedDate":{"type":["string","null"],"description":"Shipping finished date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"metaData":{"required":["integrationResponse","carrier"],"type":"object","description":"Metadata about the Carrier.","properties":{"integrationResponse":{"type":"object","description":"Carrier integration information."},"carrier":{"required":["name","image","metaData","id","type"],"type":"object","description":"Object containing information about a carrier.","properties":{"name":{"type":"string","description":"Carrier name."},"image":{"type":["string","null"],"description":"Carrier logo."},"metaData":{"type":"object","description":"Carrier metadata."},"id":{"type":"string","description":"Carrier ID."},"type":{"description":"Carrier type.","title":"Type","required":["metaData","terms","rate","name","transitTime","shippingEstimatedDate","description","id","international"],"type":"object","properties":{"metaData":{"type":"object","description":"Carrier metadata."},"terms":{"type":"string","description":"Carrier terms."},"rate":{"description":"Carrier rate.","required":["shippingPrice","insurancePrice"],"type":"object","properties":{"shippingPrice":{"required":["value","currency"],"type":"object","description":"Shipping cost information.","properties":{"value":{"type":"integer","format":"int32","description":"Shipping cost in cents."},"currency":{"type":"string","description":"Cost currency code in [ISO 4217](https://www.iban.com/currency-codes) format.."}}},"insurancePrice":{"required":["value","currency"],"type":"object","description":"Insurance cost information.","properties":{"value":{"type":"integer","format":"int32","description":"Insurance cost in cents."},"currency":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."}}}}},"name":{"type":"string","description":"Carrier name."},"transitTime":{"type":"integer","format":"int32","description":"Carrier transit time."},"shippingEstimatedDate":{"type":["string","null"],"description":"Carrier Shipping estimated date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"description":{"type":"string","description":"Carrier description."},"id":{"type":"string","description":"Carrier ID."},"international":{"type":"boolean","description":"Defines if the carrier is international (`true`) or not (`false`)."}}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all rates from the carriers. To understand how to integrate with a carrier, check the [VTEX Pick and Pack Carriers Integration Protocol](https://developers.vtex.com/docs/guides/vtex-pick-and-pack) guide. + + This endpoint must be developed by the carriers or brokers to integrate into the protocol. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + _Omitted here: 7 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/List carriers.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/List carriers.yml new file mode 100644 index 0000000000..bb84f180f4 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/List carriers.yml @@ -0,0 +1,120 @@ +info: + name: List carriers + type: http + seq: 2 + +http: + method: POST + url: https://:store_endpoint/list-carriers + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + body: + type: json + data: |- + { + "settings": [ + { + "label": "Api key", + "key": "aftership-api-key", + "value": "8f_XXXXXXXXX_db79" + }, + { + "label": "Api key", + "key": "aftership-api-key", + "value": "8f_XXXXXXXXX_db79" + } + ] + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/list-carriers - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/list-carriers - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/list-carriers - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/list-carriers - Schema is valid", function () { + const schema = {"type":"object","required":["status","serviceId","shippingPrice","metaData","shippingEstimatedDate","labels"],"properties":{"status":{"type":"string","description":"Status of the service.","enum":["PENDING","ASSIGNED","PICKED","ON_ROUTE","INCIDENT","RETURNED","DELIVERED","CANCELED","ON_HOLD"]},"serviceId":{"type":"string","description":"Service ID."},"shippingPrice":{"type":"number","description":"Service shipping price."},"metaData":{"type":"object","properties":{"{keyValue}":{"description":"Carrier additional information.","type":"string"}}},"shippingEstimatedDate":{"type":"string","description":"Shipping estimated date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"labels":{"type":"array","items":{"required":["id","name","url","type"],"type":"object","properties":{"id":{"type":"string","description":"Label ID."},"name":{"type":"string","description":"Name of the label."},"url":{"type":"string","description":"Label URL."},"type":{"type":"string","description":"Label's type of file."}}},"description":"Shipping labels, there may be more than one per order due to breakage in packages."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all carriers from the broker. + + This endpoint must be developed by the carriers or brokers to integrate into the protocol. + + This endpoint only applies to multi-carrier integrations such as Shipstation or Shippo. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "status": "PENDING", + "serviceId": "ASDF23324KDSF2", + "shippingPrice": 20000.09, + "metaData": { + "anyKey": "anyValue" + }, + "shippingEstimatedDate": "2024-05-29T22:36:37.589Z", + "labels": [ + { + "id": "ut nulla", + "name": "qui", + "url": "dolor tempor", + "type": "ea nulla magna elit" + }, + { + "id": "ipsum in", + "name": "eiusmod fugiat Excepteur", + "url": "dolore voluptate qui", + "type": "aut" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/folder.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/folder.yml new file mode 100644 index 0000000000..9d0166155e --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Carriers/folder.yml @@ -0,0 +1,4 @@ +info: + name: Carriers + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/Create service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/Create service.yml new file mode 100644 index 0000000000..58597fc216 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/Create service.yml @@ -0,0 +1,209 @@ +info: + name: Create service + type: http + seq: 1 + +http: + method: POST + url: https://:store_endpoint/create-service + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + body: + type: json + data: |- + { + "orderId": "SLR-29384924-01", + "carrierId": "servientrega-50461c9f3335", + "seller": "qaolimpica", + "sender": { + "name": "Tabitha Sears", + "phone": "+57 2305781612", + "email": "tabitha_sears@fortean.brother", + "city": "Jenkinsville", + "state": "Northern Mariana Islands", + "country": "US", + "address": "77 Sullivan Place, Jenkinsville, Northern Mariana Islands", + "addressComplement": "Flat 45", + "number": "1029", + "reference": "3", + "location": { + "latitude": -75.269008, + "longitude": 137.499833 + }, + "pickupDate": "2024-04-25T18:06:41.202Z" + }, + "receiver": { + "name": "Pansy Graves", + "phone": "+57 4240807147", + "email": "pansy_graves@zentime.moda", + "city": "Valle", + "state": "Marshall Islands", + "country": "Iceland", + "neighborhood": "Billings", + "number": "9840", + "reference": "63 Billings Place, Valle, Marshall Islands", + "addressComplement": "Flat 45", + "location": { + "latitude": -33.249891, + "longitude": -135.052901 + }, + "identification": "9541933267", + "deliveryDate": "2024-04-16T20:49:36.117Z", + "contactName": "Savannah Porter", + "deliveryWindow": { + "name": "consectetur", + "initialDate": "2024-04-25T22:50:41.209Z", + "finalDate": "2024-05-05T21:50:41.210Z" + } + }, + "packages": [ + { + "id": "6266df719ac55224b793ad36", + "orderId": "SLR-1221800709659-01", + "envelope": "Large", + "description": "Delicate package", + "categories": [ + "Cellphone", + "Technology" + ], + "dimensions": { + "width": "68", + "height": "43", + "length": "13" + }, + "weight": "19", + "totalValue": 5616.01, + "items": [ + { + "id": "6266df71a19ebe35637e1f42", + "name": "Tomatos", + "ean": "473390795673", + "refId": "6266", + "image": "https://static9.depositphotos.com/1628352/1107/i/600/depositphotos_11071361-stock-photo-tomato.jpg", + "type": "Food", + "price": 774230.01, + "weight": "4 kg", + "quantity": 4 + }, + { + "id": "6266df71803601c3bc4e2d99", + "name": "Tomatos", + "ean": "329949764612", + "refId": "6266", + "image": "https://static9.depositphotos.com/1628352/1107/i/600/depositphotos_11071361-stock-photo-cellphone.jpg", + "type": "Foods", + "price": 23162, + "weight": "14 kg", + "quantity": 9 + } + ] + } + ], + "type": "PICKUP_DELIVERY", + "carrierServiceType": "OTHERS", + "comments": "Delivery comments.", + "paymentMethod": "CASH_ON_DELIVERY", + "orderValue": 8000, + "settings": [ + { + "label": "Key secret", + "value": "keysecret-0122", + "key": "secrekey" + } + ], + "timezone": { + "offset": 300, + "value": "America/Bogota" + } + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/create-service - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/create-service - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/create-service - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/create-service - Schema is valid", function () { + const schema = {"type":"object","required":["status","serviceId","shippingPrice","metaData","shippingEstimatedDate","labels"],"properties":{"status":{"type":"string","description":"Status of the service.","enum":["PENDING","ASSIGNED","PICKED","ON_ROUTE","INCIDENT","RETURNED","DELIVERED","CANCELED","ON_HOLD"]},"serviceId":{"type":"string","description":"Service ID."},"shippingPrice":{"type":"number","description":"Service shipping price."},"metaData":{"type":"object","properties":{"{keyValue}":{"description":"Carrier additional information.","type":"string"}}},"shippingEstimatedDate":{"type":"string","description":"Shipping estimated date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"labels":{"type":"array","items":{"required":["id","name","url","type"],"type":"object","properties":{"id":{"type":"string","description":"Label ID."},"name":{"type":"string","description":"Name of the label."},"url":{"type":"string","description":"Label URL."},"type":{"type":"string","description":"Label's type of file."}}},"description":"Shipping labels, there may be more than one per order due to breakage in packages."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a service with the information that VTEX will send to the carrier. To understand how to integrate with a carrier, check the [VTEX Pick and Pack Carriers Integration Protocol](https://developers.vtex.com/docs/guides/vtex-pick-and-pack) guide. + + This endpoint must be developed by the carriers or brokers to integrate into the protocol. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "status": "PENDING", + "serviceId": "ASDF23324KDSF2", + "shippingPrice": 20000.09, + "metaData": { + "anyKey": "anyValue" + }, + "shippingEstimatedDate": "2024-05-29T22:36:37.589Z", + "labels": [ + { + "id": "ut nulla", + "name": "qui", + "url": "dolor tempor", + "type": "ea nulla magna elit" + }, + { + "id": "ipsum in", + "name": "eiusmod fugiat Excepteur", + "url": "dolore voluptate qui", + "type": "aut" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/folder.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/folder.yml new file mode 100644 index 0000000000..924204b60c --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Service integration/folder.yml @@ -0,0 +1,8 @@ +info: + name: Service integration + type: folder + seq: 2 + +docs: + content: These endpoints must be developed to integrate with the Lastmile Pick and Pack Last Mile Protocol API. + type: text/markdown diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel ongoing service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel ongoing service.yml new file mode 100644 index 0000000000..966d7a23b9 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel ongoing service.yml @@ -0,0 +1,67 @@ +info: + name: Cancel ongoing service + type: http + seq: 6 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/cancel/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + { + "comment": "The delivery address was changed", + "type": "END_CLIENT_CANCELED" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Resquest that will cancel an ongoing shipping service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Service canceled successfully", + "data": { + "comment": "The delivery address was changed", + "type": "END_CLIENT_CANCELED" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel service.yml new file mode 100644 index 0000000000..75a21c36cd --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Cancel service.yml @@ -0,0 +1,107 @@ +info: + name: Cancel service + type: http + seq: 7 + +http: + method: POST + url: https://:store_endpoint/cancel-service + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + body: + type: json + data: |- + { + "serviceId": "apknieot924892jaf-1231", + "carrierId": "servientrega9234jaf", + "settings": [ + { + "label": "Cliente ID", + "key": "clientId", + "value": "HUR123" + }, + { + "label": "Cliente ID", + "key": "clientId", + "value": "HUR123" + } + ], + "reason": "La dirección de entrega esta mal registrada", + "metaData": { + "myFieldCustom": "custom value" + } + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/cancel-service - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/cancel-service - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/cancel-service - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/cancel-service - Schema is valid", function () { + const schema = {"type":"object","required":["message","data"],"properties":{"message":{"type":"string","description":"Message of successful cancelation."},"data":{"type":"object","description":"Object containing service information.","required":["serviceId","carrierId","reason"],"properties":{"serviceId":{"type":"string","description":"Service ID."},"carrierId":{"type":"string","description":"Carrier ID."},"reason":{"type":"string","description":"Reason for the cancelation."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels a specific service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Service executed successfully", + "data": { + "serviceId": "apknieot924892jaf-1231", + "carrierId": "servientrega9234jaf", + "reason": "En el lugar de residencia no hay quien reciba el paquete" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create evidence.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create evidence.yml new file mode 100644 index 0000000000..6d35d14da5 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create evidence.yml @@ -0,0 +1,83 @@ +info: + name: Create evidence + type: http + seq: 4 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/evidences/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + [ + { + "type": "IMAGE", + "content": "https://parkers-images.bauersecure.com/wp-images/18727/courier-van-insurance-01.jpg", + "author": "Felipe Cardenas" + }, + { + "type": "TEXT", + "content": "The package was delivered", + "author": "Felipe Cardenas" + } + ] + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows the carrier to add evidence of delivery or pickup to the shipping service, as photos, text. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Evidences saved successfully", + "data": [ + { + "type": "IMAGE", + "content": "https://parkers-images.bauersecure.com/wp-images/18727/courier-van-insurance-01.jpg", + "author": "Felipe Cardenas" + }, + { + "type": "TEXT", + "content": "The package was delivered", + "author": "Felipe Cardenas" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create label.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create label.yml new file mode 100644 index 0000000000..0bce420e2e --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create label.yml @@ -0,0 +1,75 @@ +info: + name: Create label + type: http + seq: 5 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/labels/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + { + "id": "JADF8ADF89-7AD7AF-78ADFASDF", + "url": "http://s3://mybucket-alpha/orc/2013-10-04-custdata/label-pickup.pdf", + "name": "Delivery label", + "type": "PDF" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows the carrier to create and add a shipping label to an order. + + It is important that the tag ID is a unique value, if this value is repeated it will throw an exception. + + > ⚠️ If the label is type `BASE64` or `TXT`, the max size that allowed is 180kb. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Label saved successfully", + "data": { + "id": "JADF8ADF89-7AD7AF-78ADFASDF", + "url": "http://s3://mybucket-alpha/orc/2013-10-04-custdata/label-pickup.pdf", + "name": "Delivery label", + "type": "PDF" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create notes.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create notes.yml new file mode 100644 index 0000000000..6733c5c9c2 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create notes.yml @@ -0,0 +1,83 @@ +info: + name: Create notes + type: http + seq: 3 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/notes/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + [ + { + "type": "ERROR", + "note": "The package takes time to be shipped", + "author": "Oscar Rojas" + }, + { + "type": "COMMENT", + "note": "The package was picked up", + "author": "Oscar Rojas" + } + ] + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows carriers to add notes and information on existing services. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Notes saved successfully", + "data": [ + { + "type": "ERROR", + "note": "The package takes time to be shipped", + "author": "Oscar Rojas" + }, + { + "type": "COMMENT", + "note": "The package was picked up", + "author": "Oscar Rojas" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create on hold service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create on hold service.yml new file mode 100644 index 0000000000..989c3dc6e0 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Create on hold service.yml @@ -0,0 +1,67 @@ +info: + name: Create on hold service + type: http + seq: 9 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/on-hold/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + { + "comment": "The delivery address was changed", + "type": "END_CLIENT_PAUSE" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Request that allows a carrier to temporarily pause a shipping service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Service on hold successfully", + "data": { + "comment": "The delivery address was changed", + "type": "END_CLIENT_PAUSE" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Get service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Get service.yml new file mode 100644 index 0000000000..01c47ff2ad --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Get service.yml @@ -0,0 +1,52 @@ +info: + name: Get service + type: http + seq: 1 + +http: + method: GET + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information about a service, which can be queried by providing the carrier ID and the corresponding service ID as query parameters. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID generated by the carrier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Pause and resume service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Pause and resume service.yml new file mode 100644 index 0000000000..98e758946a --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Pause and resume service.yml @@ -0,0 +1,109 @@ +info: + name: Pause and resume service + type: http + seq: 8 + +http: + method: POST + url: https://:store_endpoint/pause-service + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + body: + type: json + data: |- + { + "serviceId": "apknieot924892jaf-1231", + "carrierId": "servientrega9234jaf", + "settings": [ + { + "label": "Cliente ID", + "key": "clientId", + "value": "HUR123" + }, + { + "label": "Cliente ID", + "key": "clientId", + "value": "HUR123" + } + ], + "reason": "La dirección de entrega esta mal registrada", + "metaData": { + "myFieldCustom": "custom value" + }, + "pause": false + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/pause-service - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/pause-service - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/pause-service - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/pause-service - Schema is valid", function () { + const schema = {"type":"object","required":["message","data"],"properties":{"message":{"type":"string","description":"Message of successful cancelation."},"data":{"type":"object","description":"Object containing service information.","required":["serviceId","carrierId","reason"],"properties":{"serviceId":{"type":"string","description":"Service ID."},"carrierId":{"type":"string","description":"Carrier ID."},"cancel":{"type":"boolean","description":"Condition that the service is paused (`false`) or not (`true`)."},"reason":{"type":"string","description":"Reason for the cancelation."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Pauses or resumes a paused service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Service executed successfully", + "data": { + "serviceId": "apknieot924892jaf-1231", + "carrierId": "servientrega9234jaf", + "reason": "En el lugar de residencia no hay quien reciba el paquete", + "cancel": false + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Update service.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Update service.yml new file mode 100644 index 0000000000..c5dc8cbc31 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/Update service.yml @@ -0,0 +1,94 @@ +info: + name: Update service + type: http + seq: 2 + +http: + method: PATCH + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: environment + value: DefaultParameterValue + type: path + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + body: + type: json + data: |- + { + "message": "Service updated successfully", + "data": { + "status": "PENDING", + "agent": { + "id": "27327489234", + "name": "Pedro", + "identification": "020323809", + "phone": "+57314855674", + "email": "pedro434234@gmailc.om", + "vehicle": "SCOOTER" + }, + "trackingUrl": "https://localhost.com", + "totalDistanceTraveled": 2, + "rating": 5, + "shippingPrice": 150000, + "shippingEstimatedDate": "2024-04-27T20:25:45.067Z" + } + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a service with the details of the tracking service via webhook. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information as a JSON object between parties. | + + ## Example response (`200`) + + ```json + { + "message": "Service updated successfully", + "data": { + "status": "PENDING", + "agent": { + "id": "27327489234", + "name": "Pedro", + "identification": "020323809", + "phone": "+57314855674", + "email": "pedro434234@gmailc.om", + "vehicle": "SCOOTER" + }, + "trackingUrl": "https://localhost.com", + "totalDistanceTraveled": 2, + "rating": 5, + "shippingPrice": 150000, + "shippingEstimatedDate": "2024-04-27T20:25:45.067Z" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/folder.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/folder.yml new file mode 100644 index 0000000000..a9ddf067c3 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/Shipping updates/folder.yml @@ -0,0 +1,8 @@ +info: + name: Shipping updates + type: folder + seq: 3 + +docs: + content: This endpoint will allow the carriers to update an ongoing shipping service. + type: text/markdown diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/environments/VTEX.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/environments/VTEX.yml new file mode 100644 index 0000000000..bb1c4ec658 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: environment + value: DefaultParameterValue + - name: baseUrl + value: https://auth.pickingnpacking.com/{{environment}} diff --git a/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/opencollection.yml b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/opencollection.yml new file mode 100644 index 0000000000..0e330262a7 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Last Mile Protocol API/opencollection.yml @@ -0,0 +1,37 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pick and Pack Last Mile Protocol API + +docs: + content: |- + The Pick and Pack Last Mile Protocol API enables seamless integration between the [Pick and Pack](https://help.vtex.com/en/tutorial/vtex-pick-and-pack--1OOops3WrUyz7e0bnhkfXU) app and delivery services. This API allows carriers and brokers to securely and efficiently exchange shipment information with the Pick and Pack app. It streamlines the process of managing orders, updating shipping statuses, and handling various service-related tasks, ensuring timely and accurate delivery updates. + + >ℹ️ Blank fields are included as `null` instead of being omitted. + ## Authentication + - [`POST` Create an access token](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/token) + + ## Service integration + - [`POST` Create a service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/create-service) + + ## Carriers + - [`POST` Calculate rates](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/rates) + - [`POST` List carriers](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/list-carriers) + + ## Shipping updates + - [`GET` Get a service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#get-/-carrierId-/-serviceId-) + - [`PATCH` Update service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#patch-/-carrierId-/-serviceId-) + - [`POST` Create notes](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/notes/-carrierId-/-serviceId-) + - [`POST` Create evidence](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/evidences/-carrierId-/-serviceId-) + - [`POST` Create labels](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/labels/-carrierId-/-serviceId-) + - [`POST` Cancel service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/cancel-service) + - [`POST` Cancel ongoing service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/cancel/service/-carrierId-/-serviceId-) + - [`POST` Pause and resume service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/pause-service) + - [`POST` Create on hold service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/on-hold/-carrierId-/-serviceId-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Create bin location.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Create bin location.yml new file mode 100644 index 0000000000..5ca4721f5e --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Create bin location.yml @@ -0,0 +1,76 @@ +info: + name: Create bin location + type: http + seq: 2 + +http: + method: POST + url: "{{accountName}}.myvtex.com/pickpack/bin-location/:skuId/warehouses/:warehouseId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: warehouseId + value: "10" + type: path + body: + type: json + data: |- + { + "location": "My location 14" + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new BIN location by warehouse ID and SKU ID. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `warehouseId` | path | (Required) Unique identifier of the warehouse. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "location": "My location 14", + "hostname": "lastmile", + "warehouseId": "10", + "skuId": "1" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete all bin locations.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete all bin locations.yml new file mode 100644 index 0000000000..26e7869756 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete all bin locations.yml @@ -0,0 +1,92 @@ +info: + name: Delete all bin locations + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/:skuId/warehouses" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/:skuId/warehouses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/:skuId/warehouses - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/:skuId/warehouses - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/:skuId/warehouses - Schema is valid", function () { + const schema = {"type":"array","description":"Empty array.","items":{"type":"object","description":"Deleted BIN location."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all BIN locations for a specific SKU ID. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [] + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete bin location.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete bin location.yml new file mode 100644 index 0000000000..bd6a74dd1b --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Delete bin location.yml @@ -0,0 +1,65 @@ +info: + name: Delete bin location + type: http + seq: 4 + +http: + method: DELETE + url: "{{accountName}}.myvtex.com/pickpack/bin-location/:skuId/warehouses/:warehouseId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: warehouseId + value: "10" + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific BIN location by warehouse ID and SKU ID. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `warehouseId` | path | (Required) Unique identifier of the warehouse. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [] + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Get bin location.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Get bin location.yml new file mode 100644 index 0000000000..93f760cea5 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Get bin location.yml @@ -0,0 +1,70 @@ +info: + name: Get bin location + type: http + seq: 1 + +http: + method: GET + url: "{{accountName}}.myvtex.com/pickpack/bin-location/:skuId/warehouses/:warehouseId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: warehouseId + value: "10" + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the BIN location for a specific SKU in a warehouse. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `warehouseId` | path | (Required) Unique identifier of the warehouse. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "location": "My location 14", + "hostname": "lastmile", + "warehouseId": "10", + "skuId": "1" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/List bin locations.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/List bin locations.yml new file mode 100644 index 0000000000..bd082f0bb7 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/List bin locations.yml @@ -0,0 +1,80 @@ +info: + name: List bin locations + type: http + seq: 5 + +http: + method: GET + url: "{{accountName}}.myvtex.com/pickpack/warehouses/:skuId/warehouses" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of warehouses associated with a specific SKU ID. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "location": "My location 14 edited", + "hostname": "lastmile", + "warehouseId": "14", + "skuId": "2" + }, + { + "location": "My location 15 edited", + "hostname": "lastmile", + "warehouseId": "15", + "skuId": "1" + }, + { + "location": "My location 4 edited", + "hostname": "lastmile", + "warehouseId": "10", + "skuId": "7" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Update bin location.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Update bin location.yml new file mode 100644 index 0000000000..f7883ee237 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/Update bin location.yml @@ -0,0 +1,76 @@ +info: + name: Update bin location + type: http + seq: 3 + +http: + method: PUT + url: "{{accountName}}.myvtex.com/pickpack/bin-location/:skuId/warehouses/:warehouseId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: skuId + value: "1" + type: path + - name: warehouseId + value: "10" + type: path + body: + type: json + data: |- + { + "location": "My location 14" + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the BIN location by warehouse ID and SKU ID. The BIN location is a specific, designated storage location within a warehouse. This location isn't necessarily a physical container. Each BIN is typically assigned a unique identifier or code, facilitating precise tracking and retrieval of items within the warehouse. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) Unique identifier of the SKU. | + | `warehouseId` | path | (Required) Unique identifier of the warehouse. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "location": "My location 14", + "hostname": "lastmile", + "warehouseId": "10", + "skuId": "1" + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/folder.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/folder.yml new file mode 100644 index 0000000000..b04db124c4 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Bin locations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Bin locations + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/Update order deadline.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/Update order deadline.yml new file mode 100644 index 0000000000..d5b092220a --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/Update order deadline.yml @@ -0,0 +1,119 @@ +info: + name: Update order deadline + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/orders/:orderId/deadline" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: orderId + value: 1481050515517-01 + type: path + body: + type: json + data: |- + { + "description": "Extend deadline due to delayed shipment", + "max": "2024-12-24T23:03:02Z", + "min": "2024-12-23T23:03:02Z" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/orders/:orderId/deadline - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/orders/:orderId/deadline - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/orders/:orderId/deadline - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/orders/:orderId/deadline - Schema is valid", function () { + const schema = {"type":"object","description":"Update deadline response.","properties":{"order":{"description":"Object with current deadline information.","type":"object","properties":{"currentDeadline":{"description":"Current deadline information.","type":"object","properties":{"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"}}},"deadlineChanges":{"description":"Object containg information of the deadline changes.","type":"array","items":{"description":"Deadline change.","type":"object","properties":{"current":{"description":"If the deadline changes were update.","type":"boolean"},"description":{"description":"Reason or purpose for the update.","type":"string"},"handled":{"description":"If the deadline changes were handled by the picker.","type":"boolean"},"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"},"oldDates":{"description":"Object containg previous deadline information.","type":"object","properties":{"max":{"description":"Latest deadline date in ISO 8601 format.","type":"string"},"min":{"description":"Earliest deadline date in ISO 8601 format.","type":"string"}}},"updatedAt":{"description":"An explanation about the purpose of this instance.","type":"string"}}}},"orderId":{"description":"Unique identifier of the order.","type":"string"}}},"success":{"description":"Condition if the request was successful.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the deadline for an order. The `min` and `max` fields specify the deadline window, while the description provides additional information. + + >ℹ️ This endpoint is currently in beta and subject to changes. Use with caution in production environments. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | OMS | OMS access | **Only show orders created by the user (via call center)** | + | Catalog | Telesales | **Assisted Sales** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `orderId` | path | (Required) Unique identifier of the order. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "order": { + "currentDeadline": { + "max": "2024-12-24T23:03:02Z", + "min": "2024-12-23T23:03:02Z" + }, + "deadlineChanges": [ + { + "current": true, + "description": "Extend deadline due to delayed shipment", + "handled": true, + "max": "2024-12-24T23:03:02.000Z", + "min": "2024-12-23T23:03:02.000Z", + "oldDates": { + "max": "2024-12-04T17:20:48.088Z", + "min": "2024-12-04T17:20:48.088Z" + }, + "updatedAt": "2024-12-03T17:35:59.786Z" + } + ], + "orderId": "1481050515517-01" + }, + "success": true + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/folder.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/folder.yml new file mode 100644 index 0000000000..539a9a2b1e --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/Order changes/folder.yml @@ -0,0 +1,4 @@ +info: + name: Order changes + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/environments/VTEX.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/environments/VTEX.yml new file mode 100644 index 0000000000..660f043d60 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/vtex_pickandpack + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Pick and Pack Order Changes API/opencollection.yml b/BrunoCollections/VTEX - Pick and Pack Order Changes API/opencollection.yml new file mode 100644 index 0000000000..6c0a676396 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Order Changes API/opencollection.yml @@ -0,0 +1,45 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pick and Pack Order Changes API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Pick and Pack Order changes API manages order modifications in a Pick and Pack order. This API supports actions like updating deadlines, adding items, modifying quantities, rejecting or replacing items, and updating item details. + + >ℹ️ This API is currently in beta and subject to changes. Use it with caution in production environments. + + ## Order changes + + - `PUT` [Update order deadline](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#put-/orders/-orderId-/deadline) + + ## BIN locations + + - [`GET` Get BIN location](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#get-/-skuId-/warehouses/-warehouseId-) + - [`POST` Create BIN location](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#post-/-skuId-/warehouses/-warehouseId-) + - [`PUT` Update BIN location](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#put-/-skuId-/warehouses/-warehouseId-) + - [`DELETE` Delete BIN location](https://developers.vtex.com/docs/api-reference/pick-and-pack-order-changes-api#delete-/-skuId-/warehouses/-warehouseId-) + + ## Common parameters + + | Parameter name | Description | Type | + | --- | --- | --- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. The default value is `vtexcommercestable`. Used in the URL. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the API key. Must be used together with `X-VTEX-API-AppToken`. | Authentication header | + | `X-VTEX-API-AppToken` | Secret token of the API key. Must be used together with `X-VTEX-API-AppKey`. | Authentication header | + | `VtexIdclientAutCookie` | User token valid for 24 hours. Alternative to `appKey` + `appToken`. | Authentication header | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/Create JWT token.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/Create JWT token.yml new file mode 100644 index 0000000000..8845bd470a --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/Create JWT token.yml @@ -0,0 +1,52 @@ +info: + name: Create JWT token + type: http + seq: 1 + +http: + method: POST + url: https://auth.pickingnpacking.com/:environment/token + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "apiKey": "{pnpApiKey}" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a `JWT` (JSON Web Token) necessary to access the Pick and Pack Protocol API information. + + >ℹ️ To generate the `JWT` it is necessary to have the `API KEY` previously generated by the Pick and Pack team. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Server to access the authentication necessary to make a request in the Pick and Pack Protocol API. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + "{token}" + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/folder.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/folder.yml new file mode 100644 index 0000000000..3f929f49d6 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/Create service.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/Create service.yml new file mode 100644 index 0000000000..ef18334887 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/Create service.yml @@ -0,0 +1,50 @@ +info: + name: Create service + type: http + seq: 1 + +http: + method: POST + url: https://:store_endpoint/ + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: your_endpoint + value: storeapi.com + type: path + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/ - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a service with the information that VTEX will send to the carrier. To understand how to integrate with a carrier, check the [VTEX Pick and Pack Carriers Integration Protocol](https://developers.vtex.com/docs/guides/vtex-pick-and-pack) guide. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `your_endpoint` | path | Server from the store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/folder.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/folder.yml new file mode 100644 index 0000000000..6d90380169 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Service integration/folder.yml @@ -0,0 +1,8 @@ +info: + name: Service integration + type: folder + seq: 2 + +docs: + content: These endpoints must be developed to integrate with the Lastmile Pick and Pack Protocol API. + type: text/markdown diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Cancel service.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Cancel service.yml new file mode 100644 index 0000000000..d36fd8dda2 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Cancel service.yml @@ -0,0 +1,67 @@ +info: + name: Cancel service + type: http + seq: 6 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/cancel/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "comment": "The delivery address was changed", + "type": "END_CLIENT_CANCELED" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Resquest that will cancel an ongoing shipping service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Service canceled successfully", + "data": { + "comment": "The delivery address was changed", + "type": "END_CLIENT_CANCELED" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create evidence.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create evidence.yml new file mode 100644 index 0000000000..3a6cd697f7 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create evidence.yml @@ -0,0 +1,83 @@ +info: + name: Create evidence + type: http + seq: 4 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/evidences/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + [ + { + "type": "IMAGE", + "content": "https://parkers-images.bauersecure.com/wp-images/18727/courier-van-insurance-01.jpg", + "author": "Felipe Cardenas" + }, + { + "type": "TEXT", + "content": "The package was delivered", + "author": "Felipe Cardenas" + } + ] + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows the carrier to add evidence of delivery or pickup to the shipping service, as photos, text. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Evidences saved successfully", + "data": [ + { + "type": "IMAGE", + "content": "https://parkers-images.bauersecure.com/wp-images/18727/courier-van-insurance-01.jpg", + "author": "Felipe Cardenas" + }, + { + "type": "TEXT", + "content": "The package was delivered", + "author": "Felipe Cardenas" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create label.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create label.yml new file mode 100644 index 0000000000..e4cb99d842 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create label.yml @@ -0,0 +1,75 @@ +info: + name: Create label + type: http + seq: 5 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/labels/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "id": "JADF8ADF89-7AD7AF-78ADFASDF", + "url": "http://s3://mybucket-alpha/orc/2013-10-04-custdata/label-pickup.pdf", + "name": "Delivery label", + "type": "PDF" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows the carrier to create and add a shipping label to an order. + + It is important that the tag ID is a unique value, if this value is repeated it will throw an exception. + + > ⚠️ If the label is type `BASE64` or `TXT`, the max size that allowed is 180kb. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Label saved successfully", + "data": { + "id": "JADF8ADF89-7AD7AF-78ADFASDF", + "url": "http://s3://mybucket-alpha/orc/2013-10-04-custdata/label-pickup.pdf", + "name": "Delivery label", + "type": "PDF" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create notes.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create notes.yml new file mode 100644 index 0000000000..2c3de88556 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create notes.yml @@ -0,0 +1,83 @@ +info: + name: Create notes + type: http + seq: 3 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/notes/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + [ + { + "type": "ERROR", + "note": "The package takes time to be shipped", + "author": "Oscar Rojas" + }, + { + "type": "COMMENT", + "note": "The package was picked up", + "author": "Oscar Rojas" + } + ] + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Allows carriers to add notes and information on existing services. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Notes saved successfully", + "data": [ + { + "type": "ERROR", + "note": "The package takes time to be shipped", + "author": "Oscar Rojas" + }, + { + "type": "COMMENT", + "note": "The package was picked up", + "author": "Oscar Rojas" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create on hold service.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create on hold service.yml new file mode 100644 index 0000000000..921f3af30f --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Create on hold service.yml @@ -0,0 +1,67 @@ +info: + name: Create on hold service + type: http + seq: 7 + +http: + method: POST + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/on-hold/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "comment": "The delivery address was changed", + "type": "END_CLIENT_PAUSE" + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Request that allows a carrier to temporarily pause a shipping service. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Service on hold successfully", + "data": { + "comment": "The delivery address was changed", + "type": "END_CLIENT_PAUSE" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Get a service.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Get a service.yml new file mode 100644 index 0000000000..fd1c70112c --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Get a service.yml @@ -0,0 +1,52 @@ +info: + name: Get a service + type: http + seq: 1 + +http: + method: GET + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns information about a service, which can be queried by providing the carrier ID and the corresponding service ID as query parameters. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID generated by the carrier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Update service.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Update service.yml new file mode 100644 index 0000000000..4d96f8ada6 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/Update service.yml @@ -0,0 +1,94 @@ +info: + name: Update service + type: http + seq: 2 + +http: + method: PATCH + url: https://api.pickingnpacking.com/:environment/v1/tracking/hook/:carrierId/:serviceId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Authorization + value: "{token}" + params: + - name: carrierId + value: MTEyMjMtQWZ0ZXJTaGlwLWRldmVsb3BtZW50 + type: path + - name: serviceId + value: 78c83922-d658-48bf-89d5-0658a6a94e27 + type: path + - name: environment + value: DefaultParameterValue + type: path + body: + type: json + data: |- + { + "message": "Service updated successfully", + "data": { + "status": "PENDING", + "agent": { + "id": "27327489234", + "name": "Pedro", + "identification": "020323809", + "phone": "+57314855674", + "email": "pedro434234@gmailc.om", + "vehicle": "SCOOTER" + }, + "trackingUrl": "https://localhost.com", + "totalDistanceTraveled": 2, + "rating": 5, + "shippingPrice": 150000, + "shippingEstimatedDate": "2022-04-27T20:25:45.067Z" + } + } + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a service with the details of the tracking service via webhook. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `carrierId` | path | (Required) Carrier ID. | + | `serviceId` | path | (Required) Service ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Authorization` | header | (Required) Authentication JWT. | + + ## Example response (`200`) + + ```json + { + "message": "Service updated successfully", + "data": { + "status": "PENDING", + "agent": { + "id": "27327489234", + "name": "Pedro", + "identification": "020323809", + "phone": "+57314855674", + "email": "pedro434234@gmailc.om", + "vehicle": "SCOOTER" + }, + "trackingUrl": "https://localhost.com", + "totalDistanceTraveled": 2, + "rating": 5, + "shippingPrice": 150000, + "shippingEstimatedDate": "2022-04-27T20:25:45.067Z" + } + } + ``` diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/folder.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/folder.yml new file mode 100644 index 0000000000..a9ddf067c3 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/Shipping updates/folder.yml @@ -0,0 +1,8 @@ +info: + name: Shipping updates + type: folder + seq: 3 + +docs: + content: This endpoint will allow the carriers to update an ongoing shipping service. + type: text/markdown diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/environments/VTEX.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/environments/VTEX.yml new file mode 100644 index 0000000000..bb1c4ec658 --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: environment + value: DefaultParameterValue + - name: baseUrl + value: https://auth.pickingnpacking.com/{{environment}} diff --git a/BrunoCollections/VTEX - Pick and Pack Protocol API/opencollection.yml b/BrunoCollections/VTEX - Pick and Pack Protocol API/opencollection.yml new file mode 100644 index 0000000000..e277d55a1a --- /dev/null +++ b/BrunoCollections/VTEX - Pick and Pack Protocol API/opencollection.yml @@ -0,0 +1,31 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pick and Pack Protocol API + +docs: + content: |- + The Pick and Pack Protocol API facilitates integration between the [Pick and Pack](https://help.vtex.com/en/tutorial/vtex-pick-and-pack--1OOops3WrUyz7e0bnhkfXU) app and delivery services. This API streamlines the process of managing orders, updating shipping statuses, and handling various service-related tasks. + + >ℹ️ Blank fields are included as `null` instead of being omitted. + ## Authentication + - [`POST` Create an access token](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/token) + + ## Service integration + - [`POST` Create a service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/) + + ## Shipping updates + - [`GET` Get a service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#get-/carrierId/serviceId) + - [`PATCH` Update service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#patch-/carrierId/serviceId) + - [`POST` Create notes](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/notes/carrierId/serviceId) + - [`POST` Create evidence](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/evidences/carrierId/serviceId) + - [`POST` Create labels](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/labels/carrierId/serviceId) + - [`POST` Cancel service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/cancel/carrierId/serviceId) + - [`POST` Create on hold service](https://developers.vtex.com/docs/api-reference/pick-and-pack-protocol-api#post-/on-hold/carrierId/serviceId) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Create policy.yml b/BrunoCollections/VTEX - Policies System API/Policy/Create policy.yml new file mode 100644 index 0000000000..ea46c65fd6 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Create policy.yml @@ -0,0 +1,163 @@ +info: + name: Create policy + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/policy-engine/policies/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: pa_test_001 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "name": "id", + "description": "TesteMarcosPromotionsAlert", + "statements": [ + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "ine08": "cupidatat fugiat", + "cillum_1": true + } + }, + { + "id": "SendSlackMessage", + "metadata": { + "irure_4": -60855921.31526907 + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + }, + { + "conditions": [ + "numericGreaterThan" + ], + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + } + ] + }, + "operation": "None" + }, + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "deserunt2f": false, + "Duis_ae3": -1767949 + } + }, + { + "id": "SendSlackMessage", + "metadata": { + "veniam__3c": -66175228 + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "conditions": [ + "numericGreaterThan" + ], + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + }, + { + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + } + ] + }, + "operation": "None" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/policy-engine/policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/policy-engine/policies/:id - Content-Type is application/octet-stream", function () { + expect(String(res.getHeader("content-type"))).to.include("application/octet-stream"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new policy from scratch. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **Create or Update Policy** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Policy ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Delete policy by ID.yml b/BrunoCollections/VTEX - Policies System API/Policy/Delete policy by ID.yml new file mode 100644 index 0000000000..79866ce636 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Delete policy by ID.yml @@ -0,0 +1,64 @@ +info: + name: Delete policy by ID + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/policy-engine/policies/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: pa_test_001 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/policy-engine/policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a specific policy of the account by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **Delete Policy** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Policy ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Evaluate policies.yml b/BrunoCollections/VTEX - Policies System API/Policy/Evaluate policies.yml new file mode 100644 index 0000000000..f082ee4830 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Evaluate policies.yml @@ -0,0 +1,109 @@ +info: + name: Evaluate policies + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/policy-engine/evaluate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "context": { + "brandId": "2000001", + "discountPercentage": "91.00" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/policy-engine/evaluate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/policy-engine/evaluate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/policy-engine/evaluate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/policy-engine/evaluate - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"PolicyActionGetResponse","type":"object","description":"Object with policy conditions.","properties":{"id":{"type":"string","description":"Action ID.","title":"id"},"metadata":{"type":"object","description":"Metadata object from the current action.","title":"metadata","additionalProperties":true}}},"description":"Array of objects with policies infomation."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint consults all policies and checks the ones that satisfy the request body’s conditions. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **Evaluate Policy** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "SendSlackMessage", + "metadata": { + "channel": "C01NJFF35R6", + "relatedUsers": [ + "URUNDC2NB" + ], + "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%." + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Get policy by ID.yml b/BrunoCollections/VTEX - Policies System API/Policy/Get policy by ID.yml new file mode 100644 index 0000000000..8a2360d9a7 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Get policy by ID.yml @@ -0,0 +1,137 @@ +info: + name: Get policy by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/policy-engine/policies/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: pa_test_001 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/policy-engine/policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/policy-engine/policies/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/policy-engine/policies/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/policy-engine/policies/:id - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"PolicyGetResponse","description":"Object with policy information.","type":"object","properties":{"id":{"type":"string","title":"id","description":"Policy ID."},"name":{"type":"string","description":"Policy name.","title":"name"},"description":{"type":"string","description":"Policy description, only for internal use.","title":"description"},"statements":{"type":"array","title":"statements","items":{"type":"object","description":"Object with policy conditions.","required":["effect"],"properties":{"effect":{"type":"string","title":"effect","description":"This field is not functional at the moment. To create a correct request, fill the field with `Allow`.","example":"Allow","deprecated":true},"actions":{"type":"array","title":"actions","items":{"properties":{"id":{"type":"string","title":"id","description":"Action ID.","example":"SendSlackMessage","enum":["SendSlackMessage","SendEmail","DeactivatePromotions"]},"metadata":{"type":"object","title":"metadata","description":"Data inside of the actions.","additionalProperties":true}},"type":"object","description":"Array with actions information."},"description":"Actions that the policy will execute."},"resource":{"type":"string","description":"Scope on which this policy must be evaluated.","title":"resource","example":"vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert"},"condition":{"type":"object","properties":{"conditions":{"type":"array","description":"List of conditions that will activate the policy.","items":{"description":"List of conditions that will activate the policy.","type":"object","properties":{"conditions":{"title":"conditions","type":"array","description":"List of conditions the actions can have. It can be an empty array `[]`.","enum":[[],["stringEquals"],["numericGreaterThan"]],"items":{"type":"string","description":"Condition value.","example":"None"}},"operation":{"type":"string","title":"operation","description":"The action of the condition.","example":"None","enum":["None","stringEquals","stringEqualsIgnoreCase","numericEquals","numericLessThan","numericLessThanEquals","numericGreaterThan","numericGreaterThanEquals","bool","not","or","and","dateTimeUtcGreaterThan","dateTimeUtcLessThan","between"]},"key":{"type":"string","title":"key","description":"The element that will define what the policy will influence.","example":"skuId","enum":["skuId","brandId","discountPercentage"]},"values":{"type":"array","title":"values","items":{"type":"string","description":"Key value.","example":"40.00"},"description":"Array with values of the key."}}}}},"description":"Condition to activate this policy. This object can have a maximum of ten recursive conditions.","title":"condition"},"operation":{"type":"string","title":"operation","description":"This operation will determine if all the conditions need to be valid or at least one of them, if the conditions array is not empty.","example":"None","enum":["None","stringEquals","stringEqualsIgnoreCase","numericEquals","numericLessThan","numericLessThanEquals","numericGreaterThan","numericGreaterThanEquals","bool","not","or","and","dateTimeUtcGreaterThan","dateTimeUtcLessThan","between"]}}},"description":"Requirements for the policy to be applied."}}},"description":"Array of objects with policies infomation."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information of a policy by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **Get Policy** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Policy ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "pa_test_001", + "name": "TestAlarmBerenice", + "description": "TesteMarcosPromotionsAlert", + "statements": [ + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "channel": "C01NJFF35R6", + "relatedUsers": [ + "URUNDC2NB" + ], + "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%." + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "conditions": [], + "operation": "stringEquals", + "key": "brandId", + "values": [ + "2000001" + ] + }, + { + "conditions": [], + "operation": "numericGreaterThan", + "key": "discountPercentage", + "values": [ + "70.00" + ] + } + ], + "operation": "and" + } + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Get policy list.yml b/BrunoCollections/VTEX - Policies System API/Policy/Get policy list.yml new file mode 100644 index 0000000000..8ce9bab363 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Get policy list.yml @@ -0,0 +1,133 @@ +info: + name: Get policy list + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/policy-engine/policies" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/policy-engine/policies - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/policy-engine/policies - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/policy-engine/policies - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/policy-engine/policies - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"PolicyGetResponse","description":"Object with policy information.","type":"object","properties":{"id":{"type":"string","title":"id","description":"Policy ID."},"name":{"type":"string","description":"Policy name.","title":"name"},"description":{"type":"string","description":"Policy description, only for internal use.","title":"description"},"statements":{"type":"array","title":"statements","items":{"type":"object","description":"Object with policy conditions.","required":["effect"],"properties":{"effect":{"type":"string","title":"effect","description":"This field is not functional at the moment. To create a correct request, fill the field with `Allow`.","example":"Allow","deprecated":true},"actions":{"type":"array","title":"actions","items":{"properties":{"id":{"type":"string","title":"id","description":"Action ID.","example":"SendSlackMessage","enum":["SendSlackMessage","SendEmail","DeactivatePromotions"]},"metadata":{"type":"object","title":"metadata","description":"Data inside of the actions.","additionalProperties":true}},"type":"object","description":"Array with actions information."},"description":"Actions that the policy will execute."},"resource":{"type":"string","description":"Scope on which this policy must be evaluated.","title":"resource","example":"vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert"},"condition":{"type":"object","properties":{"conditions":{"type":"array","description":"List of conditions that will activate the policy.","items":{"description":"List of conditions that will activate the policy.","type":"object","properties":{"conditions":{"title":"conditions","type":"array","description":"List of conditions the actions can have. It can be an empty array `[]`.","enum":[[],["stringEquals"],["numericGreaterThan"]],"items":{"type":"string","description":"Condition value.","example":"None"}},"operation":{"type":"string","title":"operation","description":"The action of the condition.","example":"None","enum":["None","stringEquals","stringEqualsIgnoreCase","numericEquals","numericLessThan","numericLessThanEquals","numericGreaterThan","numericGreaterThanEquals","bool","not","or","and","dateTimeUtcGreaterThan","dateTimeUtcLessThan","between"]},"key":{"type":"string","title":"key","description":"The element that will define what the policy will influence.","example":"skuId","enum":["skuId","brandId","discountPercentage"]},"values":{"type":"array","title":"values","items":{"type":"string","description":"Key value.","example":"40.00"},"description":"Array with values of the key."}}}}},"description":"Condition to activate this policy. This object can have a maximum of ten recursive conditions.","title":"condition"},"operation":{"type":"string","title":"operation","description":"This operation will determine if all the conditions need to be valid or at least one of them, if the conditions array is not empty.","example":"None","enum":["None","stringEquals","stringEqualsIgnoreCase","numericEquals","numericLessThan","numericLessThanEquals","numericGreaterThan","numericGreaterThanEquals","bool","not","or","and","dateTimeUtcGreaterThan","dateTimeUtcLessThan","between"]}}},"description":"Requirements for the policy to be applied."}}},"description":"Array of objects with policies infomation."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of all policies in the account and general information of each policy. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **List Policies** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "pa_test_001", + "name": "TestAlarmBerenice", + "description": "TesteMarcosPromotionsAlert", + "statements": [ + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "channel": "C01NJFF35R6", + "relatedUsers": [ + "URUNDC2NB" + ], + "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%." + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "conditions": [], + "operation": "stringEquals", + "key": "brandId", + "values": [ + "2000001" + ] + }, + { + "conditions": [], + "operation": "numericGreaterThan", + "key": "discountPercentage", + "values": [ + "70.00" + ] + } + ], + "operation": "and" + } + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Policies System API/Policy/Update policy.yml b/BrunoCollections/VTEX - Policies System API/Policy/Update policy.yml new file mode 100644 index 0000000000..0d4d302928 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/Update policy.yml @@ -0,0 +1,167 @@ +info: + name: Update policy + type: http + seq: 5 + +http: + method: PUT + url: "{{baseUrl}}/api/policy-engine/policies/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: pa_test_001 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "name": "id", + "description": "TesteMarcosPromotionsAlert", + "statements": [ + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "sed6": 50061023 + } + }, + { + "id": "SendSlackMessage", + "metadata": { + "commodo_9": -83153761.01837124, + "quis_5a": "v" + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "conditions": [ + "stringEquals" + ], + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + }, + { + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + } + ] + }, + "operation": "None" + }, + { + "effect": "Allow", + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "occaecat0": 85045203 + } + }, + { + "id": "SendSlackMessage", + "metadata": { + "esse_d8_": "proident eiusmod", + "eu_fa": "labore ad mollit", + "elit_b": 50578452 + } + } + ], + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert", + "condition": { + "conditions": [ + { + "conditions": [ + "stringEquals" + ], + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + }, + { + "conditions": [ + "stringEquals" + ], + "operation": "None", + "key": "skuId", + "values": [ + "40.00", + "40.00" + ] + } + ] + }, + "operation": "None" + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/policy-engine/policies/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/policy-engine/policies/:id - Content-Type is application/octet-stream", function () { + expect(String(res.getHeader("content-type"))).to.include("application/octet-stream"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates an existing policy at your account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Promotions Policy Engine | Policies | **Create or Update Policy** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Policy ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Policies System API/Policy/folder.yml b/BrunoCollections/VTEX - Policies System API/Policy/folder.yml new file mode 100644 index 0000000000..753a244381 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/Policy/folder.yml @@ -0,0 +1,4 @@ +info: + name: Policy + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Policies System API/environments/VTEX.yml b/BrunoCollections/VTEX - Policies System API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Policies System API/opencollection.yml b/BrunoCollections/VTEX - Policies System API/opencollection.yml new file mode 100644 index 0000000000..e13dbabad1 --- /dev/null +++ b/BrunoCollections/VTEX - Policies System API/opencollection.yml @@ -0,0 +1,31 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Policies System API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + This API will create promotion alarms when selling products with undesired prices and promotions. It will create conditions that will check if the prices and the promotions are correct. If not, the system will alarm the store with information about the product sold at unexpected prices. + + ## Index + + - `GET` [Get Policy List](https://developers.vtex.com/docs/api-reference/policies-system-api#get-/api/policy-engine/policies) + - `POST` [Evaluate Policies](https://developers.vtex.com/docs/api-reference/policies-system-api#post-/api/policy-engine/evaluate) + - `GET` [Get Policy by ID](https://developers.vtex.com/docs/api-reference/policies-system-api#get-/api/policy-engine/policies/-id-) + - `POST` [Create Policy](https://developers.vtex.com/docs/api-reference/policies-system-api#post-/api/policy-engine/policies/-id-) + - `PUT` [Update Policy](https://developers.vtex.com/docs/api-reference/policies-system-api#put-/api/policy-engine/policies/-id-) + - `DELETE` [Delete Policy by ID](https://developers.vtex.com/docs/api-reference/policies-system-api#delete-/api/policy-engine/policies/-id-) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/Create price table.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/Create price table.yml new file mode 100644 index 0000000000..8d4286c59f --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/Create price table.yml @@ -0,0 +1,57 @@ +info: + name: Create price table + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/pricing/tables/:priceTableId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: priceTableId + value: dolore commodo ex + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/pricing/tables/:priceTableId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Create a new price table. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `priceTableId` | path | (Required) Price Table Name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/Get all price tables and their rules.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/Get all price tables and their rules.yml new file mode 100644 index 0000000000..8fdcd54c55 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/Get all price tables and their rules.yml @@ -0,0 +1,90 @@ +info: + name: Get all price tables and their rules + type: http + seq: 4 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/pipeline/catalog + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: account + value: DefaultParameterValue + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of all price tables and their rules. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "tradePolicyId": "2", + "rules": [ + { + "id": 0, + "context": { + "categories": {}, + "brands": {}, + "stockStatuses": null, + "internalCategories": null, + "markupRange": null, + "dateRange": null + }, + "percentualModifier": 20 + } + ] + }, + { + "tradePolicyId": "b2c", + "rules": [ + { + "id": 0, + "context": { + "categories": {}, + "brands": { + "2000009": "Whiskas" + }, + "stockStatuses": null, + "internalCategories": null, + "markupRange": null, + "dateRange": null + }, + "percentualModifier": 15 + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/Get rules for a price table.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/Get rules for a price table.yml new file mode 100644 index 0000000000..396f812f9b --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/Get rules for a price table.yml @@ -0,0 +1,75 @@ +info: + name: Get rules for a price table + type: http + seq: 1 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/pipeline/catalog/:priceTableId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: account + value: DefaultParameterValue + type: path + - name: priceTableId + value: b2c + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the rules of a specific price table. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `priceTableId` | path | (Required) Price Table Name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "tradePolicyId": "b2c", + "rules": [ + { + "id": 0, + "context": { + "categories": {}, + "brands": { + "2000009": "Whiskas" + }, + "stockStatuses": null, + "internalCategories": null, + "markupRange": null, + "dateRange": null + }, + "percentualModifier": 15 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/List price tables.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/List price tables.yml new file mode 100644 index 0000000000..41f73a4955 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/List price tables.yml @@ -0,0 +1,59 @@ +info: + name: List price tables + type: http + seq: 5 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/tables + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: account + value: DefaultParameterValue + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of all price tables. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "1", + "2", + "3", + "b2c", + "b2b", + "gold" + ] + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/Update rules for a price table.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/Update rules for a price table.yml new file mode 100644 index 0000000000..8367ef1418 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/Update rules for a price table.yml @@ -0,0 +1,86 @@ +info: + name: Update rules for a price table + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/pricing/pipeline/catalog/:priceTableId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: priceTableId + value: dolore commodo ex + type: path + body: + type: json + data: |- + { + "rules": [ + { + "id": 1, + "context": { + "categories": { + "Category ID": "1", + "Category Name": "Alimentação" + }, + "brands": { + "Brand ID": "2000002", + "Brand Name": "Whiskas" + }, + "markupRange": { + "from": 0, + "to": 200 + }, + "dateRange": { + "from": "2022-01-23T19:00:00.000Z", + "to": "2023-10-26T00:00:00.000Z" + } + }, + "percentualModifier": 0 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/pricing/pipeline/catalog/:priceTableId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the rules of a specific price table, by deleting all the rules from the requested price table and creating new rules based on the content of the request. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `priceTableId` | path | (Required) Price Table Name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Price Tables/folder.yml b/BrunoCollections/VTEX - Pricing API/Price Tables/folder.yml new file mode 100644 index 0000000000..019b55232c --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Price Tables/folder.yml @@ -0,0 +1,4 @@ +info: + name: Price Tables + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price (2).yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price (2).yml new file mode 100644 index 0000000000..010cef5ee5 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price (2).yml @@ -0,0 +1,75 @@ +info: + name: Create or update base price or fixed price + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/pricing/prices/:itemId/fixed" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + body: + type: json + data: |- + [ + { + "tradePolicyId": "1", + "value": 50.5, + "listPrice": 50.5, + "minQuantity": 2, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-03:00" + } + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/pricing/prices/:itemId/fixed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the base price or fixed prices of an SKU. 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. A fixed price is an optional price defined for a specific trade policy or a price table. It can include a minimum quantity and an effective date range that determines when the price is active. + + This request does not remove existing prices. Instead, it updates or adds new prices without affecting trade policies or price tables that are not included in the request. If a fixed price or base price already exists for the specified SKU and matches the activation conditions (i.e., dateRange and minQuantity), it will be replaced. Otherwise, a new price will be created. + + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price.yml new file mode 100644 index 0000000000..02429e4275 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update base price or fixed price.yml @@ -0,0 +1,80 @@ +info: + name: Create or update base price or fixed price + type: http + seq: 3 + +http: + method: PUT + url: "{{baseUrl}}/pricing/prices/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + body: + type: json + data: |- + { + "markup": 30, + "listPrice": 50, + "costPrice": 35, + "fixedPrices": [ + { + "tradePolicyId": "1", + "value": 50.5, + "listPrice": 50.5, + "minQuantity": 2, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T23:00:00-03:00" + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/pricing/prices/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates an SKU base price or fixed price. 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. + + You may optionally set a list price. You must provide exactly two values among `basePrice`, `costPrice`, and `markup`. If all three are sent at the same time, the request will fail. If you provide both `costPrice` and `markup` and omit the `basePrice`, the `basePrice` will be automatically calculated using the following formula `costPrice * (1 + markup) = basePrice`. + + >⚠️ This PUT request overwrites all fixed prices for the specified SKU with the provided data. It does not add new fixed prices individually — any existing prices not included in the request body will be deleted. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU unique identifier number. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update fixed prices on a price table or trade policy.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update fixed prices on a price table or trade policy.yml new file mode 100644 index 0000000000..276f81f94b --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Create or update fixed prices on a price table or trade policy.yml @@ -0,0 +1,83 @@ +info: + name: Create or update fixed prices on a price table or trade policy + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/pricing/prices/:itemId/fixed/:priceTableId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + - name: priceTableId + value: priceTableA + type: path + body: + type: json + data: |- + [ + { + "value": 50.5, + "minQuantity": 2, + "listPrice": 50.5, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-04:00" + } + }, + { + "value": 50.5, + "minQuantity": 2, + "listPrice": 50.5, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-04:00" + } + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates the fixed prices of an SKU for a specific price table or trade policy. You can add one or multiple fixed prices per SKU. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Modify prices** | + + There 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). + + > ❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `priceTableId` | path | (Required) SKU **price table** name or **trade policy** ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete fixed prices on a price table or trade policy.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete fixed prices on a price table or trade policy.yml new file mode 100644 index 0000000000..3a318f20e7 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete fixed prices on a price table or trade policy.yml @@ -0,0 +1,60 @@ +info: + name: Delete fixed prices on a price table or trade policy + type: http + seq: 8 + +http: + method: DELETE + url: "{{baseUrl}}/pricing/prices/:itemId/fixed/:priceTableId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + - name: priceTableId + value: gold + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes all Fixed Prices of an SKU in a specific Price Table or Trade Policy. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Delete all prices from account** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `priceTableId` | path | (Required) Price Table or Trade Policy Name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete price all base and fixed prices of an SKU.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete price all base and fixed prices of an SKU.yml new file mode 100644 index 0000000000..34fc295f9c --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Delete price all base and fixed prices of an SKU.yml @@ -0,0 +1,56 @@ +info: + name: Delete price all base and fixed prices of an SKU + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/pricing/prices/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/pricing/prices/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes the Base Price and all available Fixed Prices for an SKU in all trade policies. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Delete all prices from account** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed price by price table or trade policy.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed price by price table or trade policy.yml new file mode 100644 index 0000000000..b760abda4e --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed price by price table or trade policy.yml @@ -0,0 +1,81 @@ +info: + name: Get computed price by price table or trade policy + type: http + seq: 10 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/prices/:itemId/computed/:priceTableId + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryIds + value: "1" + type: query + disabled: true + - name: brandId + value: "3" + type: query + disabled: true + - name: quantity + value: "2" + type: query + disabled: true + - name: account + value: DefaultParameterValue + type: path + - name: itemId + value: "1" + type: path + - name: priceTableId + value: gold + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Gets the Computed Price, which is the price after all the steps in the Pricing pipeline, for an SKU in a specific price table or trade policy. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `priceTableId` | path | (Required) SKU Price Table Name. | + | `categoryIds` | query | Category ID. | + | `brandId` | query | Brand ID. | + | `quantity` | query | SKU quantity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "tradePolicyId": "1", + "listPrice": 30, + "costPrice": 76.92, + "sellingPrice": 18.9, + "priceValidUntil": "2018-12-20T18:12:14Z" + } + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed prices for all price tables.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed prices for all price tables.yml new file mode 100644 index 0000000000..1aeeae1feb --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get computed prices for all price tables.yml @@ -0,0 +1,95 @@ +info: + name: Get computed prices for all price tables + type: http + seq: 9 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/prices/:itemId/computed + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: categoryIds + value: "1" + type: query + disabled: true + - name: brandId + value: "3" + type: query + disabled: true + - name: quantity + value: "2" + type: query + disabled: true + - name: account + value: DefaultParameterValue + type: path + - name: itemId + value: "1" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the computed prices for an SKU across all price tables that have a fixed price configured. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `categoryIds` | query | Category ID. | + | `brandId` | query | Brand ID. | + | `quantity` | query | SKU quantity. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "tradePolicyId": "reg-a", + "listPrice": 199, + "costPrice": 90, + "sellingPrice": 7.5, + "priceValidUntil": "2027-03-05T17:50:05Z", + "priceTable": "reg-a" + }, + { + "tradePolicyId": "1", + "listPrice": 199, + "costPrice": 90, + "sellingPrice": 6, + "priceValidUntil": "2027-03-05T17:50:05Z", + "priceTable": "1" + }, + { + "tradePolicyId": "2", + "listPrice": 199, + "costPrice": 90, + "sellingPrice": 150, + "priceValidUntil": "2027-03-05T17:50:05Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices on a price table or trade policy.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices on a price table or trade policy.yml new file mode 100644 index 0000000000..5ca1511e5d --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices on a price table or trade policy.yml @@ -0,0 +1,106 @@ +info: + name: Get fixed prices on a price table or trade policy + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/pricing/prices/:itemId/fixed/:priceTableId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + - name: priceTableId + value: gold + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pricing/prices/:itemId/fixed/:priceTableId - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[GET]::/pricing/prices/:itemId/fixed/:priceTableId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pricing/prices/:itemId/fixed/:priceTableId - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["tradePolicyId","value","listPrice","minQuantity"],"type":"object","description":"Fixed price request body information.","properties":{"tradePolicyId":{"type":"string","description":"Trade Policy ID."},"value":{"type":"number","description":"Trade Policy Fixed Price Value."},"listPrice":{"type":["number","null"],"description":"Trade Policy List Price Value."},"minQuantity":{"type":"integer","format":"int32","description":"Trade Policy Fixed Price Minimum Item Quantity."},"dateRange":{"description":"Trade Policy Fixed Price Validity Period Object.","required":["from","to"],"type":"object","properties":{"from":{"type":"string","description":"Indicates the date and time when the fixed price will start to be valid."},"to":{"type":"string","description":"Indicates the date and time from which the fixed price will no longer be valid."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all Fixed Prices on a price table or trade policy. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `priceTableId` | path | (Required) Price Table Name | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "tradePolicyId": "6", + "value": 20.9, + "listPrice": 22.9, + "minQuantity": 1, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-04:00" + } + }, + { + "tradePolicyId": "1", + "value": 18.9, + "listPrice": null, + "minQuantity": 1 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices.yml new file mode 100644 index 0000000000..98ea0e9e0c --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get fixed prices.yml @@ -0,0 +1,111 @@ +info: + name: Get fixed prices + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/pricing/prices/:itemId/fixed" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pricing/prices/:itemId/fixed - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pricing/prices/:itemId/fixed - Content-Type is application/json; charset=utf-8", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json; charset=utf-8"); + }); + + test("[GET]::/pricing/prices/:itemId/fixed - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pricing/prices/:itemId/fixed - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["tradePolicyId","value","listPrice","minQuantity"],"type":"object","description":"Fixed price request body information.","properties":{"tradePolicyId":{"type":"string","description":"Trade Policy ID."},"value":{"type":"number","description":"Trade Policy Fixed Price Value."},"listPrice":{"type":["number","null"],"description":"Trade Policy List Price Value."},"minQuantity":{"type":"integer","format":"int32","description":"Trade Policy Fixed Price Minimum Item Quantity."},"dateRange":{"description":"Trade Policy Fixed Price Validity Period Object.","required":["from","to"],"type":"object","properties":{"from":{"type":"string","description":"Indicates the date and time when the fixed price will start to be valid."},"to":{"type":"string","description":"Indicates the date and time from which the fixed price will no longer be valid."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + The **fixed price** is an optional price of the SKU for a specific trade policy with a specific minimum quantity to be activated. This method retrieves an array of fixed prices for a SKU in a trade policy with minimum quantities. + + The default value for a minimum quantity is `1`. This means a fixed price will be valid for a SKU in a trade policy for orders containing the specified number of minimum quantity or above, unless a higher minimum quantity is specified. + + Fixed prices may, optionally, be scheduled. If so, these objects will contain the `dateRange` object with `from` and `to` properties, indicating the start and end time of the scheduled fixed price in the RFC3339 timestamp format (`YYYY-MM-DDThh:mm:ssZ`). + + Note that the 'Z', at the end, represents the UTC time (GMT+00:00). If it was in GMT-03:00, for example, it would be (`YYYY-MM-DDT23:59:60-03:00`). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "tradePolicyId": "6", + "value": 20.9, + "listPrice": 22.9, + "minQuantity": 1, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-03:00" + } + }, + { + "tradePolicyId": "1", + "value": 18.9, + "listPrice": null, + "minQuantity": 1, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-03:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get price by SKU ID.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get price by SKU ID.yml new file mode 100644 index 0000000000..210ee22ffe --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/Get price by SKU ID.yml @@ -0,0 +1,148 @@ +info: + name: Get price by SKU ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/pricing/prices/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: itemId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pricing/prices/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pricing/prices/:itemId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/pricing/prices/:itemId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pricing/prices/:itemId - Schema is valid", function () { + const schema = {"required":["itemId","listPrice","costPrice","markup","basePrice","fixedPrices"],"type":"object","description":"Price request body information.","properties":{"itemId":{"type":"string","description":"SKU ID."},"listPrice":{"type":"integer","format":"int32","description":"Suggested retail price for the SKU."},"costPrice":{"type":"integer","format":"int32","description":"SKU's cost price."},"markup":{"type":"integer","format":"int32","description":"Desired profit margin with the SKU's sale."},"basePrice":{"type":"integer","format":"int32","description":"SKU's reference price."},"fixedPrices":{"type":"array","items":{"required":["tradePolicyId","value","listPrice","minQuantity"],"type":"object","description":"Fixed price request body information.","properties":{"tradePolicyId":{"type":"string","description":"Trade Policy ID."},"value":{"type":"number","description":"Trade Policy Fixed Price Value."},"listPrice":{"type":["number","null"],"description":"Trade Policy List Price Value."},"minQuantity":{"type":"integer","format":"int32","description":"Trade Policy Fixed Price Minimum Item Quantity."},"dateRange":{"description":"Trade Policy Fixed Price Validity Period Object.","required":["from","to"],"type":"object","properties":{"from":{"type":"string","description":"Indicates the date and time when the fixed price will start to be valid."},"to":{"type":"string","description":"Indicates the date and time from which the fixed price will no longer be valid."}}}}},"description":"The fixed price is a price that overlaps all other existing price configurations of a price table."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + 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. + + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `itemId` | path | (Required) SKU ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "itemId": "1234512354", + "listPrice": 300, + "costPrice": 10, + "markup": 2400, + "basePrice": 250, + "fixedPrices": [ + { + "tradePolicyId": "1", + "value": 666.66, + "listPrice": null, + "minQuantity": 1 + }, + { + "tradePolicyId": "9", + "value": 4500, + "listPrice": null, + "minQuantity": 1 + }, + { + "tradePolicyId": "9", + "value": 600, + "listPrice": null, + "minQuantity": 1, + "dateRange": { + "from": "2017-12-07T14:30:00Z", + "to": "2017-12-30T14:30:00Z" + } + }, + { + "tradePolicyId": "9", + "value": 5555.55, + "listPrice": null, + "minQuantity": 1, + "dateRange": { + "from": "2017-12-20T14:30:00Z", + "to": "2017-12-22T14:30:00Z" + } + }, + { + "tradePolicyId": "9", + "value": 555.55, + "listPrice": null, + "minQuantity": 1, + "dateRange": { + "from": "2017-12-06T15:00:00Z", + "to": "2017-12-14T15:00:00Z" + } + }, + { + "tradePolicyId": "10", + "value": 5555.55, + "listPrice": null, + "minQuantity": 1 + }, + { + "tradePolicyId": "18", + "value": 555.55, + "listPrice": null, + "minQuantity": 1 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/folder.yml b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/folder.yml new file mode 100644 index 0000000000..565e24ec55 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Prices and Fixed Prices/folder.yml @@ -0,0 +1,4 @@ +info: + name: Prices and Fixed Prices + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing configuration.yml b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing configuration.yml new file mode 100644 index 0000000000..374975a6de --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing configuration.yml @@ -0,0 +1,74 @@ +info: + name: Get pricing configuration + type: http + seq: 1 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/config + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: account + value: DefaultParameterValue + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Pricing configuration. + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "hasMigrated": true, + "migrationStatus": "Completed", + "defaultMarkup": 100, + "priceVariation": { + "upperLimit": null, + "lowerLimit": null + }, + "minimumMarkups": { + "1": 100, + "2": 90 + }, + "tradePolicyConfigs": [], + "sellersToOverride": [], + "hasPriceInheritance": false, + "priceInheritance": "never", + "hasOptionalBasePrice": false, + "blockAccount": false, + "blockedRoutes": null, + "priceTableSelectionStrategy": "first", + "priceTableLimit": null + } + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing v2 status.yml b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing v2 status.yml new file mode 100644 index 0000000000..c68f6a6aeb --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/Get pricing v2 status.yml @@ -0,0 +1,55 @@ +info: + name: Get pricing v2 status + type: http + seq: 2 + +http: + method: GET + url: https://api.vtex.com/:account/pricing/pricing/migration + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: account + value: DefaultParameterValue + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Pricing v2 status. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Pricing | Price List | **Read prices** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "isActive": true, + "hasMigrated": true + } + ``` diff --git a/BrunoCollections/VTEX - Pricing API/Pricing Configuration/folder.yml b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/folder.yml new file mode 100644 index 0000000000..dc97f803b9 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/Pricing Configuration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Pricing Configuration + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Pricing API/environments/VTEX.yml b/BrunoCollections/VTEX - Pricing API/environments/VTEX.yml new file mode 100644 index 0000000000..3f1ab35678 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: baseUrl + value: https://api.vtex.com/{{accountName}} + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Pricing API/opencollection.yml b/BrunoCollections/VTEX - Pricing API/opencollection.yml new file mode 100644 index 0000000000..f1091fe27a --- /dev/null +++ b/BrunoCollections/VTEX - Pricing API/opencollection.yml @@ -0,0 +1,94 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pricing API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Check the new [Pricing onboarding guide](https://developers.vtex.com/docs/guides/pricing-overview). This guide improves the onboarding experience for developers at VTEX by assembling all Pricing documentation on our Developer Portal and organizing it around the developer journey. + + Pricing is the VTEX module responsible for the SKU price list. It stores each SKU’s base price, optional fixed prices by trade policy, and rules that dynamically generate final prices according to the purchase context and trade policy. + + For details on how to use this module and its business logic, see the [Pricing onboarding guide](https://developers.vtex.com/docs/guides/pricing-overview). + + ## Rate limits per route + + The following table summarizes the rate limits per HTTP method and the available burst credits for each route: + + | Operation | Rate | Burst credits | + | - | - | - | + | `GET` | Rate limit under review. Usage may be restricted in cases of excessive use. | Under review | + | `POST` and `PUT` | 2000 per minute
33 per second | 500 | + | `DELETE` | 1000 per minute
16 per second | 300 | + + ### Burst credits + + When an account exceeds the per-second rate for a route, the excess is deducted from that route’s burst credits. + **Example:** If an account sends **34 requests per second** to a `POST` or `PUT` price route (whose per-second rate is **33**), **1** burst credit is consumed. + + If burst credits reach **0**, the service blocks new requests and returns **HTTP 429**. + + Burst credits **refill over time** while the route is idle, at the **same rate** as the route’s per-second limit. + **Example:** For `POST` or `PUT` routes (whose per-second rate is **33**), each idle second refills **33** burst credits for that limiter. + + ### Response headers for rate limits + + In the response of any request to the Pricing API, there are 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. + + - `Ratelimit-Limit`: total burst credits available for the route. + - `Ratelimit-Remaining`: remaining burst credits for the route. + - `Ratelimit-Reset`: time, in seconds, until burst credits fully refill (up to `Ratelimit-Limit`). + - `Retry-After`: time, in seconds, until the route accepts a new request. If present, the current request was rate-limited and not processed. + + ### Integrating with Pricing v2 considering rate limits + When developing an integration, consider the **request, route, and account** limits specified in the [Rate limits per route](#rate-limit-per-route) section, and avoid surpassing this frequency. + + If 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. + + + ## Index + + ### Prices and fixed prices + - `GET` [Get price](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/prices/-itemId-) + - `DELETE` [Delete price](https://developers.vtex.com/docs/api-reference/pricing-api/#delete-/pricing/prices/-itemId-) + - `PUT` [Create or update base price or fixed prices](https://developers.vtex.com/docs/api-reference/pricing-api/#put-/pricing/prices/-itemId-) + - `PATCH` [Create or update base price or fixed prices](https://developers.vtex.com/docs/api-reference/pricing-api#patch-/pricing/prices/-itemId-/fixed) + - `GET` [Get fixed prices](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/prices/-itemId-/fixed) + - `POST` [Create or update fixed prices on a price table or trade policy](https://developers.vtex.com/docs/api-reference/pricing-api/#post-/pricing/prices/-itemId-/fixed/-priceTableId-) + - `GET` [Get fixed prices on a price table policy](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/prices/-itemId-/fixed/-priceTableId-) + - `DELETE` [Delete fixed prices on a price table or trade policy](https://developers.vtex.com/docs/api-reference/pricing-api/#delete-/pricing/prices/-itemId-/fixed/-priceTableId-) + - `GET` [Get computed prices for all price tables](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/prices/-itemId-/computed) + - `GET` [Get computed price by price table or trade policy](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/prices/-itemId-/computed/-priceTableId-) + + ### Pricing configuration + - `GET` [Get Pricing configuration](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/config) + - `GET` [Get Pricing v2 status](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/migration) + + ### Price tables + - `GET` [Get rules for a price table](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/pipeline/catalog/-priceTableId-) + - `PUT` [Update rules for a price table](https://developers.vtex.com/docs/api-reference/pricing-api/#put-/pricing/pipeline/catalog/-priceTableId-) + - `GET` [Get all price tables and their rules](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/pipeline/catalog) + - `GET` [List price tables](https://developers.vtex.com/docs/api-reference/pricing-api/#get-/pricing/tables) + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{accountName}` | Store account name. | + | `{environment}` | Environment to be called. | + | `X-VTEX-API-AppKey` | Header used for authentication (application key). | + | `X-VTEX-API-AppToken` | Header used for authentication (application token). | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Configure external price source.yml b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Configure external price source.yml new file mode 100644 index 0000000000..d2f69b4412 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Configure external price source.yml @@ -0,0 +1,58 @@ +info: + name: Configure external price source + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/pricing-hub/prices/config" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexamples + type: query + disabled: true + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "active": true, + "appName": "apiexamples_app_name" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/pricing-hub/prices/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ This API has been deprecated. If you need to associate prices with customers, we recommend using the [Audience API](https://developers.vtex.com/docs/api-reference/audience-api). + + This route facilitates setting up an external price source in Pricing Hub. It also allows you to activate or deactivate that source in a given account. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | Name of the VTEX account. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Retrieve prices.yml b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Retrieve prices.yml new file mode 100644 index 0000000000..2c849eb63c --- /dev/null +++ b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/Retrieve prices.yml @@ -0,0 +1,123 @@ +info: + name: Retrieve prices + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/pricing-hub/prices?an=apiexamples" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "items": [ + { + "index": 0, + "skuId": "13", + "quantity": 1, + "brandId": "2000000", + "sellerId": "1", + "priceTableIds": [], + "categoriesIds": [ + "1" + ] + } + ], + "UtmSource": "facebook", + "UtmMedium": "social", + "UtmCampaign": "summer", + "UtmInternalCampaign": "sale", + "salesChannel": "1", + "email": "customer@email.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/pricing-hub/prices - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/pricing-hub/prices - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/pricing-hub/prices - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/pricing-hub/prices - Schema is valid", function () { + const schema = {"required":["items"],"type":"object","properties":{"items":{"type":"array","items":{"required":["index","skuId","price","costPrice","listPrice","priceTable","priceValidUntil"],"type":"object","description":"Each price item.","properties":{"index":{"type":"integer","description":"The same index referring to Checkout's cart that was passed to the API."},"skuId":{"type":"string","description":"The same skuId that was passed to the API."},"price":{"type":"number","description":"The price returned by the pricing API that was used by Pricing Hub. It is measured in cents, so 5000 means 50,00 in local currency."},"costPrice":{"type":"number","description":"The cost price returned by the pricing API that was used by Pricing Hub. It is measured in cents, so 5000 means 50,00 in local currency."},"listPrice":{"type":"number","description":"The list price returned by the pricing API that was used by Pricing Hub. It is measured in cents, so 5000 means 50,00 in local currency."},"priceTable":{"type":"string","description":"The price table that was used to price the item."},"priceValidUntil":{"type":"string","description":"The moment up until the price is valid. After that moment, it will be necessary to call the pricing API again. The format of the string is in RFC3339."}}},"description":"List of items and their respective prices applied by Pricing Hub."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >⚠️ This API has been deprecated. If you need to associate prices with specific customers, we recommend using the [Audience API](https://developers.vtex.com/docs/api-reference/audience-api). + + This route retrieves and applies prices for the items that are passed in the request. Pricing Hub will select the pricing method that will be used for each item and will fetch their respective price from the selected pricing method. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `an` | query | (Required) Name of the VTEX account. Used as part of the URL. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "index": 0, + "skuId": "14", + "price": 1875, + "costPrice": 750, + "listPrice": 2500, + "priceTable": "1", + "priceValidUntil": "2022-03-24T14:57:19Z" + }, + { + "index": 0, + "skuId": "14", + "price": 200, + "costPrice": 200, + "listPrice": 200, + "priceTable": "1", + "priceValidUntil": "2022-03-04T20:00:18Z" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/folder.yml b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/folder.yml new file mode 100644 index 0000000000..5c3be26d61 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing Hub/Pricing Hub Prices/folder.yml @@ -0,0 +1,4 @@ +info: + name: Pricing Hub Prices + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Pricing Hub/environments/VTEX.yml b/BrunoCollections/VTEX - Pricing Hub/environments/VTEX.yml new file mode 100644 index 0000000000..2017d4da20 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing Hub/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://prchub.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Pricing Hub/opencollection.yml b/BrunoCollections/VTEX - Pricing Hub/opencollection.yml new file mode 100644 index 0000000000..e501840f26 --- /dev/null +++ b/BrunoCollections/VTEX - Pricing Hub/opencollection.yml @@ -0,0 +1,52 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Pricing Hub + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + > This feature is in closed beta, available only for selected customers. If you have any questions, contact our [Support](https://support.vtex.com/hc/en-us/requests). + + In the B2B scenario, it is common for stores to have personalized prices per customer and complex pricing systems that require external integrations. Pricing Hub is a system developed for the B2B context that works as an intermediary between VTEX and external pricing systems. + + In VTEX, B2B stores have the option to use our internal pricing system or an external one. If the store chooses to operate with an external pricing system, Pricing Hub will query an external price calculation API. The external API should then respond with the price for all items in the shopping cart according to its predefined tax rules. + + ![Pricing hub protocal diagram](https://user-images.githubusercontent.com/77292838/211634260-e4f7a516-91df-416e-ab43-d9c79d56bc91.png) + + ## Implementation + + To connect with external pricing systems using Pricing Hub, it is necessary to build a VTEX IO middleware app. We offer two reference implementation templates to simplify this process: + + - [C# template](https://github.com/vtex-apps/external-prices-app) + - [Node template](https://github.com/vtex-apps/external-prices-node) + + Read the documentation on each repository to learn more about the required steps to use and customize the app. + + > The app used by Pricing Hub to connect must be a `major 0`. + + ### Index + - [POST - Retrieve prices](https://developers.vtex.com/docs/api-reference/pricing-hub#post-/api/pricing-hub/prices?endpoint=post-/api/pricing-hub/prices) + - [PUT - Configure External Price Source](https://developers.vtex.com/docs/api-reference/pricing-hub#put-/api/pricing-hub/prices/config) + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}` | Store account name. | + | `{{environment}}` | The environment that will be called. | + | `{{X-VTEX-API-AppKey}}` | Located in the headers of the requests, user authentication key. | + | `{{X-VTEX-API-AppToken}}` | Located in the headers of the requests, authentication password. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Create client address.yml b/BrunoCollections/VTEX - Profile System/Addresses/Create client address.yml new file mode 100644 index 0000000000..f2d838d3b0 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Create client address.yml @@ -0,0 +1,134 @@ +info: + name: Create client address + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + body: + type: json + data: |- + { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "contactId": "1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/addresses - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/addresses - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/addresses - Schema is valid", function () { + const schema = {"title":"Unmasked address response","type":"object","description":"Unmasked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates new address for a given client profile. + + + > The `id` field returned by this request is the `addressId` used to retrieve or update information of a specific address later. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Delete address.yml b/BrunoCollections/VTEX - Profile System/Addresses/Delete address.yml new file mode 100644 index 0000000000..7bfbe8b8bb --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Delete address.yml @@ -0,0 +1,79 @@ +info: + name: Delete address + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a client's address by `profileId` and `addressId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get address by version.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get address by version.yml new file mode 100644 index 0000000000..3d3be83f9f --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get address by version.yml @@ -0,0 +1,132 @@ +info: + name: Get address by version + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + - name: addressVersionId + value: 86dfae79-1d23-43f2-a643-2fc8f1839461 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId - Schema is valid", function () { + const schema = {"title":"Masked address response","type":"object","description":"Masked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a specific version address of a given client. + + + > For security and privacy reasons, this request returns masked address data by version. For unmasked information, see [Get unmasked address by version](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/addresses/-addressId-/versions/-addressVersionId-/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `addressVersionId` | path | (Required) ID of the version of a given client's address as returned by endpoints that create or update address information in the `version` field. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "2****-0**", + "countryName": "B*****", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "L*******", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get address.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get address.yml new file mode 100644 index 0000000000..98c0951203 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get address.yml @@ -0,0 +1,124 @@ +info: + name: Get address + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Schema is valid", function () { + const schema = {"title":"Masked address response","type":"object","description":"Masked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a specific address of a given client, by its respectives `adderssId` and `profileId`. + + + > For security and privacy reasons, this request returns masked address data. For unmasked information, see [Get unmasked address](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/addresses/-addressId-/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "2****-0**", + "countryName": "B*****", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "L*******", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get client addresses.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get client addresses.yml new file mode 100644 index 0000000000..90194b2a51 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get client addresses.yml @@ -0,0 +1,122 @@ +info: + name: Get client addresses + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Masked address response","type":"object","description":"Masked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of all addresses of a given client, by its `profileId`. + + + > For security and privacy reasons, this request returns masked address data. For unmasked information, see [Get unmasked client addresses](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/addresses/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "2****-0**", + "countryName": "B*****", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "L*******", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address by version.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address by version.yml new file mode 100644 index 0000000000..b501754f5a --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address by version.yml @@ -0,0 +1,129 @@ +info: + name: Get unmasked address by version + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + - name: addressVersionId + value: 86dfae79-1d23-43f2-a643-2fc8f1839461 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/versions/:addressVersionId/unmask - Schema is valid", function () { + const schema = {"title":"Unmasked address response","type":"object","description":"Unmasked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of a specific address version of a given client. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `addressVersionId` | path | (Required) ID of the version of a given client's address as returned by endpoints that create or update address information in the `version` field. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address.yml new file mode 100644 index 0000000000..51698eb7f6 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked address.yml @@ -0,0 +1,125 @@ +info: + name: Get unmasked address + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId/unmask - Schema is valid", function () { + const schema = {"title":"Unmasked address response","type":"object","description":"Unmasked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of a specific address of a given client, by its respectives `adderssId` and `profileId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked client addresses.yml b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked client addresses.yml new file mode 100644 index 0000000000..08f813485b --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Get unmasked client addresses.yml @@ -0,0 +1,119 @@ +info: + name: Get unmasked client addresses + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/unmask" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/addresses/unmask - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Unmasked address response","type":"object","description":"Unmasked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of all addresses of a given client, by its `profileId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "c9c44895-4589-4d0d-a28d-e0e656ca1926", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T18:51:34.1293829+00:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/Update client address.yml b/BrunoCollections/VTEX - Profile System/Addresses/Update client address.yml new file mode 100644 index 0000000000..95d19935d5 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/Update client address.yml @@ -0,0 +1,135 @@ +info: + name: Update client address + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/addresses/:addressId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: addressId + value: bf82180e-cf9e-4089-9af6-ae1518555992 + type: path + body: + type: json + data: |- + { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "51", + "streetNumber": "999", + "contactId": "1" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/addresses/:addressId - Schema is valid", function () { + const schema = {"title":"Unmasked address response","type":"object","description":"Unmasked address information.","properties":{"id":{"title":"id","type":"string","description":"ID of a client's address."},"document":{"title":"Address","type":"object","description":"Address information.","required":["postalCode","countryName","administrativeAreaLevel1","locality","localityAreaLevel1","route","streetNumber","profileId"],"properties":{"postalCode":{"type":"string","description":"Address postal code."},"countryName":{"type":"string","description":"Name of the address country."},"countryCode":{"type":"string","description":"Two letter country code."},"administrativeAreaLevel1":{"type":"string","description":"Name of administrative area, such as the state or province."},"locality":{"type":"string","description":"Name of address locality, such as the city."},"localityAreaLevel1":{"type":"string","description":"Name of the address locality area, such as the neighborhood or district."},"route":{"type":"string","description":"Address route or street name."},"streetNumber":{"type":"string","description":"Address street number."},"profileId":{"title":"id","type":"string","description":"ID of the client's profile."},"contactId":{"type":"string","description":"Contact unique identifier."}}},"meta":{"title":"Address metadata","type":"object","description":"Address metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the address version."},"author":{"type":"string","description":"Unique identifier of the user who created the address."},"creationDate":{"type":"string","description":"Date when the address was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the address was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates one or more fields of an existing address for a given client profile. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `addressId` | path | (Required) ID of a client's specific address as returned in the [Create client address](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles/-profileId-/addresses) endpoint's response, in the `id` field. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "bf82180e-cf9e-4089-9af6-ae1518555992", + "document": { + "postalCode": "20200-000", + "countryName": "Brasil", + "countryCode": "BR", + "administrativeAreaLevel1": "RJ", + "locality": "Locality", + "localityAreaLevel1": "locality area", + "route": "34", + "streetNumber": "333", + "profileId": "70caf394-8534-447e-a0ca-1803c669c771" + }, + "meta": { + "version": "86dfae79-1d23-43f2-a643-2fc8f1839461", + "author": "80aa79a3-aa89-4912-a20e-8ef69af19a6c", + "creationDate": "2022-01-18T18:51:34.1293829+00:00", + "lastUpdateDate": "2022-01-18T21:08:02.9364099+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Addresses/folder.yml b/BrunoCollections/VTEX - Profile System/Addresses/folder.yml new file mode 100644 index 0000000000..d5f5b654c9 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Addresses/folder.yml @@ -0,0 +1,4 @@ +info: + name: Addresses + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Create client profile.yml b/BrunoCollections/VTEX - Profile System/Profiles/Create client profile.yml new file mode 100644 index 0000000000..5faf08cdca --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Create client profile.yml @@ -0,0 +1,129 @@ +info: + name: Create client profile + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/storage/profile-system/profiles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ttl + value: "365" + type: query + disabled: true + body: + type: json + data: |- + { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "document": "12345678900", + "documentType": "CPF", + "birthDate": "1925-11-17", + "{customField}": "{value}" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/storage/profile-system/profiles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/storage/profile-system/profiles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/storage/profile-system/profiles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/storage/profile-system/profiles - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates new client profile. + + + You can send custom fields in the request body and they will be saved as part of your document. Therefore, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + The `id` field returned by this request is the `profileId` used to retrieve information on a specific profile later. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ttl` | query | This parameter sets the the Time To Live (TTL), in days, of the specific document being created or updated with this request. After this period of time from the moment of the request, the document is deleted. By sending this parameter you override the TTL set for the schema. > Currently, the available default document schemas have no TTL. This means that documents are stored indefinitely, unless a TTL is sent when creating or updating. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "c2cbebba-214e-40b2-b68f-98f862e755d5", + "meta": { + "version": "27112371-a71b-45d6-b3bc-93436a3a0b4f", + "author": "82a2b53d-39be-4f49-bb7c-8971b58cb7dc", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdate": "2022-01-05T15:41:37.5009471+00:00" + }, + "document": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "birthDate": "1925-11-17", + "document": "12345678911", + "documentType": "CPF", + "{customField}": "{value}" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Delete client profile.yml b/BrunoCollections/VTEX - Profile System/Profiles/Delete client profile.yml new file mode 100644 index 0000000000..655cf04d6c --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Delete client profile.yml @@ -0,0 +1,73 @@ +info: + name: Delete client profile + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/storage/profile-system/profiles/:profileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/storage/profile-system/profiles/:profileId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a client profile by `profileId`. + + + >❗ This endpoint is not suitable for granting a shopper's [right to erasure](https://help.vtex.com/en/tutorial/data-subject-rights--6imchxTx09icupKMbzHVIM#erasure). For that purpose, open a [support](https://help.vtex.com/en/support) ticket, according to the instructions in the section [Request erasure via support](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU#request-erasure-via-support) of the shopper data erasure guide. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Get profile by version.yml b/BrunoCollections/VTEX - Profile System/Profiles/Get profile by version.yml new file mode 100644 index 0000000000..97e9b7da46 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Get profile by version.yml @@ -0,0 +1,122 @@ +info: + name: Get profile by version + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: profileVersionId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId - Schema is valid", function () { + const schema = {"title":"Masked profile response","type":"array","description":"Array containing masked profile information.","items":{"type":"object","description":"Masked profile information.","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the information of a specific version of a client profile. + + + > Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + > For security and privacy reasons, this request returns masked profile data. For unmasked information, see [Get unmasked profile by version](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/versions/-profileVersionId-/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `profileVersionId` | path | (Required) ID of the version of the client's profile as returned by endpoints that create or update profile information in the `version` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "70caf394-8534-447e-a0ca-1803c669c771", + "document": { + "firstName": "J***", + "lastName": "G****", + "email": "j***********", + "birthDate": "1925-11-17", + "document": "1********", + "documentType": "CPF", + "{customField}": "{value}" + }, + "meta": { + "version": "bb996089-b77c-4bf3-be35-b99b6d91f91c", + "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdate": "2022-01-15T15:41:37.5009471+00:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Get profile.yml b/BrunoCollections/VTEX - Profile System/Profiles/Get profile.yml new file mode 100644 index 0000000000..1fe2097022 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Get profile.yml @@ -0,0 +1,123 @@ +info: + name: Get profile + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId - Schema is valid", function () { + const schema = {"title":"Masked profile response","type":"array","description":"Array containing masked profile information.","items":{"type":"object","description":"Masked profile information.","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the information of a specific client, by its `profileId`. + + + > Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + > For security and privacy reasons, this request returns masked profile data. For unmasked information, see [Get unmasked profile](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "70caf394-8534-447e-a0ca-1803c669c771", + "meta": { + "version": "abc", + "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", + "creationDate": "13/12/2021T00:00:00Z", + "lastUpdate": "13/12/2021T00:00:00Z" + }, + "document": { + "firstName": "J***", + "lastName": "D**", + "email": "j***.d**@e******.c**", + "birthDate": "1925-11-17", + "document": "1**********", + "documentType": "CPF", + "{customField}": "{value}" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile by version.yml b/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile by version.yml new file mode 100644 index 0000000000..2dde072879 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile by version.yml @@ -0,0 +1,123 @@ +info: + name: Get unmasked profile by version + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + - name: profileVersionId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/versions/:profileVersionId/unmask - Schema is valid", function () { + const schema = {"type":"array","description":"Array with unmasked profile information.","items":{"title":"Unmasked profile response","type":"object","description":"Unmasked profile response.","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of a specific version of a client profile. + + + > Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `profileVersionId` | path | (Required) ID of the version of the client's profile as returned by endpoints that create or update profile information in the `version` field. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "70caf394-8534-447e-a0ca-1803c669c771", + "document": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "birthDate": "1925-11-17", + "document": "12345678911", + "documentType": "CPF", + "{customField}": "{value}" + }, + "meta": { + "version": "abc", + "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdate": "2022-01-17T15:41:37.5009471+00:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile.yml b/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile.yml new file mode 100644 index 0000000000..d0c3bf69a9 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Get unmasked profile.yml @@ -0,0 +1,123 @@ +info: + name: Get unmasked profile + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/unmask - Schema is valid", function () { + const schema = {"type":"array","description":"Array with unmasked profile information.","items":{"title":"Unmasked profile response","type":"object","description":"Unmasked profile response.","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of a specific client, by its `profileId`. + + + > Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "70caf394-8534-447e-a0ca-1803c669c771", + "document": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "birthDate": "1925-11-17", + "document": "12345678911", + "documentType": "CPF" + }, + "meta": { + "version": "abc", + "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdate": "2022-01-17T15:41:37.5009471+00:00" + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/Update client profile.yml b/BrunoCollections/VTEX - Profile System/Profiles/Update client profile.yml new file mode 100644 index 0000000000..309d7e0c5a --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/Update client profile.yml @@ -0,0 +1,134 @@ +info: + name: Update client profile + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: ttl + value: "365" + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + body: + type: json + data: |- + { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "document": "12345678900", + "documentType": "CPF", + "birthDate": "1925-11-17", + "{customField}": "{value}" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId - Schema is valid", function () { + const schema = {"title":"Unmasked profile response","type":"object","description":"Unmasked profile response.","properties":{"id":{"title":"id","type":"string","description":"ID of the client's profile."},"document":{"title":"Profile","type":"object","description":"Profile schema.","required":["firstName","lastName","email","document","documentType"],"properties":{"firstName":{"type":"string","description":"Client's first name."},"lastName":{"type":"string","description":"Client's last name."},"email":{"type":"string","description":"Client's email address."},"birthDate":{"type":"string","description":"Client's birth date in ISO 8601 format."},"document":{"type":"string","description":"Client's document."},"documentType":{"type":"string","description":"Type of document informed in `document`."},"{customField}":{"type":"string","description":"Name of custom field defined in [Create or delete custom fields](https://developers.vtex.com/docs/api-reference/profile-system#put-/api/storage/profile-system/schemas/profileSystem/custom). Can be of any type: string, number, boolean, array or object."}}},"meta":{"title":"Profile metadata","type":"object","description":"Profile metadata.","required":["version","author","creationDate","lastUpdate"],"properties":{"version":{"type":"string","description":"Unique identifier of the profile version."},"author":{"type":"string","description":"Unique identifier of the user who created the profile."},"creationDate":{"type":"string","description":"Date when the profile was created in ISO 8601 format."},"lastUpdate":{"type":"string","description":"Date when the profile was last updated in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates one or more fields of an existing client profile. + + + > Since your store's profile schema is customizable, the schema and examples presented below may differ from yours. Your integration must be adapted accordingly. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `ttl` | query | This parameter sets the the Time To Live (TTL), in days, of the specific document being created or updated with this request. After this period of time from the moment of the request, the document is deleted. By sending this parameter you override the TTL set for the schema. > Currently, the available default document schemas have no TTL. This means that documents are stored indefinitely, unless a TTL is sent when creating or updating. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "70caf394-8534-447e-a0ca-1803c669c771", + "document": { + "firstName": "John", + "lastName": "Doe", + "email": "john.doe@example.com", + "birthDate": "1925-11-17", + "document": "12345678911", + "documentType": "CPF" + }, + "meta": { + "version": "abc", + "author": "e40e0b6d-0605-4fa6-8176-1d69fbaf0818", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdate": "2022-01-17T15:41:37.5009471+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Profiles/folder.yml b/BrunoCollections/VTEX - Profile System/Profiles/folder.yml new file mode 100644 index 0000000000..5d7eaea09d --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Profiles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Profiles + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Create prospect.yml b/BrunoCollections/VTEX - Profile System/Prospects/Create prospect.yml new file mode 100644 index 0000000000..bcc5684f1f --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Create prospect.yml @@ -0,0 +1,383 @@ +info: + name: Create prospect + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/storage/profile-system/prospects" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "Home", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "Apartment 2B", + "geoCoordinate": [ + "49.334934", + "49.334934" + ] + }, + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "Home", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "Apartment 2B", + "geoCoordinate": [ + "49.334934", + "49.334934" + ] + } + ], + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc", + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + }, + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc", + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [ + "12345", + "12345" + ], + "transactions": [ + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "irure sit labore Lorem cillum", + "paymentSystem": "qui quis veniam consequat", + "paymentSystemName": "fugiat", + "value": 55797830, + "installments": 99179610, + "referenceValue": -53883378, + "cardHolder": "ipsum deserunt amet", + "cardNumber": "id esse Ut in elit", + "firstDigits": "anim ea reprehenderit labore", + "lastDigits": "occaecat", + "cvv2": "eu dolore", + "expireMonth": "dolore laborum", + "expireYear": "sunt ut consequat", + "url": "in irure pariatur ", + "giftCardId": "cupidatat", + "giftCardName": "dolor eiu", + "giftCardCaption": "incididunt velit", + "redemptionCode": "enim fugiat", + "group": "anim eu in minim", + "tid": "dolore id labore laborum", + "dueDate": "veniam", + "connectorResponses": {} + }, + { + "id": "culpa sint id dolor irure", + "paymentSystem": "aute veniam", + "paymentSystemName": "magna ex", + "value": 1234937, + "installments": -74735263, + "referenceValue": -48839261, + "cardHolder": "reprehenderit dolore minim", + "cardNumber": "ea aliqua est reprehenderit", + "firstDigits": "cillum nisi quis mollit", + "lastDigits": "labore dolor quis in", + "cvv2": "nulla fugiat", + "expireMonth": "culpa sunt ", + "expireYear": "sint aliqua elit minim", + "url": "Excepteur dolore sit", + "giftCardId": "fugiat minim", + "giftCardName": "ut id", + "giftCardCaption": "sit ea", + "redemptionCode": "sint irure tempor in", + "group": "reprehenderit deserunt", + "tid": "do", + "dueDate": "aliqu", + "connectorResponses": {} + } + ] + }, + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "commodo sint sed aliquip", + "paymentSystem": "irure nulla nostrud", + "paymentSystemName": "ipsum fugiat dolore culpa", + "value": 43711674, + "installments": -41805793, + "referenceValue": -5063287, + "cardHolder": "ullamco su", + "cardNumber": "quis sit Excepteur", + "firstDigits": "laborum deserunt minim", + "lastDigits": "qui consectetur pariatur fugiat", + "cvv2": "consectetur et consequat", + "expireMonth": "laboris pariatur laborum", + "expireYear": "irure tempor culpa", + "url": "voluptate ad mollit id", + "giftCardId": "magna ut enim sit", + "giftCardName": "tempor", + "giftCardCaption": "Lor", + "redemptionCode": "in ullamco in ut", + "group": "dolor", + "tid": "co", + "dueDate": "adipisicing non commodo dolore minim", + "connectorResponses": {} + }, + { + "id": "magna", + "paymentSystem": "deserunt officia Excepteur", + "paymentSystemName": "enim aliquip", + "value": 94318468, + "installments": -44139936, + "referenceValue": -1138679, + "cardHolder": "et occaecat amet qui", + "cardNumber": "sit nulla in est Lorem", + "firstDigits": "Ut cillum magna sit", + "lastDigits": "occaecat sunt", + "cvv2": "exercitation dolore", + "expireMonth": "nulla incididunt ullamco voluptate sunt", + "expireYear": "Duis dolor dolore", + "url": "in", + "giftCardId": "ad in commodo sit", + "giftCardName": "eu sit", + "giftCardCaption": "consequat anim et ad", + "redemptionCode": "elit ad", + "group": "consectetur minim culpa", + "tid": "adipisicing reprehenderit do", + "dueDate": "in", + "connectorResponses": {} + } + ] + } + ], + "giftCards": [ + "12345", + "12345" + ], + "giftCardMessages": [ + "Message.", + "Message." + ], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910", + "document": "12345678910" + }, + { + "contactId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910", + "document": "12345678910" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/storage/profile-system/prospects - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/storage/profile-system/prospects - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/storage/profile-system/prospects - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/storage/profile-system/prospects - Schema is valid", function () { + const schema = {"title":"Unmasked prospect information.","type":"object","description":"Unmasked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates new prospect. + + + > The `id` field returned by this request is the `prospectId` used to retrieve information on a specific prospect later. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "customerAddressId", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "", + "receiverName": "Jane Doe", + "geoCoordinate": [] + } + ], + "paymentData": { + "availableAccounts": [], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "", + "firstName": "Jane", + "lastName": "Doe", + "phone": "", + "document": "", + "documentType": "" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "af9117e9-4169-46ee-ab4b-d4b17b881488", + "author": "d6d8269f-e7cc-4e4b-8b89-3b46a1407937", + "creationDate": "2023-10-25T13:59:52.7633627+00:00", + "lastUpdateDate": "2023-10-25T14:02:45.7277154+00:00", + "expirationDate": null + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Delete prospect.yml b/BrunoCollections/VTEX - Profile System/Prospects/Delete prospect.yml new file mode 100644 index 0000000000..727c453722 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Delete prospect.yml @@ -0,0 +1,70 @@ +info: + name: Delete prospect + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/api/storage/profile-system/prospects/:prospectId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: prospectId + value: 98478f6b-d025-4f35-a560-dd1ee7a6f26e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/storage/profile-system/prospects/:prospectId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/storage/profile-system/prospects/:prospectId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a prospect by `prospectId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `prospectId` | path | (Required) ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Get prospect.yml b/BrunoCollections/VTEX - Profile System/Prospects/Get prospect.yml new file mode 100644 index 0000000000..f836d8cdb5 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Get prospect.yml @@ -0,0 +1,158 @@ +info: + name: Get prospect + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/prospects/:prospectId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: prospectId + value: 98478f6b-d025-4f35-a560-dd1ee7a6f26e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId - Schema is valid", function () { + const schema = {"title":"Masked prospect information.","type":"object","description":"Masked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the information of a specific prospect, by its `prospectId`. + + + > For security and privacy reasons, this request returns masked prospect data. For unmasked information, see [Get unmasked prospect](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/prospects/-prospectId-/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `prospectId` | path | (Required) ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "customerAddressId", + "addressType": "residential", + "postalCode": "3*****", + "city": "P*****", + "country": "USA", + "street": "F*****", + "number": "9****", + "complement": "", + "receiverName": "J*** D**", + "geoCoordinate": [] + } + ], + "paymentData": { + "availableAccounts": [], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "", + "firstName": "J***", + "lastName": "D**", + "phone": "", + "document": "", + "documentType": "" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "j***@m***.c**", + "firstName": "J***", + "lastName": "D**", + "phone": "1**********" + }, + "email": "j***@m***.c**", + "firstName": "J***", + "lastName": "D**", + "document": "1**********", + "cellPhone": "1**********", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "af9117e9-4169-46ee-ab4b-d4b17b881488", + "author": "d6d8269f-e7cc-4e4b-8b89-3b46a1407937", + "creationDate": "2023-10-25T13:59:52.7633627+00:00", + "lastUpdateDate": "2023-10-25T14:02:45.7277154+00:00", + "expirationDate": null + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Get prospects.yml b/BrunoCollections/VTEX - Profile System/Prospects/Get prospects.yml new file mode 100644 index 0000000000..e28bc95ce2 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Get prospects.yml @@ -0,0 +1,155 @@ +info: + name: Get prospects + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/prospects" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/prospects - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/prospects - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/prospects - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/prospects - Schema is valid", function () { + const schema = {"type":"array","description":"List of masked prospects.","items":{"title":"Masked prospect information.","type":"object","description":"Masked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of all prospects. + + + > For security and privacy reasons, this request returns masked prospect data. For unmasked information, see [Get unmasked prospects](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/prospects/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "customerAddressId", + "addressType": "residential", + "postalCode": "3*****", + "city": "P*****", + "country": "USA", + "street": "F*****", + "number": "9****", + "complement": "", + "receiverName": "J*** D**", + "geoCoordinate": [] + } + ], + "paymentData": { + "availableAccounts": [], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "", + "firstName": "J***", + "lastName": "D**", + "phone": "", + "document": "", + "documentType": "" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "j***@m***.c**", + "firstName": "J***", + "lastName": "D**", + "phone": "1**********" + }, + "email": "j***@m***.c**", + "firstName": "J***", + "lastName": "D**", + "document": "1**********", + "cellPhone": "1**********", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "af9117e9-4169-46ee-ab4b-d4b17b881488", + "author": "d6d8269f-e7cc-4e4b-8b89-3b46a1407937", + "creationDate": "2023-10-25T13:59:52.7633627+00:00", + "lastUpdateDate": "2023-10-25T14:02:45.7277154+00:00", + "expirationDate": null + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospect.yml b/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospect.yml new file mode 100644 index 0000000000..20d8114ee8 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospect.yml @@ -0,0 +1,159 @@ +info: + name: Get unmasked prospect + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/prospects/:prospectId/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: prospectId + value: 98478f6b-d025-4f35-a560-dd1ee7a6f26e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/prospects/:prospectId/unmask - Schema is valid", function () { + const schema = {"title":"Unmasked prospect information.","type":"object","description":"Unmasked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of a specific prospect, by its `prospectId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `prospectId` | path | (Required) ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "customerAddressId", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "", + "receiverName": "Jane Doe", + "geoCoordinate": [] + } + ], + "paymentData": { + "availableAccounts": [], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "", + "firstName": "Jane", + "lastName": "Doe", + "phone": "", + "document": "", + "documentType": "" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "af9117e9-4169-46ee-ab4b-d4b17b881488", + "author": "d6d8269f-e7cc-4e4b-8b89-3b46a1407937", + "creationDate": "2023-10-25T13:59:52.7633627+00:00", + "lastUpdateDate": "2023-10-25T14:02:45.7277154+00:00", + "expirationDate": null + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospects.yml b/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospects.yml new file mode 100644 index 0000000000..23f66d5281 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Get unmasked prospects.yml @@ -0,0 +1,152 @@ +info: + name: Get unmasked prospects + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/prospects/unmask" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/prospects/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/prospects/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/prospects/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/prospects/unmask - Schema is valid", function () { + const schema = {"type":"array","description":"List of prospects.","items":{"title":"Unmasked prospect information.","type":"object","description":"Unmasked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked information of all prospects. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "customerAddressId", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "", + "receiverName": "Jane Doe", + "geoCoordinate": [] + } + ], + "paymentData": { + "availableAccounts": [], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "", + "firstName": "Jane", + "lastName": "Doe", + "phone": "", + "document": "", + "documentType": "" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "af9117e9-4169-46ee-ab4b-d4b17b881488", + "author": "d6d8269f-e7cc-4e4b-8b89-3b46a1407937", + "creationDate": "2023-10-25T13:59:52.7633627+00:00", + "lastUpdateDate": "2023-10-25T14:02:45.7277154+00:00", + "expirationDate": null + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/Update prospect.yml b/BrunoCollections/VTEX - Profile System/Prospects/Update prospect.yml new file mode 100644 index 0000000000..4b7a795201 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/Update prospect.yml @@ -0,0 +1,437 @@ +info: + name: Update prospect + type: http + seq: 5 + +http: + method: PATCH + url: "{{baseUrl}}/api/storage/profile-system/prospects/:prospectId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: prospectId + value: 98478f6b-d025-4f35-a560-dd1ee7a6f26e + type: path + body: + type: json + data: |- + { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "Home", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "Apartment 2B", + "geoCoordinate": [ + "49.334934", + "49.334934" + ] + }, + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "Home", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "Apartment 2B", + "geoCoordinate": [ + "49.334934", + "49.334934" + ] + } + ], + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc", + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + }, + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc", + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [ + "12345", + "12345" + ], + "transactions": [ + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "irure sit labore Lorem cillum", + "paymentSystem": "qui quis veniam consequat", + "paymentSystemName": "fugiat", + "value": 55797830, + "installments": 99179610, + "referenceValue": -53883378, + "cardHolder": "ipsum deserunt amet", + "cardNumber": "id esse Ut in elit", + "firstDigits": "anim ea reprehenderit labore", + "lastDigits": "occaecat", + "cvv2": "eu dolore", + "expireMonth": "dolore laborum", + "expireYear": "sunt ut consequat", + "url": "in irure pariatur ", + "giftCardId": "cupidatat", + "giftCardName": "dolor eiu", + "giftCardCaption": "incididunt velit", + "redemptionCode": "enim fugiat", + "group": "anim eu in minim", + "tid": "dolore id labore laborum", + "dueDate": "veniam", + "connectorResponses": {} + }, + { + "id": "culpa sint id dolor irure", + "paymentSystem": "aute veniam", + "paymentSystemName": "magna ex", + "value": 1234937, + "installments": -74735263, + "referenceValue": -48839261, + "cardHolder": "reprehenderit dolore minim", + "cardNumber": "ea aliqua est reprehenderit", + "firstDigits": "cillum nisi quis mollit", + "lastDigits": "labore dolor quis in", + "cvv2": "nulla fugiat", + "expireMonth": "culpa sunt ", + "expireYear": "sint aliqua elit minim", + "url": "Excepteur dolore sit", + "giftCardId": "fugiat minim", + "giftCardName": "ut id", + "giftCardCaption": "sit ea", + "redemptionCode": "sint irure tempor in", + "group": "reprehenderit deserunt", + "tid": "do", + "dueDate": "aliqu", + "connectorResponses": {} + } + ] + }, + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "commodo sint sed aliquip", + "paymentSystem": "irure nulla nostrud", + "paymentSystemName": "ipsum fugiat dolore culpa", + "value": 43711674, + "installments": -41805793, + "referenceValue": -5063287, + "cardHolder": "ullamco su", + "cardNumber": "quis sit Excepteur", + "firstDigits": "laborum deserunt minim", + "lastDigits": "qui consectetur pariatur fugiat", + "cvv2": "consectetur et consequat", + "expireMonth": "laboris pariatur laborum", + "expireYear": "irure tempor culpa", + "url": "voluptate ad mollit id", + "giftCardId": "magna ut enim sit", + "giftCardName": "tempor", + "giftCardCaption": "Lor", + "redemptionCode": "in ullamco in ut", + "group": "dolor", + "tid": "co", + "dueDate": "adipisicing non commodo dolore minim", + "connectorResponses": {} + }, + { + "id": "magna", + "paymentSystem": "deserunt officia Excepteur", + "paymentSystemName": "enim aliquip", + "value": 94318468, + "installments": -44139936, + "referenceValue": -1138679, + "cardHolder": "et occaecat amet qui", + "cardNumber": "sit nulla in est Lorem", + "firstDigits": "Ut cillum magna sit", + "lastDigits": "occaecat sunt", + "cvv2": "exercitation dolore", + "expireMonth": "nulla incididunt ullamco voluptate sunt", + "expireYear": "Duis dolor dolore", + "url": "in", + "giftCardId": "ad in commodo sit", + "giftCardName": "eu sit", + "giftCardCaption": "consequat anim et ad", + "redemptionCode": "elit ad", + "group": "consectetur minim culpa", + "tid": "adipisicing reprehenderit do", + "dueDate": "in", + "connectorResponses": {} + } + ] + } + ], + "giftCards": [ + "12345", + "12345" + ], + "giftCardMessages": [ + "Message.", + "Message." + ], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910", + "document": "12345678910" + }, + { + "contactId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910", + "document": "12345678910" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/storage/profile-system/prospects/:prospectId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/storage/profile-system/prospects/:prospectId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/storage/profile-system/prospects/:prospectId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/storage/profile-system/prospects/:prospectId - Schema is valid", function () { + const schema = {"title":"Unmasked prospect information.","type":"object","description":"Unmasked prospect information.","properties":{"id":{"title":"id","type":"string","description":"ID of the prospect."},"document":{"title":"Prospect information.","type":"object","description":"Prospect information.","properties":{"availableAddresses":{"type":"array","description":"Available addresses.","items":{"type":"object","description":"Available address information.","properties":{"disposable":{"type":"boolean","description":"Defines whether the address is deleted after use (`true`) or not (`false`)."},"userId":{"type":"string","description":"User unique identifier."},"addressName":{"type":"string","description":"Address name."},"addressType":{"type":"string","description":"Address type."},"postalCode":{"type":"string","description":"Postal code."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country code."},"street":{"type":"string","description":"Street name."},"number":{"type":"string","description":"Street number."},"complement":{"type":"string","description":"Complement information."},"geoCoordinate":{"type":"array","description":"Array with two strings that represent geocoordinates: first latitude, then longitude.","items":{"type":"string","description":"Geocoordinate."}}}}},"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"contacts":{"type":"array","description":"List of contacts.","items":{"type":"object","description":"Contact information.","properties":{"contactId":{"type":"string","description":"Contact's unique identifier."},"email":{"type":"string","description":"Contact's email address."},"firstName":{"type":"string","description":"Contact's first name."},"lastName":{"type":"string","description":"Contact's last name."},"phone":{"type":"string","description":"Contact's phone number."},"document":{"type":"string","description":"Contact's document."}}}},"invoiceSubject":{"type":"object","description":"Information about the invoice subject.","properties":{"invoiceSubjectId":{"type":"string","description":"Invoice subject ID."},"email":{"type":"string","description":"Invoice subject's email address."},"firstName":{"type":"string","description":"Invoice subject's first name."},"lastName":{"type":"string","description":"Invoice subject's last name."},"phone":{"type":"string","description":"Invoice subject's phone number."}}},"email":{"type":"string","description":"Prospect's email address."},"firstName":{"type":"string","description":"Prospect's first name."},"lastName":{"type":"string","description":"Prospect's last name."},"document":{"type":"string","description":"Prospect's document."},"cellPhone":{"type":"string","description":"Prospect's cellphone number."},"isPJ":{"type":"boolean","description":"Defines if a prospect is corporate (`true`) or not (`false`)."},"customerCode":{"type":"string","description":"Prospect's customer code."}}},"meta":{"title":"Prospect information metadata.","description":"Prospect information metadata.","type":"object","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the prospect version."},"author":{"type":"string","description":"Unique identifier of the user who created the prospect."},"creationDate":{"type":"string","description":"Date when the prospect information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the prospect information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the prospect information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates one or more fields of an existing prospect. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `prospectId` | path | (Required) ID of the prospect as returned by the [Create prospect](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/prospects) endpoint's response, in the `id` field. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "c2cbebba-214e-40b2-b68f-98f862e755d5", + "document": { + "availableAddresses": [ + { + "disposable": true, + "userId": "98478f6b-d025-4f35-a560-dd1ee7a6f26e", + "addressName": "Home", + "addressType": "residential", + "postalCode": "32137", + "city": "Palm Coast", + "country": "USA", + "street": "Fifth St.", + "number": "9538", + "complement": "Apartment 2B", + "geoCoordinate": [ + "string" + ] + } + ], + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [ + "12345" + ], + "transactions": [ + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3", + "paymentSystem": "6", + "paymentSystemName": "Boleto Bancário", + "value": 4450, + "installments": 1, + "referenceValue": 4450, + "cardHolder": null, + "cardNumber": null, + "firstDigits": null, + "lastDigits": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}", + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "bankInvoice", + "tid": null, + "dueDate": "2019-02-02", + "connectorResponses": {} + } + ] + } + ], + "giftCards": [ + "12345" + ], + "giftCardMessages": [ + "Message." + ], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "contacts": [ + { + "contactId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910", + "document": "12345678910" + } + ], + "invoiceSubject": { + "invoiceSubjectId": "0", + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "phone": "12345678910" + }, + "email": "jane@mail.com", + "firstName": "Jane", + "lastName": "Doe", + "document": "5397eefef23741d4976ebdf772cc42e0", + "cellPhone": "12345678910", + "isPJ": false, + "customerCode": "5397eefe-f237-41d4-976e-bdf772cc42e0" + }, + "meta": { + "version": "27112371-a71b-45d6-b3bc-93436a3a0b4f", + "author": "82a2b53d-39be-4f49-bb7c-8971b58cb7dc", + "creationDate": "2022-01-05T15:41:37.5009471+00:00", + "lastUpdateDate": "2022-01-05T15:41:37.5009471+00:00", + "expirationDate": "2022-01-05T15:41:37.5009471+00:00" + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Prospects/folder.yml b/BrunoCollections/VTEX - Profile System/Prospects/folder.yml new file mode 100644 index 0000000000..7debe3c84d --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Prospects/folder.yml @@ -0,0 +1,4 @@ +info: + name: Prospects + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/Create purchase information.yml b/BrunoCollections/VTEX - Profile System/Purchase information/Create purchase information.yml new file mode 100644 index 0000000000..1649ffedd4 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/Create purchase information.yml @@ -0,0 +1,192 @@ +info: + name: Create purchase information + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/purchase-info" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + body: + type: json + data: |- + { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/purchase-info - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/purchase-info - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/purchase-info - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/storage/profile-system/profiles/:profileId/purchase-info - Schema is valid", function () { + const schema = {"title":"Masked purchase information response.","type":"object","description":"Masked purchase information.","properties":{"id":{"title":"id","type":"string","description":"ID of purchase information."},"document":{"title":"Purchase information.","type":"object","description":"Purchase information object.","properties":{"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"clientPreferences":{"type":"object","description":"Client preferences.","properties":{}},"isToSavePersonalData":{"type":"boolean","description":"Defines if personal data will be saved (`true`) or not (`false`)."},"lastUserPurchases":{"type":"array","description":"Array with latest purchases from the client.","items":{"type":"object","description":"Purchase information.","properties":{"creationDate":{"type":"string","description":"Purchase date in the ISO 8601 format."},"orderId":{"type":"string","description":"Unique identifier of the order."},"orderGroup":{"type":"string","description":"Unique identifier of the order group."},"value":{"type":"number","description":"Purchase value."}}}},"lastPurchasesAddressId":{"type":"string","description":"Unique identifier of the client address."}}},"meta":{"title":"Purchase information metadata.","type":"object","description":"Purchase information metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the purchase information version."},"author":{"type":"string","description":"Unique identifier of the user who created the purchase information."},"creationDate":{"type":"string","description":"Date when the purchase information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the purchase information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the purchase information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates purchase information for a given client profile. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "document": { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + }, + "meta": { + "version": "6f693feb-7354-4a44-af96-3693ed282a2e", + "author": "7b95bb3d-b567-48b2-b6fa-48b0b6c7f112", + "creationDate": "2023-10-23T19:22:23.6716469+00:00", + "lastUpdateDate": "2023-10-24T16:18:25.7338837+00:00", + "expirationDate": null + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/Delete purchase information.yml b/BrunoCollections/VTEX - Profile System/Purchase information/Delete purchase information.yml new file mode 100644 index 0000000000..f7523b70cf --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/Delete purchase information.yml @@ -0,0 +1,75 @@ +info: + name: Delete purchase information + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/purchase-info" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/storage/profile-system/profiles/:profileId/purchase-info - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/storage/profile-system/profiles/:profileId/purchase-info - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes purchase informaiton by `profileId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/Get purchase information.yml b/BrunoCollections/VTEX - Profile System/Purchase information/Get purchase information.yml new file mode 100644 index 0000000000..e31d778110 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/Get purchase information.yml @@ -0,0 +1,153 @@ +info: + name: Get purchase information + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/purchase-info" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info - Schema is valid", function () { + const schema = {"type":"array","items":{"title":"Masked purchase information response.","type":"object","description":"Masked purchase information.","properties":{"id":{"title":"id","type":"string","description":"ID of purchase information."},"document":{"title":"Purchase information.","type":"object","description":"Purchase information object.","properties":{"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"clientPreferences":{"type":"object","description":"Client preferences.","properties":{}},"isToSavePersonalData":{"type":"boolean","description":"Defines if personal data will be saved (`true`) or not (`false`)."},"lastUserPurchases":{"type":"array","description":"Array with latest purchases from the client.","items":{"type":"object","description":"Purchase information.","properties":{"creationDate":{"type":"string","description":"Purchase date in the ISO 8601 format."},"orderId":{"type":"string","description":"Unique identifier of the order."},"orderGroup":{"type":"string","description":"Unique identifier of the order group."},"value":{"type":"number","description":"Purchase value."}}}},"lastPurchasesAddressId":{"type":"string","description":"Unique identifier of the client address."}}},"meta":{"title":"Purchase information metadata.","type":"object","description":"Purchase information metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the purchase information version."},"author":{"type":"string","description":"Unique identifier of the user who created the purchase information."},"creationDate":{"type":"string","description":"Date when the purchase information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the purchase information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the purchase information expires in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves purchase information of a given client, by its `profileId`. + + + > For security and privacy reasons, this request returns masked data. For unmasked information, see [Get unmasked purchase information](https://developers.vtex.com/docs/api-reference/profile-system#get-/api/storage/profile-system/profiles/-profileId-/purchase-info/unmask). + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "document": { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443333", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + }, + "meta": { + "version": "3117771f-8ea6-4297-a487-07e9b5497bc5", + "author": "6fd337ba-1e6c-4d3e-aceb-1d8993432193", + "creationDate": "2023-10-23T19:22:23.6716469+00:00", + "lastUpdateDate": "2023-10-23T19:22:25.5466348+00:00", + "expirationDate": null + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/Get unmasked purchase information.yml b/BrunoCollections/VTEX - Profile System/Purchase information/Get unmasked purchase information.yml new file mode 100644 index 0000000000..e6dcd1916e --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/Get unmasked purchase information.yml @@ -0,0 +1,149 @@ +info: + name: Get unmasked purchase information + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/purchase-info/unmask?reason=data-validation" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info/unmask - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info/unmask - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info/unmask - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/profiles/:profileId/purchase-info/unmask - Schema is valid", function () { + const schema = {"type":"array","description":"List of purchase information.","items":{"title":"Masked purchase information response.","type":"object","description":"Masked purchase information.","properties":{"id":{"title":"id","type":"string","description":"ID of purchase information."},"document":{"title":"Purchase information.","type":"object","description":"Purchase information object.","properties":{"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"clientPreferences":{"type":"object","description":"Client preferences.","properties":{}},"isToSavePersonalData":{"type":"boolean","description":"Defines if personal data will be saved (`true`) or not (`false`)."},"lastUserPurchases":{"type":"array","description":"Array with latest purchases from the client.","items":{"type":"object","description":"Purchase information.","properties":{"creationDate":{"type":"string","description":"Purchase date in the ISO 8601 format."},"orderId":{"type":"string","description":"Unique identifier of the order."},"orderGroup":{"type":"string","description":"Unique identifier of the order group."},"value":{"type":"number","description":"Purchase value."}}}},"lastPurchasesAddressId":{"type":"string","description":"Unique identifier of the client address."}}},"meta":{"title":"Purchase information metadata.","type":"object","description":"Purchase information metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the purchase information version."},"author":{"type":"string","description":"Unique identifier of the user who created the purchase information."},"creationDate":{"type":"string","description":"Date when the purchase information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the purchase information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the purchase information expires in ISO 8601 format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves unmasked purchase information of a given client, by its `profileId`. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `reason` | query | (Required) Reason for requesting unmasked data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "document": { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443333", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + }, + "meta": { + "version": "cea5fcd2-7444-492d-9d63-1c05713e6776", + "author": "7b95bb3d-b567-48b2-b6fa-48b0b6c7f112", + "creationDate": "2023-10-24T16:22:55.0252384+00:00", + "lastUpdateDate": "2023-10-24T16:22:55.0252384+00:00", + "expirationDate": null + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/Update purchase information.yml b/BrunoCollections/VTEX - Profile System/Purchase information/Update purchase information.yml new file mode 100644 index 0000000000..267e30ad83 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/Update purchase information.yml @@ -0,0 +1,192 @@ +info: + name: Update purchase information + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/storage/profile-system/profiles/:profileId/purchase-info" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: alternativeKey + value: email + type: query + disabled: true + - name: profileId + value: 70caf394-8534-447e-a0ca-1803c669c771 + type: path + body: + type: json + data: |- + { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/purchase-info - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/purchase-info - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/purchase-info - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/storage/profile-system/profiles/:profileId/purchase-info - Schema is valid", function () { + const schema = {"title":"Masked purchase information response.","type":"object","description":"Masked purchase information.","properties":{"id":{"title":"id","type":"string","description":"ID of purchase information."},"document":{"title":"Purchase information.","type":"object","description":"Purchase information object.","properties":{"paymentData":{"title":"paymentData","type":"object","description":"Payment data.","properties":{"availableAccounts":{"type":"array","description":"List of available payment accounts.","items":{"type":"object","description":"Information about an available payment account.","properties":{"accountId":{"type":"string","description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system code."},"paymentSystemName":{"type":"string","description":"Payment system name."},"cardNumber":{"type":"string","description":"Masked card number."},"bin":{"type":"string","description":"Card bin."},"availableAddresses":{"type":"array","description":"List of available addresses.","items":{"type":"string","description":"Available address ID."}},"expirationDate":{"type":"string","description":"Card expiration date, in `MM/YYYY` format."},"isExpired":{"type":"boolean","description":"Defines if the card is expired (`true`) or not (`false`)."},"accountStatus":{"type":["string","null"],"description":"Account status."}}}},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token."}},"transactions":{"type":["array","null"],"description":"List of transactions.","items":{"type":"object","description":"Transaction information.","required":["isActive","transactionId","merchantName","payments"],"properties":{"isActive":{"type":"boolean","description":"Indicates whether the transaction is active (`true`) or not (`false`)."},"transactionId":{"type":"string","description":"Transaction ID."},"merchantName":{"type":"string","description":"Merchant name."},"payments":{"type":"array","description":"List of payments information.","items":{"title":"Payment","required":["id","paymentSystem","paymentSystemName","value","installments","referenceValue","cardHolder","cardNumber","firstDigits","lastDigits","cvv2","expireMonth","expireYear","url","giftCardId","giftCardName","giftCardCaption","redemptionCode","group","tid","dueDate","connectorResponses"],"type":"object","description":"Payment information.","properties":{"id":{"type":"string","description":"Payment ID."},"paymentSystem":{"type":"string","description":"Payment system."},"paymentSystemName":{"type":"string","description":"Payment system name."},"value":{"type":"integer","format":"int32","description":"Payment value in cents."},"installments":{"type":"integer","format":"int32","description":"Payment installments."},"referenceValue":{"type":"integer","format":"int32","description":"Reference value for interest calculation in cents."},"cardHolder":{"type":["string","null"],"description":"Card holder."},"cardNumber":{"type":["string","null"],"description":"Card number."},"firstDigits":{"type":["string","null"],"description":"Card first digits."},"lastDigits":{"type":["string","null"],"description":"Card last digits."},"cvv2":{"type":["string","null"],"description":"Card verification code."},"expireMonth":{"type":["string","null"],"description":"Card expiration month."},"expireYear":{"type":["string","null"],"description":"Card expiration year."},"url":{"type":"string","description":"Payment URL."},"giftCardId":{"type":["string","null"],"description":"Gift card ID."},"giftCardName":{"type":["string","null"],"description":"Gift card name."},"giftCardCaption":{"type":["string","null"],"description":"Gift card caption."},"redemptionCode":{"type":["string","null"],"description":"Redemption code."},"group":{"type":"string","description":"Payment group."},"tid":{"type":["string","null"],"description":"Payment TID."},"dueDate":{"type":"string","description":"Due date."},"connectorResponses":{"type":"object","description":"Connector responses."}}}}}}},"giftCards":{"type":"array","description":"Gift card IDs.","items":{"type":"string","description":"Gift card ID."}},"giftCardMessages":{"type":"array","description":"Gift card messages.","items":{"type":"string","description":"Gift card message."}},"numberOfPaymentErrors":{"type":"number","description":"Amount of payment errors."},"numberOfDeniedTransactions":{"type":"number","description":"Amount of denied transactions."},"lastDeniedTransaction":{"type":["string","null"],"description":"Last denied transaction."}}},"clientPreferences":{"type":"object","description":"Client preferences.","properties":{}},"isToSavePersonalData":{"type":"boolean","description":"Defines if personal data will be saved (`true`) or not (`false`)."},"lastUserPurchases":{"type":"array","description":"Array with latest purchases from the client.","items":{"type":"object","description":"Purchase information.","properties":{"creationDate":{"type":"string","description":"Purchase date in the ISO 8601 format."},"orderId":{"type":"string","description":"Unique identifier of the order."},"orderGroup":{"type":"string","description":"Unique identifier of the order group."},"value":{"type":"number","description":"Purchase value."}}}},"lastPurchasesAddressId":{"type":"string","description":"Unique identifier of the client address."}}},"meta":{"title":"Purchase information metadata.","type":"object","description":"Purchase information metadata.","required":["version","author","creationDate","lastUpdateDate"],"properties":{"version":{"type":"string","description":"Unique identifier of the purchase information version."},"author":{"type":"string","description":"Unique identifier of the user who created the purchase information."},"creationDate":{"type":"string","description":"Date when the purchase information was created in ISO 8601 format."},"lastUpdateDate":{"type":"string","description":"Date when the purchase information was last updated in ISO 8601 format."},"expirationDate":{"type":["string","null"],"description":"Date when the purchase information expires in ISO 8601 format."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates one or more fields of existing purchase information for a given client profile. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `profileId` | path | (Required) There are two value options for this field: 1. ID of the client's profile, as in the `id` field returned by the [Create profile](https://developers.vtex.com/docs/api-reference/profile-system#post-/api/storage/profile-system/profiles) endpoint. 2. The value of an alternative key (`email` or `document`). When using this option, the `alternativeKey` query parameter is required, to inform which key is being used. | + | `alternativeKey` | query | When using an alternative key as `profileId` value, fill this parameter with the key you wish to use as `profileId`. There are two possible values: `email` and `document`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "document": { + "paymentData": { + "availableAccounts": [ + { + "accountId": "D09F5E3F01054C959CFC4CB357961ADE", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************1111", + "bin": "44443334", + "availableAddresses": [ + "db267dcc53c14fb2b9a985532dd287bc" + ], + "expirationDate": "01/2032", + "isExpired": false, + "accountStatus": null + } + ], + "availableTokens": [], + "transactions": null, + "giftCards": [], + "giftCardMessages": [], + "numberOfPaymentErrors": 0, + "numberOfDeniedTransactions": 0, + "lastDeniedTransaction": null + }, + "clientPreferences": { + "userId": "d9b946b8-9524-4b2d-96ec-b35d0625c0a7", + "localeDefault": "pt-BR", + "isNewsletterOptIn": true + }, + "isToSavePersonalData": true, + "lastUserPurchases": [ + { + "creationDate": "2023-10-23T19:22:12.8989883Z", + "orderId": "1370990595750-01", + "orderGroup": "1370990595750", + "value": 3498 + } + ], + "lastPurchasesAddressId": "db267dcc53c14fb2b9a985532dd287bc" + }, + "meta": { + "version": "6f693feb-7354-4a44-af96-3693ed282a2e", + "author": "7b95bb3d-b567-48b2-b6fa-48b0b6c7f112", + "creationDate": "2023-10-23T19:22:23.6716469+00:00", + "lastUpdateDate": "2023-10-24T16:18:25.7338837+00:00", + "expirationDate": null + } + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Purchase information/folder.yml b/BrunoCollections/VTEX - Profile System/Purchase information/folder.yml new file mode 100644 index 0000000000..1679039b5e --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Purchase information/folder.yml @@ -0,0 +1,4 @@ +info: + name: Purchase information + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Profile System/Schemas/Create or delete custom fields.yml b/BrunoCollections/VTEX - Profile System/Schemas/Create or delete custom fields.yml new file mode 100644 index 0000000000..70b60679c2 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Schemas/Create or delete custom fields.yml @@ -0,0 +1,84 @@ +info: + name: Create or delete custom fields + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/storage/profile-system/schemas/profileSystem/custom" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "customField1": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "customField2": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/storage/profile-system/schemas/profileSystem/custom - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or deletes custom fields in the profile schema. To create custom fields, include a request body. To delete all custom fields, pass an empty JSON. + + + > Each account has one profile schema. Updating it with this request will substitute the previous version. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Profile System/Schemas/Get custom fields.yml b/BrunoCollections/VTEX - Profile System/Schemas/Get custom fields.yml new file mode 100644 index 0000000000..53a9430585 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Schemas/Get custom fields.yml @@ -0,0 +1,119 @@ +info: + name: Get custom fields + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/schemas/profileSystem/custom" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem/custom - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem/custom - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem/custom - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem/custom - Schema is valid", function () { + const schema = {"title":"Schema","type":"object","description":"Schema information.","required":["title","type","description","required","properties"],"properties":{"title":{"type":"string","description":"Schema title."},"type":{"type":"string","description":"Schema type."},"description":{"type":"string","description":"Schema's human readable description."},"required":{"type":"array","description":"Schema required fields.","items":{"type":"string","description":"Key of a field that is required in the schema."}},"properties":{"type":"object","description":"Object describing each field in your desired schema. In this object, each property is a new object, describing the field according to: `type` (string); `sensitive` (boolean); `pii` (boolean) and `items.type` (if field is array).","properties":{"additionalProperties":{"type":"object","description":"Schema of any given field described in the `properties` field.","required":["type","sensitive","pii"],"properties":{"type":{"type":"string","description":"Schema property type."},"sensitive":{"type":"boolean","description":"Indicates whether the property is sensitive data. Set to `true` if `pii` is `true` and set to `false` if `pii` is `false`."},"pii":{"type":"boolean","description":"Indicates whether the property is Personal Identifiable Information (PII)."},"items":{"type":"object","description":"Object containing the type of the items if the field is an array. Typically, arrays will contain strings and will be used for fields such as `email`.","properties":{"type":{"type":"string","description":"Field type."}}}}}}},"documentTTL":{"type":"integer","description":"Document time to live, in days. After this many days from its creation or update, any document cerated from this schema will be deleted."},"version":{"type":"integer","description":"Schema version."},"v-indexed":{"type":"array","description":"List of fields to be indexed.","items":{"type":"string","description":"Field to be indexed."}},"v-unique":{"type":"array","description":"List of fields that must be unique.","items":{"type":"string","description":"Field that must be unique."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all custom fields in the profile schema. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "title": "Client profile schema.", + "type": "object", + "description": "This schema describes a b2c customer profile.", + "required": [ + "firstName", + "lastName", + "email", + "document", + "documentType" + ], + "properties": { + "additionalProperties": { + "type": "string", + "sensitive": true, + "pii": true, + "items": { + "type": "string" + } + } + }, + "documentTTL": 1825, + "version": 1, + "v-indexed": [ + "email", + "document" + ], + "v-unique": [ + "email", + "document" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Schemas/Get full schema.yml b/BrunoCollections/VTEX - Profile System/Schemas/Get full schema.yml new file mode 100644 index 0000000000..4f8f817020 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Schemas/Get full schema.yml @@ -0,0 +1,231 @@ +info: + name: Get full schema + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/storage/profile-system/schemas/profileSystem" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/storage/profile-system/schemas/profileSystem - Schema is valid", function () { + const schema = {"title":"Schema","type":"object","description":"Schema information.","required":["title","type","description","required","properties"],"properties":{"title":{"type":"string","description":"Schema title."},"type":{"type":"string","description":"Schema type."},"description":{"type":"string","description":"Schema's human readable description."},"required":{"type":"array","description":"Schema required fields.","items":{"type":"string","description":"Key of a field that is required in the schema."}},"properties":{"type":"object","description":"Object describing each field in your desired schema. In this object, each property is a new object, describing the field according to: `type` (string); `sensitive` (boolean); `pii` (boolean) and `items.type` (if field is array).","properties":{"additionalProperties":{"type":"object","description":"Schema of any given field described in the `properties` field.","required":["type","sensitive","pii"],"properties":{"type":{"type":"string","description":"Schema property type."},"sensitive":{"type":"boolean","description":"Indicates whether the property is sensitive data. Set to `true` if `pii` is `true` and set to `false` if `pii` is `false`."},"pii":{"type":"boolean","description":"Indicates whether the property is Personal Identifiable Information (PII)."},"items":{"type":"object","description":"Object containing the type of the items if the field is an array. Typically, arrays will contain strings and will be used for fields such as `email`.","properties":{"type":{"type":"string","description":"Field type."}}}}}}},"documentTTL":{"type":"integer","description":"Document time to live, in days. After this many days from its creation or update, any document cerated from this schema will be deleted."},"version":{"type":"integer","description":"Schema version."},"v-indexed":{"type":"array","description":"List of fields to be indexed.","items":{"type":"string","description":"Field to be indexed."}},"v-unique":{"type":"array","description":"List of fields that must be unique.","items":{"type":"string","description":"Field that must be unique."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the full profile schema, including custom fields. + + + Learn more about the [Profile System](https://developers.vtex.com/vtex-rest-api/docs/profile-system) and its other API endpoints. + + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Profile System | Documents | **Get Item** | + | Profile System | Documents | **Save and Update Item** | + | Profile System | Documents | **Delete Item** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "title": "Profile System Profile Schema", + "description": "Schema used for integration testing with Checkout", + "type": "object", + "properties": { + "firstName": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "lastName": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "email": { + "type": "string", + "sensitive": true, + "pii": true + }, + "corporateName": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + }, + "fancyName": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + }, + "document": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "businessDocument": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + }, + "documentType": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + }, + "homePhone": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "cellPhone": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "businessPhone": { + "type": [ + "string", + "null" + ], + "sensitive": false, + "pii": false + }, + "gender": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": false + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + }, + "priceTable": { + "type": "string", + "sensitive": false, + "pii": false + }, + "tags": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string", + "maxLength": 50 + }, + "sensitive": false, + "pii": false + }, + "customerCode": { + "type": [ + "string", + "null" + ], + "sensitive": true, + "pii": true + } + }, + "required": [ + "email" + ], + "additionalProperties": true, + "v-indexed": [ + "email", + "document" + ], + "v-unique": [ + "email" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Profile System/Schemas/folder.yml b/BrunoCollections/VTEX - Profile System/Schemas/folder.yml new file mode 100644 index 0000000000..e19dc7719f --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/Schemas/folder.yml @@ -0,0 +1,4 @@ +info: + name: Schemas + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Profile System/environments/VTEX.yml b/BrunoCollections/VTEX - Profile System/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Profile System/opencollection.yml b/BrunoCollections/VTEX - Profile System/opencollection.yml new file mode 100644 index 0000000000..c94b6630c8 --- /dev/null +++ b/BrunoCollections/VTEX - Profile System/opencollection.yml @@ -0,0 +1,28 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Profile System + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >⚠️ The Profile System is only compatible with stores using the PII data architecture from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus), which is in closed beta phase, only available in select regions. + > + > This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + The **Profile System** is VTEX's single source of truth regarding shoppers' profile data for stores using the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) from [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus). Other modules, such as **Checkout** and **Order Management**, can request data from the **Profile System** when necessary. Learn more at the [Profile System](https://developers.vtex.com/docs/guides/profile-system) guide. + + >⚠️ Data stored in the Profile System is not related to documents saved in [Master Data v1](https://developers.vtex.com/docs/api-reference/masterdata-api) or [Master Data v2](https://developers.vtex.com/docs/api-reference/master-data-api-v2). The API endpoints and features described in this article only apply to documents registered in the new Profile System designed to handle PII data architecture. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Archive a coupon batch.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Archive a coupon batch.yml new file mode 100644 index 0000000000..75a78f275a --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Archive a coupon batch.yml @@ -0,0 +1,92 @@ +info: + name: Archive a coupon batch + type: http + seq: 6 + +http: + method: PUT + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/:groupingKey/archive" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: promo + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/archive - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/archive - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/archive - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/archive - Schema is valid", function () { + const schema = {"type":"number","description":"Number of archived coupons."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Archives a coupon batch and its respective codes. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1 + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Create coupon batches.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Create coupon batches.yml new file mode 100644 index 0000000000..59c2b68b46 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Create coupon batches.yml @@ -0,0 +1,110 @@ +info: + name: Create coupon batches + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + [ + { + "couponConfiguration": { + "utmSource": "fb", + "utmCampaign": "blackfriday", + "couponCode": "bf22", + "expirationIntervalPerUse": "00:00:00", + "maxItemsPerClient": 5, + "maxUsage": 5 + }, + "quantity": "5" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/v2/pvt/coupon/group - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/v2/pvt/coupon/group - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/v2/pvt/coupon/group - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/v2/pvt/coupon/group - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"string","description":"Coupon code."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates one or more coupon batches. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "bf22-Y0RGX5VRCQU5HRQ", + "bf22-XZC6SP9WYR1OINC", + "bf22-DOLD2FF2NNHUGZU", + "bf22-1E5WFBGOS2MAY9T", + "bf22-CXK6H29W9K1PI2B" + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Edit coupon batch configuration.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Edit coupon batch configuration.yml new file mode 100644 index 0000000000..fec5ac2856 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Edit coupon batch configuration.yml @@ -0,0 +1,108 @@ +info: + name: Edit coupon batch configuration + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/:groupingKey" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: promo + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "utmSource": "source", + "isArchived": false, + "maxItemsPerClient": 0, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 4 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Schema is valid", function () { + const schema = {"type":"array","description":"Array with the coupon batch codes.","items":{"type":"string","description":"Coupon code."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes information from a specific coupon batch configuration based on its `groupingKey`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "12130984756-bbbsqz5lxivwvx7", + "12130984756-31xj4idmfbmh9am", + "12130984756-pxpdsou99n3bmsn", + "12130984756-juzl9asvq8z4sjn", + "12130984756-gyo7a2v0s9v7s07" + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get archived coupons.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get archived coupons.yml new file mode 100644 index 0000000000..9609462115 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get archived coupons.yml @@ -0,0 +1,112 @@ +info: + name: Get archived coupons + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/archived" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/archived - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/archived - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/archived - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/archived - Schema is valid", function () { + const schema = {"description":"List of coupons.","type":"object","properties":{"items":{"title":"items","description":"Array of objects.","type":"array","items":{"description":"Object containing each coupon batch and its configuration information.","type":"object","properties":{"grouping":{"title":"grouping","description":"Coupon batch.","type":"object","properties":{"key":{"title":"key","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"},"amount":{"title":"amount","description":"Amount of codes in the coupon batch.","type":"number"}}},"configuration":{"title":"configuration","description":"Object containing the coupon's properties.","type":"object","properties":{"lastModifiedUtc":{"title":"lastModifiedUtc","description":"Date when the coupon was modified for the last time, in the UTC format.","type":"string"},"utmSource":{"title":"utmSource","description":"UTM source related to the coupon, which indicates the source of the traffic, that is, from which site, advertiser, or publication the user came from.","type":"string"},"utmCampaign":{"title":"utmCampaign","description":"UTM campaign related to the coupon, which indicates the campaign that defines a particular marketing context.","type":"string"},"couponCode":{"title":"couponCode","description":"Single coupon code.","type":"string"},"isArchived":{"title":"isArchived","description":"Determines whether the coupon is archived (`true`) or not (`false`).","type":"boolean"},"maxItemsPerClient":{"title":"maxItemsPerClient","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of Coupons. When enabled, it determines the maximum amount of products to which the coupon can be applied. The defined quantity is valid for one or more purchases by the same customer.","type":"number"},"expirationIntervalPerUse":{"title":"expirationIntervalPerUse","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of the Coupons module. When enabled, it determines how many days after purchase the coupon will be available for use again.","type":"string"},"maxUsage":{"title":"maxUsage","description":"The maximum number of times the coupon can be used, if the coupon has limited usage.","type":"number"},"groupingKey":{"title":"groupingKey","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of all archived coupons. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "grouping": { + "key": "rewardsprogram", + "amount": 1000 + }, + "configuration": { + "lastModifiedUtc": "2022-04-20T20:07:03.5066878Z", + "utmSource": "fb", + "utmCampaign": "rewards", + "isArchived": true, + "maxItemsPerClient": 0, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 3, + "groupingKey": "rewardsprogram" + } + } + ], + "pagination": { + "page": 0, + "pageSize": 10, + "total": 10 + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch codes.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch codes.yml new file mode 100644 index 0000000000..dc6ee1eb9a --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch codes.yml @@ -0,0 +1,98 @@ +info: + name: Get coupon batch codes + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/:groupingKey/codes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: promo + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey/codes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey/codes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey/codes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey/codes - Schema is valid", function () { + const schema = {"type":"array","description":"Array with the coupon batch codes.","items":{"type":"string","description":"Coupon code."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific coupon batch's list of codes. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "12130984756-bbbsqz5lxivwvx7", + "12130984756-31xj4idmfbmh9am", + "12130984756-pxpdsou99n3bmsn", + "12130984756-juzl9asvq8z4sjn", + "12130984756-gyo7a2v0s9v7s07" + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch information.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch information.yml new file mode 100644 index 0000000000..d559798ae5 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupon batch information.yml @@ -0,0 +1,107 @@ +info: + name: Get coupon batch information + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/:groupingKey" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: promo + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/group/:groupingKey - Schema is valid", function () { + const schema = {"description":"Coupon batch information.","type":"object","properties":{"configuration":{"title":"configuration","description":"Object containing the coupon's properties.","type":"object","properties":{"lastModifiedUtc":{"title":"lastModifiedUtc","description":"Date when the coupon was modified for the last time, in the UTC format.","type":"string"},"utmSource":{"title":"utmSource","description":"UTM source related to the coupon, which indicates the source of the traffic, that is, from which site, advertiser, or publication the user came from.","type":"string"},"utmCampaign":{"title":"utmCampaign","description":"UTM campaign related to the coupon, which indicates the campaign that defines a particular marketing context.","type":"string"},"isArchived":{"title":"isArchived","description":"Determines whether the coupon is archived (`true`) or not (`false`).","type":"boolean"},"maxItemsPerClient":{"title":"maxItemsPerClient","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of Coupons. When enabled, it determines the maximum amount of products to which the coupon can be applied. The defined quantity is valid for one or more purchases by the same customer.","type":"number"},"expirationIntervalPerUse":{"title":"expirationIntervalPerUse","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of the Coupons module. When enabled, it determines how many days after purchase the coupon will be available for use again.","type":"string"},"maxUsage":{"title":"maxUsage","description":"The maximum number of times the coupon can be used, if the coupon has limited usage.","type":"number"},"groupingKey":{"title":"groupingKey","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"}}},"grouping":{"title":"grouping","description":"Coupon batch.","type":"object","properties":{"key":{"title":"key","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"},"amount":{"title":"amount","description":"Amount of codes in the coupon batch.","type":"number"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information from a specific coupon batch based on its `groupingKey`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "configuration": { + "lastModifiedUtc": "2022-02-15T19:18:28.6409703Z", + "utmSource": "fb", + "utmCampaign": "rewards", + "isArchived": false, + "maxItemsPerClient": 13, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 11, + "groupingKey": "12130984756" + }, + "grouping": { + "key": "12130984756", + "amount": 5 + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupons.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupons.yml new file mode 100644 index 0000000000..694866f9cf --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get coupons.yml @@ -0,0 +1,112 @@ +info: + name: Get coupons + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon - Schema is valid", function () { + const schema = {"description":"List of coupons.","type":"object","properties":{"items":{"title":"items","description":"Array of objects.","type":"array","items":{"description":"Object containing each coupon batch and its configuration information.","type":"object","properties":{"grouping":{"title":"grouping","description":"Coupon batch.","type":"object","properties":{"key":{"title":"key","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"},"amount":{"title":"amount","description":"Amount of codes in the coupon batch.","type":"number"}}},"configuration":{"title":"configuration","description":"Object containing the coupon's properties.","type":"object","properties":{"lastModifiedUtc":{"title":"lastModifiedUtc","description":"Date when the coupon was modified for the last time, in the UTC format.","type":"string"},"utmSource":{"title":"utmSource","description":"UTM source related to the coupon, which indicates the source of the traffic, that is, from which site, advertiser, or publication the user came from.","type":"string"},"utmCampaign":{"title":"utmCampaign","description":"UTM campaign related to the coupon, which indicates the campaign that defines a particular marketing context.","type":"string"},"couponCode":{"title":"couponCode","description":"Single coupon code.","type":"string"},"isArchived":{"title":"isArchived","description":"Determines whether the coupon is archived (`true`) or not (`false`).","type":"boolean"},"maxItemsPerClient":{"title":"maxItemsPerClient","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of Coupons. When enabled, it determines the maximum amount of products to which the coupon can be applied. The defined quantity is valid for one or more purchases by the same customer.","type":"number"},"expirationIntervalPerUse":{"title":"expirationIntervalPerUse","description":"This option is non-editable and visible only for existing coupons configured with this limitation in previous versions of the Coupons module. When enabled, it determines how many days after purchase the coupon will be available for use again.","type":"string"},"maxUsage":{"title":"maxUsage","description":"The maximum number of times the coupon can be used, if the coupon has limited usage.","type":"number"},"groupingKey":{"title":"groupingKey","description":"Coupon grouping key, which is the prefix for the coupon batch's generated codes.","type":"string"}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of all active coupons. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "grouping": { + "key": "rewardsprogram", + "amount": 1000 + }, + "configuration": { + "lastModifiedUtc": "2022-04-20T20:07:03.5066878Z", + "utmSource": "fb", + "utmCampaign": "rewards", + "isArchived": false, + "maxItemsPerClient": 0, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 3, + "groupingKey": "rewardsprogram" + } + } + ], + "pagination": { + "page": 0, + "pageSize": 10, + "total": 10 + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a coupon batch.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a coupon batch.yml new file mode 100644 index 0000000000..9c69b45a41 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a coupon batch.yml @@ -0,0 +1,92 @@ +info: + name: Get usage count for a coupon batch + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/usage-count/group/:groupingKey" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: rewardsprogram + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/group/:groupingKey - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/group/:groupingKey - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/group/:groupingKey - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/group/:groupingKey - Schema is valid", function () { + const schema = {"type":"number","description":"Number of times the coupon batch was used to place orders."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the number of times a coupon batch was used, based on its `groupingKey`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1 + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a single coupon.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a single coupon.yml new file mode 100644 index 0000000000..86e1c714b0 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Get usage count for a single coupon.yml @@ -0,0 +1,92 @@ +info: + name: Get usage count for a single coupon + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/usage-count/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: blackfriday10 + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/v2/pvt/coupon/usage-count/:couponCode - Schema is valid", function () { + const schema = {"type":"number","description":"Number of times the single coupon was used to place orders."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the number of times a specific single coupon was used, based on its `couponCode`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Single coupon code. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1 + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Unarchive a coupon batch.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Unarchive a coupon batch.yml new file mode 100644 index 0000000000..2e62e2c394 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/Unarchive a coupon batch.yml @@ -0,0 +1,92 @@ +info: + name: Unarchive a coupon batch + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/rnb/v2/pvt/coupon/group/:groupingKey/unarchive" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: groupingKey + value: promo + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/unarchive - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/unarchive - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/unarchive - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/rnb/v2/pvt/coupon/group/:groupingKey/unarchive - Schema is valid", function () { + const schema = {"type":"number","description":"Number of unarchived coupons."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Unarchives a coupon batch and its respective codes. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupingKey` | path | (Required) Coupon grouping key, which is the prefix for the coupon batch's generated codes. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL. | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1 + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/folder.yml new file mode 100644 index 0000000000..5b16ed15cc --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/Coupons/folder.yml @@ -0,0 +1,4 @@ +info: + name: Coupons + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/environments/VTEX.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Promotions & Taxes API - v2/opencollection.yml b/BrunoCollections/VTEX - Promotions & Taxes API - v2/opencollection.yml new file mode 100644 index 0000000000..5e38862b6c --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API - v2/opencollection.yml @@ -0,0 +1,47 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Promotions & Taxes API - v2 + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Check the new [Promotions onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/promotions-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Promotions and is organized by focusing on the developer's journey. + + The Promotions & Taxes API allows you to manage and retrieve all coupons from your VTEX store. + + ## Index + + ### Coupons + - `GET` [Get coupons](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon) + - `GET` [Get archived coupons](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon/group/archived) + - `GET` [Get coupon batch information](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon/group/-groupingKey-) + - `PUT` [Edit coupon batch configuration](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#put-/api/rnb/v2/pvt/coupon/group/-groupingKey-) + - `GET` [Get coupon batch codes](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon/group/-groupingKey-/codes) + - `PUT` [Archive a coupon batch](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#put-/api/rnb/v2/pvt/coupon/group/-groupingKey-/archive) + - `POST` [Create coupon batches](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#post-/api/rnb/v2/pvt/coupon/group) + - `PUT` [Unarchive a coupon batch](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#put-/api/rnb/v2/pvt/coupon/group/-groupingKey-/unarchive) + - `GET` [Get usage count for a single coupon](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon/usage-count/-couponCode-) + - `GET` [Get usage count for a coupon batch](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api-v2#get-/api/rnb/v2/pvt/coupon/usage-count/group/-groupingKey-) + + ## Common parameters in the documentation + + | Parameter name | Description | + |---------------------------|-----------------------------------------------------------------------------------------| + | `{{accountName}}` | Store account name. | + | `{{environment}}` | The environment that will be called. | + | `{{X-VTEX-API-AppKey}}` | Located in the headers of the requests, user authentication key. | + | `{{X-VTEX-API-AppToken}}` | Located in the headers of the requests, authentication password. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/Calculate discounts and taxes bundles.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/Calculate discounts and taxes bundles.yml new file mode 100644 index 0000000000..930b841900 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/Calculate discounts and taxes bundles.yml @@ -0,0 +1,78 @@ +info: + name: Calculate discounts and taxes bundles + type: http + seq: 1 + +http: + method: POST + url: http://example.com/.{{environment}}.com.br/api/rnb/pub/bundles + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "isShoppingCart": true, + "origin": "Marketplace", + "salesChannel": "1", + "profileId": "aa", + "items": [ + { + "index": 0, + "id": "160", + "quantity": 3, + "isGift": false, + "measurementUnit": "un", + "unitMultiplier": 1, + "priceTags": [], + "params": [ + { + "name": "Seller@CatalogSystem", + "value": "1" + }, + { + "name": "product@CatalogSystem", + "value": "94" + } + ], + "priceSheet": [], + "logisticsInfos": [], + "sellerId": "1", + "productSpecifications": [] + } + ], + "params": [ + { + "name": "product@CatalogSystem", + "value": "2662" + }, + { + "name": "couponCode@Marketing", + "value": "coupon" + } + ] + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Calculate discounts and taxes + + ## Permissions + + This endpoint is usually used internally for backend services and does not require user [permissions]((https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3)). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/folder.yml new file mode 100644 index 0000000000..6512be7389 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Bundles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Bundles + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Create campaign audience.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Create campaign audience.yml new file mode 100644 index 0000000000..bdec62a45d --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Create campaign audience.yml @@ -0,0 +1,676 @@ +info: + name: Create campaign audience + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/campaignConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "beginDateUtc": "2020-05-01T21:30:00Z", + "endDateUtc": "2020-05-02T01:30:00Z", + "id": "dd270d06-1ed1-47fc-b04e-a2431121b5a4", + "name": "Interna", + "isActive": true, + "isAndOperator": true, + "isArchived": false, + "lastModified": { + "dateUtc": "2020-05-01T21:22:01.807398Z", + "user": "email@email.com" + }, + "targetConfigurations": [ + { + "featured": false, + "id": "77ae1e4c-a216-4b15-a4a3-ae64ec298988", + "name": "Social Sellers", + "daysAgoOfPurchases": 0, + "origin": "Marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [ + "Principal", + "Principal" + ], + "areSalesChannelIdsExclusive": false, + "marketingTags": [ + "MKT1", + "MKT1" + ], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [ + { + "id": "2", + "name": "Visa (2)" + }, + { + "id": "2", + "name": "Visa (2)" + } + ], + "stores": [ + "store", + "store" + ], + "campaigns": [ + "campaign", + "campaign" + ], + "storesAreInclusive": false, + "categories": [ + { + "id": "1", + "name": "Vinhos Tintos (1)" + }, + { + "id": "1", + "name": "Vinhos Tintos (1)" + } + ], + "categoriesAreInclusive": true, + "brands": [ + { + "id": "1", + "name": "Brand (1)" + }, + { + "id": "1", + "name": "Brand (1)" + } + ], + "brandsAreInclusive": true, + "products": [ + { + "id": "1", + "name": "Vinho (1)" + }, + { + "id": "1", + "name": "Vinho (1)" + } + ], + "productsAreInclusive": true, + "skus": [ + { + "id": "1", + "name": "Vinho tinto (1)" + }, + { + "id": "1", + "name": "Vinho tinto (1)" + } + ], + "skusAreInclusive": true, + "collections1BuyTogether": [ + { + "id": "157", + "name": "Inverno (157)" + }, + { + "id": "157", + "name": "Inverno (157)" + } + ], + "collections2BuyTogether": [ + { + "id": "157", + "name": "Inverno (157)" + }, + { + "id": "157", + "name": "Inverno (157)" + } + ], + "minimumQuantityBuyTogether": 1, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [ + { + "id": "1", + "name": "Vinho" + }, + { + "id": "1", + "name": "Vinho" + } + ], + "listSku2BuyTogether": [ + { + "id": "1", + "name": "Vinho" + }, + { + "id": "1", + "name": "Vinho" + } + ], + "listBrand1BuyTogether": [ + { + "id": "1", + "name": "Malbec" + }, + { + "id": "1", + "name": "Malbec" + } + ], + "listCategory1BuyTogether": [ + { + "id": "1", + "name": "Vinhos Tintos" + }, + { + "id": "1", + "name": "Vinhos Tintos" + } + ], + "coupon": [ + "coupon code.", + "coupon code." + ], + "totalValueFloor": 40, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [ + { + "id": "1", + "name": "Collection (1)" + }, + { + "id": "1", + "name": "Collection (1)" + } + ], + "collectionsIsInclusive": true, + "restrictionsBins": [ + "1234", + "1234" + ], + "cardIssuers": [ + "issuer", + "issuer" + ], + "totalValuePurchase": 0, + "slasIds": [ + "Express", + "Express" + ], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + }, + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 1, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [ + "merchant", + "merchant" + ], + "clusterExpressions": [ + "email contains user@mail.com", + "email contains user@mail.com" + ], + "clusterOperator": "operator", + "paymentsRules": [ + "rule1", + "rule1" + ], + "giftListTypes": [ + "Wishlist", + "Wishlist" + ], + "productsSpecifications": [ + "spec", + "spec" + ], + "affiliates": [ + { + "id": "1", + "name": "Amazon" + }, + { + "id": "1", + "name": "Amazon" + } + ], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [ + 0, + 0 + ], + "type": "campaign", + "idTypeDiscountBuyTogether": 5 + }, + { + "featured": false, + "id": "77ae1e4c-a216-4b15-a4a3-ae64ec298988", + "name": "Social Sellers", + "daysAgoOfPurchases": 0, + "origin": "Marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [ + "Principal", + "Principal" + ], + "areSalesChannelIdsExclusive": false, + "marketingTags": [ + "MKT1", + "MKT1" + ], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [ + { + "id": "2", + "name": "Visa (2)" + }, + { + "id": "2", + "name": "Visa (2)" + } + ], + "stores": [ + "store", + "store" + ], + "campaigns": [ + "campaign", + "campaign" + ], + "storesAreInclusive": false, + "categories": [ + { + "id": "1", + "name": "Vinhos Tintos (1)" + }, + { + "id": "1", + "name": "Vinhos Tintos (1)" + } + ], + "categoriesAreInclusive": true, + "brands": [ + { + "id": "1", + "name": "Brand (1)" + }, + { + "id": "1", + "name": "Brand (1)" + } + ], + "brandsAreInclusive": true, + "products": [ + { + "id": "1", + "name": "Vinho (1)" + }, + { + "id": "1", + "name": "Vinho (1)" + } + ], + "productsAreInclusive": true, + "skus": [ + { + "id": "1", + "name": "Vinho tinto (1)" + }, + { + "id": "1", + "name": "Vinho tinto (1)" + } + ], + "skusAreInclusive": true, + "collections1BuyTogether": [ + { + "id": "157", + "name": "Inverno (157)" + }, + { + "id": "157", + "name": "Inverno (157)" + } + ], + "collections2BuyTogether": [ + { + "id": "157", + "name": "Inverno (157)" + }, + { + "id": "157", + "name": "Inverno (157)" + } + ], + "minimumQuantityBuyTogether": 1, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [ + { + "id": "1", + "name": "Vinho" + }, + { + "id": "1", + "name": "Vinho" + } + ], + "listSku2BuyTogether": [ + { + "id": "1", + "name": "Vinho" + }, + { + "id": "1", + "name": "Vinho" + } + ], + "listBrand1BuyTogether": [ + { + "id": "1", + "name": "Malbec" + }, + { + "id": "1", + "name": "Malbec" + } + ], + "listCategory1BuyTogether": [ + { + "id": "1", + "name": "Vinhos Tintos" + }, + { + "id": "1", + "name": "Vinhos Tintos" + } + ], + "coupon": [ + "coupon code.", + "coupon code." + ], + "totalValueFloor": 40, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [ + { + "id": "1", + "name": "Collection (1)" + }, + { + "id": "1", + "name": "Collection (1)" + } + ], + "collectionsIsInclusive": true, + "restrictionsBins": [ + "1234", + "1234" + ], + "cardIssuers": [ + "issuer", + "issuer" + ], + "totalValuePurchase": 0, + "slasIds": [ + "Express", + "Express" + ], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + }, + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 1, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [ + "merchant", + "merchant" + ], + "clusterExpressions": [ + "email contains user@mail.com", + "email contains user@mail.com" + ], + "clusterOperator": "operator", + "paymentsRules": [ + "rule1", + "rule1" + ], + "giftListTypes": [ + "Wishlist", + "Wishlist" + ], + "productsSpecifications": [ + "spec", + "spec" + ], + "affiliates": [ + { + "id": "1", + "name": "Amazon" + }, + { + "id": "1", + "name": "Amazon" + } + ], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [ + 0, + 0 + ], + "type": "campaign", + "idTypeDiscountBuyTogether": 5 + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/campaignConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/campaignConfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/campaignConfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/campaignConfiguration - Schema is valid", function () { + const schema = {"type":"object","properties":{"beginDateUtc":{"type":"string","description":"Start date of the campaign audience in UTC format."},"endDateUtc":{"type":"string","description":"End date of the campaign audience in UTC format."},"id":{"type":"string","description":"Campaign audience ID."},"name":{"type":"string","description":"Campaign audience name."},"isActive":{"type":"boolean","description":"Defines if the campaign audience is active (`true`) or not (`false`)."},"isAndOperator":{"type":"boolean","description":"When `true`, determines that all the `targetConfigurations` need to be valid for the campaign audience to be active. When `false`, determines that if at least one of the `targetConfigurations` is valid, the campaign audience will be active."},"isArchived":{"type":"boolean","description":"Defines if the campaign audience is archived (`true`) or not (`false`)."},"lastModified":{"type":"object","description":"Object with information about the most recent update of the campaign audience.","properties":{"dateUtc":{"type":"string","description":"Date of the most recent update in UTC format."},"user":{"type":"string","description":"Email of the user who updated the campaign audience for the latest time."}}},"targetConfigurations":{"type":"array","description":"Array that contains all target audience that the campaign audience will be valid.","items":{"type":"object","description":"Object with information about the target audience.","properties":{"featured":{"type":"boolean","description":"Defines if the target audience is feature (`true`) or not (`false`)."},"id":{"type":"string","description":"Target audience ID."},"name":{"type":"string","description":"Target audience name."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"origin":{"type":"string","description":"Shows the campaign audience origin, `Marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSellerIsInclusive":{"type":"boolean","description":"Defines if at least one of the sellers must be valid to active the campaign audience."},"idsSalesChannel":{"type":"array","description":"Array with all the trade policies that activate the campaign audience.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"Defines if the trade policy IDs are exclusive."},"marketingTags":{"type":"array","description":"Array with all the campaign audience's marketing tags.","items":{"type":"string","description":"Campaign audience marketing tags."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"Defines if marketing tags are not inclusive."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this campaign audience not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this campaign audience not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this campaign audience not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU Name."}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this campaign audience not to be applied."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"listBrand1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a brand to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the brand to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the brand to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the brand to be added to the first list of the **Buy Together** promotion."}}}},"listCategory1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a category to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the category to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the category to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the category to be added to the first list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to active the campaign audience."},"totalValueCeling":{"type":"number","description":"Maximum chart value to active the campaign audience."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"Total chart value to active the campaign audience."},"collections":{"type":"array","description":"Object composed by the collections that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this campaign audience not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the campaign audience."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the campaign audience only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of the zip code that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the campaign audience will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"clusterOperator":{"type":"string","description":"Cluster operator."},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the campaign audience can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the campaign audience can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the campaign audience can be used multiple times per client."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}},"type":{"type":"string","description":"Defines the type of promotion. Possible values are:\r\n- `regular`: Regular promotion\r\n- `combo`: Buy Together promotion\r\n- `forThePriceOf`: More for Less promotion\r\n- `progressive`: Progressive discount promotion\r\n- `buyAndWin`: Buy One Get One promotion\r\n- `campaign`: Campaign promotion\r\n- `tax`: Tax (reverse promotion, increases the price)","enum":["regular","combo","forThePriceOf","progressive","buyAndWin","campaign","tax"]},"idTypeDiscountBuyTogether":{"type":"integer","description":"Defines the ID type related to `type` field. Possible values are:\r\n- `1`: Buy Together promotion\r\n- `2`: Progressive promotion\r\n- `3`: More for Less promotion\r\n- `4`: Buy One Get One promotion\r\n- `5`: Campaign promotion","enum":[1,2,3,4,5]}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new campaign audience. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "beginDateUtc": "2020-05-01T21:30:00Z", + "endDateUtc": "2020-05-02T01:30:00Z", + "id": "dd270d06-1ed1-47fc-b04e-a2431121b5a4", + "name": "Interna", + "isActive": true, + "isAndOperator": false, + "isArchived": false, + "lastModified": { + "dateUtc": "2020-05-01T21:22:01.807398Z", + "user": "email@email.com" + }, + "targetConfigurations": [ + { + "featured": false, + "id": "77ae1e4c-a216-4b15-a4a3-ae64ec298988", + "name": "Social Sellers", + "daysAgoOfPurchases": 0, + "origin": "Marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [ + "MKT1" + ], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [], + "stores": [], + "campaigns": [], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": true, + "brands": [], + "brandsAreInclusive": true, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 1, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "listBrand1BuyTogether": [], + "listCategory1BuyTogether": [ + { + "id": "1", + "name": "Vinhos Tintos (1)" + } + ], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": true, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [], + "type": "campaign", + "idTypeDiscountBuyTogether": 5 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get all campaign audiences.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get all campaign audiences.yml new file mode 100644 index 0000000000..33bd5ff239 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get all campaign audiences.yml @@ -0,0 +1,177 @@ +info: + name: Get all campaign audiences + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/campaignConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/campaignConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration - Schema is valid", function () { + const schema = {"type":"array","description":"Array of campaign audiences.","items":{"type":"object","description":"Object containing information about the campaign audience.","properties":{"beginDateUtc":{"type":"string","description":"Start date of the campaign audience in UTC format."},"endDateUtc":{"type":"string","description":"End date of the campaign audience in UTC format."},"id":{"type":"string","description":"Campaign audience ID."},"name":{"type":"string","description":"Campaign audience name."},"isActive":{"type":"boolean","description":"Defines if the campaign audience is active (`true`) or not (`false`)."},"isAndOperator":{"type":"boolean","description":"When `true`, determines that all the `targetConfigurations` need to be valid for the campaign audience to be active. When `false`, determines that if at least one of the `targetConfigurations` is valid, the campaign audience will be active."},"isArchived":{"type":"boolean","description":"Defines if the campaign audience is archived (`true`) or not (`false`)."},"lastModified":{"type":"object","description":"Object with information about the most recent update of the campaign audience.","properties":{"dateUtc":{"type":"string","description":"Date of the most recent update in UTC format."},"user":{"type":"string","description":"Email of the user who updated the campaign audience for the latest time."}}},"targetConfigurations":{"type":"array","description":"Array that contains all target audience that the campaign audience will be valid.","items":{"type":"object","description":"Object with information about the target audience.","properties":{"featured":{"type":"boolean","description":"Defines if the target audience is featured (`true`) or not (`false`)."},"id":{"type":"string","description":"Target audience ID."},"name":{"type":"string","description":"Target audience name."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"origin":{"type":"string","description":"Shows the campaign audience origin, `Marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSellerIsInclusive":{"type":"boolean","description":"Defines if at least one of the sellers must be valid to active the campaign audience."},"idsSalesChannel":{"type":"array","description":"Array with all the trade policies that activate the campaign audience.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"Defines if the trade policy IDs are exclusive."},"marketingTags":{"type":"array","description":"Array with all the campaign audience's marketing tags.","items":{"type":"string","description":"Campaign audience marketing tags."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"Defines if marketing tags are not inclusive."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign audience."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this campaign audience not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this campaign audience not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this campaign audience not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU Name."}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this campaign audience not to be applied."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"listBrand1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a brand to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the brand to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the brand to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the brand to be added to the first list of the **Buy Together** promotion."}}}},"listCategory1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a category to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the category to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the category to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the category to be added to the first list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to active the campaign audience."},"totalValueCeling":{"type":"number","description":"Maximum chart value to active the campaign audience."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"Total chart value to active the campaign audience."},"collections":{"type":"array","description":"Object composed by the collections that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this campaign audience not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the campaign audience."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the campaign audience only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of zip codes that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the campaign audience will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"clusterOperator":{"type":"string","description":"Cluster operator."},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the campaign audience can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the campaign audience can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the campaign audience can be used multiple times per client."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of all campaign audiences and their respective configurations. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "beginDateUtc": "2020-05-01T21:30:00Z", + "endDateUtc": "2020-05-02T01:30:00Z", + "id": "dd270d06-1ed1-47fc-b04e-a2431121b5a4", + "name": "Interna", + "isActive": true, + "isAndOperator": false, + "isArchived": false, + "lastModified": { + "dateUtc": "2020-05-01T21:22:01.807398Z", + "user": "email@email.com" + }, + "targetConfigurations": [ + { + "featured": false, + "id": "77ae1e4c-a216-4b15-a4a3-ae64ec298988", + "name": "Social Sellers", + "daysAgoOfPurchases": 0, + "origin": "Marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [ + "MKT1" + ], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [], + "stores": [], + "campaigns": [], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": true, + "brands": [], + "brandsAreInclusive": true, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 1, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "listBrand1BuyTogether": [], + "listCategory1BuyTogether": [ + { + "id": "1", + "name": "Vinhos Tintos (1)" + } + ], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": true, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "clusterOperator": "all", + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [] + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get campaign audience configuration.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get campaign audience configuration.yml new file mode 100644 index 0000000000..cff5544fa7 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/Get campaign audience configuration.yml @@ -0,0 +1,180 @@ +info: + name: Get campaign audience configuration + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/campaignConfiguration/:campaignId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: campaignId + value: dd270d06-1ed1-47fc-b04e-a2431121b5a4 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/campaignConfiguration/:campaignId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration/:campaignId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration/:campaignId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/campaignConfiguration/:campaignId - Schema is valid", function () { + const schema = {"type":"object","properties":{"beginDateUtc":{"type":"string","description":"Start date of the campaign audience in UTC format."},"endDateUtc":{"type":"string","description":"End date of the campaign audience in UTC format."},"id":{"type":"string","description":"Campaign audience ID."},"name":{"type":"string","description":"Campaign audience name."},"isActive":{"type":"boolean","description":"Defines if the campaign audience is active (`true`) or not (`false`)."},"isAndOperator":{"type":"boolean","description":"When `true`, determines that all the `targetConfigurations` need to be valid for the campaign audience to be active. When `false`, determines that if at least one of the `targetConfigurations` is valid, the campaign audience will be active."},"isArchived":{"type":"boolean","description":"Defines if the campaign audience is archived (`true`) or not (`false`)."},"lastModified":{"type":"object","description":"Object with information about the most recent update of the campaign audience.","properties":{"dateUtc":{"type":"string","description":"Date of the most recent update in UTC format."},"user":{"type":"string","description":"Email of the user who updated the campaign audience for the latest time."}}},"targetConfigurations":{"type":"array","description":"Array that contains all target audience that the campaign audience will be valid.","items":{"type":"object","description":"Object with information about the target audience.","properties":{"featured":{"type":"boolean","description":"Defines if the target audience is featured (`true`) or not (`false`)."},"id":{"type":"string","description":"Target audience ID."},"name":{"type":"string","description":"Target audience name."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"origin":{"type":"string","description":"Shows the campaign audience origin, `Marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSellerIsInclusive":{"type":"boolean","description":"Defines if at least one of the sellers must be valid to active the campaign audience."},"idsSalesChannel":{"type":"array","description":"Array with all the trade policies that activate the campaign audience.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"Defines if the trade policy IDs are exclusive."},"marketingTags":{"type":"array","description":"Array with all the campaign audience's marketing tags.","items":{"type":"string","description":"Campaign audience marketing tags."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"Defines if marketing tags are not inclusive."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign audience."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this campaign audience not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this campaign audience not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this campaign audience not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU Name."}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this campaign audience not to be applied."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"listBrand1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a brand to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the brand to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the brand to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the brand to be added to the first list of the **Buy Together** promotion."}}}},"listCategory1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of a category to be added in the first list of the **Buy Together** promotion.","items":{"type":"object","description":"Object containing the ID and Name of the category to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the category to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the category to be added to the first list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to active the campaign audience."},"totalValueCeling":{"type":"number","description":"Maximum chart value to active the campaign audience."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"Total chart value to active the campaign audience."},"collections":{"type":"array","description":"Object composed by the collections that will activate or deactivate the campaign audience.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this campaign audience will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this campaign audience not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the campaign audience."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the campaign audience only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of zip codes that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code.","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the campaign audience will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the campaign audience can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the campaign audience can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the campaign audience can be used multiple times per client."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific campaign audience configuration by its ID. This API uses the campaign ID, not the campaign name. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `campaignId` | path | (Required) Campaign audience unique identifier. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "beginDateUtc": "2020-05-01T21:30:00Z", + "endDateUtc": "2020-05-02T01:30:00Z", + "id": "dd270d06-1ed1-47fc-b04e-a2431121b5a4", + "name": "Interna", + "isActive": true, + "isAndOperator": false, + "isArchived": false, + "lastModified": { + "dateUtc": "2020-05-01T21:22:01.807398Z", + "user": "email@email.com" + }, + "targetConfigurations": [ + { + "featured": false, + "id": "77ae1e4c-a216-4b15-a4a3-ae64ec298988", + "name": "Social Sellers", + "daysAgoOfPurchases": 0, + "origin": "Marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [ + "MKT1" + ], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [], + "stores": [], + "campaigns": [], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": true, + "brands": [], + "brandsAreInclusive": true, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 1, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "listBrand1BuyTogether": [], + "listCategory1BuyTogether": [ + { + "id": "1", + "name": "Vinhos Tintos (1)" + } + ], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": true, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "clusterOperator": "all", + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [] + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/folder.yml new file mode 100644 index 0000000000..c41d9f8801 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Campaign Audiences/folder.yml @@ -0,0 +1,4 @@ +info: + name: Campaign Audiences + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Archive coupon by coupon code.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Archive coupon by coupon code.yml new file mode 100644 index 0000000000..6b2940a644 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Archive coupon by coupon code.yml @@ -0,0 +1,84 @@ +info: + name: Archive coupon by coupon code + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/archive/coupon/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: test + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/archive/coupon/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/archive/coupon/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/archive/coupon/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/archive/coupon/:couponCode - Schema is valid", function () { + const schema = {"type":"string","description":"Coupon code of the archived coupon."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Archives a specific coupon by its coupon code. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Coupon Code | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + promo10 + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create multiple coupons.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create multiple coupons.yml new file mode 100644 index 0000000000..36ed1ca86b --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create multiple coupons.yml @@ -0,0 +1,98 @@ +info: + name: Create multiple coupons + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/multiple-coupons" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "quantity": 1, + "couponConfiguration": { + "utmSource": "fb", + "utmCampaign": "bf", + "couponCode": "promobf4", + "isArchived": false, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 1 + } + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/multiple-coupons - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/multiple-coupons - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/multiple-coupons - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/multiple-coupons - Schema is valid", function () { + const schema = {"type":"array","description":"Array with the coupon codes that were created.","items":{"type":"string","description":"Coupon code."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates multiple coupons with different coupon codes. This endpoint has a throttling of 60 requests per minute. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "promobf" + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create or update coupon.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create or update coupon.yml new file mode 100644 index 0000000000..81b1032b00 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Create or update coupon.yml @@ -0,0 +1,104 @@ +info: + name: Create or update coupon + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/coupon" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "utmSource": "email", + "couponCode": "summersale10", + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "utmCampaign": "summer", + "isArchived": false, + "maxUsage": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/coupon - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/coupon - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/coupon - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/coupon - Schema is valid", function () { + const schema = {"type":"object","properties":{"lastModifiedUtc":{"type":"string","description":"Date and time of the last update of the coupon in UTC format."},"utmSource":{"type":"string","description":"UTM source code."},"utmCampaign":{"type":"string","description":"UTM campaign code."},"couponCode":{"type":"string","description":"Coupon code."},"isArchived":{"type":"boolean","description":"Defines if the coupon is archived (`true`) or not (`false`)."},"maxItemsPerClient":{"type":"integer","description":"Maximum items per client that the coupon can be applied."},"expirationIntervalPerUse":{"type":"string","description":"Coupon expiration interval per use."},"maxUsage":{"type":"integer","description":"Amount of times the coupon can be used."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new single coupon or updates an existing coupon. + + To update an existing coupon, first make a [Get coupon by coupon code](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api#get-/api/rnb/pvt/coupon/-couponCode-) request, copy the response body and apply the desired changes. Then, use the complete edited body as a request body in this update call. + + >⚠️ When updating a coupon, don't change the original `couponCode`, or a new coupon will be created instead of the existing coupon being updated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "lastModifiedUtc": "2021-11-10T14:24:39.3683694Z", + "utmSource": "email", + "utmCampaign": "summer", + "couponCode": "summersale10", + "isArchived": false, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Generate coupons in bulk.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Generate coupons in bulk.yml new file mode 100644 index 0000000000..201b1d11be --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Generate coupons in bulk.yml @@ -0,0 +1,105 @@ +info: + name: Generate coupons in bulk + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/coupons?quantity=10" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: quantity + value: "10" + type: query + body: + type: json + data: |- + { + "utmSource": "cupom3", + "utmCampaign": "cupom3", + "couponCode": "ctest", + "maxItemsPerClient": 1, + "expirationIntervalPerUse": "00:00:00" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/coupons - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/coupons - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/coupons - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/coupons - Schema is valid", function () { + const schema = {"type":"array","description":"Array with the generated coupon codes.","items":{"type":"string","description":"Coupon code."}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Generates a massive amount of coupons. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `quantity` | query | (Required) Number of coupons to create, which can be from `1` to `1000`. For a single coupon (`1`), the code will be the `couponCode` value. For multiple coupons (more than `1`), codes will be the `couponCode` value with a random suffix. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "ctest-7DLKU492HR4MANV", + "ctest-QUM3U4HUGJ54301", + "ctest-0KYBWQUKR3WXV4C", + "ctest-971CX1N55WZSEBY", + "ctest-9FCQ0UX80F6K4A7", + "ctest-HWZEJ7D0D9MP3O7", + "ctest-7PI34QVEERM8A70", + "ctest-RT47PC2A116O9QO", + "ctest-F4T3IQBAGQWRVW7", + "ctest-8C3MS3U594EPQB8" + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get all coupons.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get all coupons.yml new file mode 100644 index 0000000000..8158e4dde2 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get all coupons.yml @@ -0,0 +1,100 @@ +info: + name: Get all coupons + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/coupon" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/coupon - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/coupon - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/coupon - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/coupon - Schema is valid", function () { + const schema = {"type":"array","description":"List of coupons.","items":{"type":"object","description":"Object with information about the coupon.","properties":{"lastModifiedUtc":{"type":"string","description":"Date and time of the last update of the coupon in UTC format."},"utmSource":{"type":"string","description":"UTM source code."},"utmCampaign":{"type":"string","description":"UTM campaign code."},"couponCode":{"type":"string","description":"Coupon code."},"isArchived":{"type":"boolean","description":"Defines if the coupon is archived (`true`) or not (`false`)."},"maxItemsPerClient":{"type":"integer","description":"Maximum items per client that the coupon can be applied."},"expirationIntervalPerUse":{"type":"string","description":"Coupon expiration interval per use."},"maxUsage":{"type":"integer","description":"Amount of times the coupon can be used."},"groupingKey":{"type":"string","description":"If the coupon was created as a [multiple coupon](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/multiple-coupons) or using [Generate coupons in bulk](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/coupons), this field returns the original `couponCode` informed."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Check the new [Promotions onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/promotions-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Promotions and is organized by focusing on the developer's journey. + + Retrieves all coupons from an account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Indicate the media type of the resource. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + [ + { + "lastModifiedUtc": "2021-11-10T14:24:39.3683694Z", + "utmSource": "coupon3", + "utmCampaign": "coupon3", + "couponCode": "test", + "isArchived": false, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00" + }, + { + "lastModifiedUtc": "2020-06-22T18:25:24.4583474Z", + "utmSource": "cupom3", + "couponCode": "test-lucian2", + "isArchived": false, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 3 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get archived coupon by coupon code.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get archived coupon by coupon code.yml new file mode 100644 index 0000000000..2f963af140 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get archived coupon by coupon code.yml @@ -0,0 +1,92 @@ +info: + name: Get archived coupon by coupon code + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/archive/coupon/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: promo10 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/archive/coupon/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/archive/coupon/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/archive/coupon/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/archive/coupon/:couponCode - Schema is valid", function () { + const schema = {"type":"object","properties":{"lastModifiedUtc":{"type":"string","description":"Date and time of the last update of the coupon in UTC format."},"utmSource":{"type":"string","description":"UTM source code."},"utmCampaign":{"type":"string","description":"UTM campaign code."},"couponCode":{"type":"string","description":"Coupon code."},"isArchived":{"type":"boolean","description":"Defines if the coupon is archived (`true`) or not (`false`)."},"maxItemsPerClient":{"type":"integer","description":"Maximum items per client that the coupon can be applied."},"expirationIntervalPerUse":{"type":"string","description":"Coupon expiration interval per use."},"maxUsage":{"type":"integer","description":"Amount of times the coupon can be used."},"groupingKey":{"type":"string","description":"If the coupon was created as a [multiple coupon](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/multiple-coupons) or using [Generate coupons in bulk](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/coupons), this field returns the original `couponCode` informed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific archived coupon by its coupon code. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Coupon Code | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "lastModifiedUtc": "2021-11-10T14:24:39.3683694Z", + "utmSource": "coupon3", + "couponCode": "test", + "isArchived": true, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon by coupon code.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon by coupon code.yml new file mode 100644 index 0000000000..dc1619934b --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon by coupon code.yml @@ -0,0 +1,92 @@ +info: + name: Get coupon by coupon code + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/coupon/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: promo10 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/coupon/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/coupon/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/coupon/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/coupon/:couponCode - Schema is valid", function () { + const schema = {"type":"object","properties":{"lastModifiedUtc":{"type":"string","description":"Date and time of the last update of the coupon in UTC format."},"utmSource":{"type":"string","description":"UTM source code."},"utmCampaign":{"type":"string","description":"UTM campaign code."},"couponCode":{"type":"string","description":"Coupon code."},"isArchived":{"type":"boolean","description":"Defines if the coupon is archived (`true`) or not (`false`)."},"maxItemsPerClient":{"type":"integer","description":"Maximum items per client that the coupon can be applied."},"expirationIntervalPerUse":{"type":"string","description":"Coupon expiration interval per use."},"maxUsage":{"type":"integer","description":"Amount of times the coupon can be used."},"groupingKey":{"type":"string","description":"If the coupon was created as a [multiple coupon](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/multiple-coupons) or using [Generate coupons in bulk](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/coupons), this field returns the original `couponCode` informed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific coupon by its coupon code. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Coupon Code | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "lastModifiedUtc": "2021-11-10T14:24:39.3683694Z", + "utmSource": "coupon3", + "couponCode": "test", + "isArchived": false, + "maxItemsPerClient": 10, + "expirationIntervalPerUse": "00:00:00", + "maxUsage": 1 + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon usage.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon usage.yml new file mode 100644 index 0000000000..7300d69f77 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Get coupon usage.yml @@ -0,0 +1,97 @@ +info: + name: Get coupon usage + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/coupon/usage/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: test + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/coupon/usage/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/coupon/usage/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/coupon/usage/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/coupon/usage/:couponCode - Schema is valid", function () { + const schema = {"type":"object","properties":{"hostName":{"type":"string","description":"Name of the store."},"couponCode":{"type":"string","description":"Coupon code."},"profileUsages":{"type":"object","description":"Object with information where and when the coupon was used.","properties":{"profileId":{"type":"object","description":"Profile ID.","properties":{"orderUsage":{"type":"array","description":"Array with all the orders that the coupon was used.","items":{"type":"object","description":"Object with information about the order that the coupon was used.","properties":{"orderId":{"type":"string","description":"Order ID."},"usageDateUtc":{"type":"string","description":"Date and time when the coupon was used in the order in UTC format."}}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the coupon usage. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Coupon Code | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "hostName": "account", + "couponCode": "test", + "profileUsages": { + "23fa76cd-14e1-43ee-93af-0c04c9f6cfd7": { + "orderUsage": [ + { + "orderId": "11636716780563-01", + "usageDateUtc": "2021-11-03T23:27:54.8305115Z" + } + ] + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Unarchive coupon by coupon code.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Unarchive coupon by coupon code.yml new file mode 100644 index 0000000000..df9a946ed0 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/Unarchive coupon by coupon code.yml @@ -0,0 +1,84 @@ +info: + name: Unarchive coupon by coupon code + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/unarchive/coupon/:couponCode" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: couponCode + value: test + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/unarchive/coupon/:couponCode - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/unarchive/coupon/:couponCode - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/unarchive/coupon/:couponCode - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/unarchive/coupon/:couponCode - Schema is valid", function () { + const schema = {"type":"string","description":"Coupon code."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Unarchives a specifc coupon by its coupon code. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `couponCode` | path | (Required) Coupon Code | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + test + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/folder.yml new file mode 100644 index 0000000000..777d7e384c --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Coupons/folder.yml @@ -0,0 +1,4 @@ +info: + name: Coupons + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Notifications/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Notifications/folder.yml new file mode 100644 index 0000000000..3d7006e64d --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Notifications/folder.yml @@ -0,0 +1,4 @@ +info: + name: Notifications + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Delete price by SKU ID.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Delete price by SKU ID.yml new file mode 100644 index 0000000000..de9d20bc42 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Delete price by SKU ID.yml @@ -0,0 +1,54 @@ +info: + name: Delete price by SKU ID + type: http + seq: 2 + +http: + method: DELETE + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet/:skuId?an={{accountName}} + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: skuId + value: amet aute cupidatat sunt + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Delete all prices from an SKU. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://documenter.getpostman.com/view/101975/vtex-pricing-api/6YsWxKT) + + > If you are still using Pricing v1, please [check if your store is able to migrate to take advantage of many more features](https://help.vtex.com/en/faq/how-to-migrate-a-store-to-pricing-v2) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU ID. | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get all paged prices.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get all paged prices.yml new file mode 100644 index 0000000000..c590ad3b3f --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get all paged prices.yml @@ -0,0 +1,58 @@ +info: + name: Get all paged prices + type: http + seq: 3 + +http: + method: GET + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet/all/:page/:pageSize?an={{accountName}} + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: page + value: amet aute cupidatat sunt + type: path + - name: pageSize + value: amet aute cupidatat sunt + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Get all paged prices. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://documenter.getpostman.com/view/101975/vtex-pricing-api/6YsWxKT) + + > If you are still using Pricing v1, please [check if your store is able to migrate to take advantage of many more features](https://help.vtex.com/en/faq/how-to-migrate-a-store-to-pricing-v2) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `page` | path | (Required) Page number for pagination. | + | `pageSize` | path | (Required) Size of each page for pagination. | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID and trade policy.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID and trade policy.yml new file mode 100644 index 0000000000..41730f103d --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID and trade policy.yml @@ -0,0 +1,77 @@ +info: + name: Get price by SKU ID and trade policy + type: http + seq: 5 + +http: + method: GET + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet/:skuId/:tradePolicy?an={{accountName}} + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: skuId + value: amet aute cupidatat sunt + type: path + - name: tradePolicy + value: amet aute cupidatat sunt + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve price by SKU ID and trade policy. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://documenter.getpostman.com/view/101975/vtex-pricing-api/6YsWxKT) + + > If you are still using Pricing v1, please [check if your store is able to migrate to take advantage of many more features](https://help.vtex.com/en/faq/how-to-migrate-a-store-to-pricing-v2) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU ID. | + | `tradePolicy` | path | (Required) Trade policy name. | + | `an` | query | (Required) Account name. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "id": 100006808, + "itemId": 100006808, + "salesChannel": 0, + "sellerId": "1", + "price": 10, + "listPrice": 10, + "validFrom": "2023-01-01T03:00:00", + "validTo": "2025-01-01T03:00:00", + "lastUpdate": "2023-12-20T10:58:55.2417", + "hash": "1000068081000068081101001/01/1900 03:00:0001/01/4000 03:00:0012/20/2023 10:58:55" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID.yml new file mode 100644 index 0000000000..d44dcab4e3 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by SKU ID.yml @@ -0,0 +1,71 @@ +info: + name: Get price by SKU ID + type: http + seq: 1 + +http: + method: GET + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet/:skuId?an={{accountName}} + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + - name: skuId + value: amet aute cupidatat sunt + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve price given an SKU ID. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://developers.vtex.com/docs/api-reference/pricing-api) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU ID. | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": 100006808, + "itemId": 100006808, + "salesChannel": 0, + "sellerId": "1", + "price": 10, + "listPrice": 10, + "validFrom": "2023-01-01T03:00:00", + "validTo": "2025-01-01T03:00:00", + "lastUpdate": "2023-12-20T10:58:55.2417", + "hash": "1000068081000068081101001/01/1900 03:00:0001/01/4000 03:00:0012/20/2023 10:58:55" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by context.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by context.yml new file mode 100644 index 0000000000..58f353092a --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Get price by context.yml @@ -0,0 +1,61 @@ +info: + name: Get price by context + type: http + seq: 4 + +http: + method: POST + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet/context?an={{accountName}} + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + body: + type: json + data: |- + { + "id": 6324, + "itemId": 2390148, + "salesChannel": 1, + "sellerId": "1", + "validFrom": "2000-01-01T00:00:00", + "validTo": "2000-02-01T00:00:00" + } + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Get price by context. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://documenter.getpostman.com/view/101975/vtex-pricing-api/6YsWxKT) + + > If you are still using Pricing v1, please [check if your store is able to migrate to take advantage of many more features](https://help.vtex.com/en/faq/how-to-migrate-a-store-to-pricing-v2) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Save price.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Save price.yml new file mode 100644 index 0000000000..5f80671682 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/Save price.yml @@ -0,0 +1,64 @@ +info: + name: Save price + type: http + seq: 6 + +http: + method: POST + url: https://rnb.{{environment}}.com.br/api/pricing/pvt/price-sheet?an={{accountName}} + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: "{{accountName}}" + type: query + body: + type: json + data: |- + [ + { + "itemId": 2390148, + "salesChannel": 1, + "sellerId": 1, + "price": 1, + "listPrice": 1, + "validFrom": "2016-01-01T02:00:00Z", + "validTo": "2017-01-01T02:00:00Z" + } + ] + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Save price. + > If your account is using Pricing v2, you should avoid using these routes. Please refer directly to the [Pricing v2 API](https://documenter.getpostman.com/view/101975/vtex-pricing-api/6YsWxKT) + + > If you are still using Pricing v1, please [check if your store is able to migrate to take advantage of many more features](https://help.vtex.com/en/faq/how-to-migrate-a-store-to-pricing-v2) + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Promotions | **Manage benefits and rates** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/folder.yml new file mode 100644 index 0000000000..f8793df85f --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Prices (Legacy - v1)/folder.yml @@ -0,0 +1,4 @@ +info: + name: Prices (Legacy - v1) + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Archive promotion or tax.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Archive promotion or tax.yml new file mode 100644 index 0000000000..dde5f39af1 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Archive promotion or tax.yml @@ -0,0 +1,61 @@ +info: + name: Archive promotion or tax + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/archive/calculatorConfiguration/:idCalculatorConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: idCalculatorConfiguration + value: d8a1cd2e-b667-4054-b3ae-b79124c7218e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/rnb/pvt/archive/calculatorConfiguration/:idCalculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/archive/calculatorConfiguration/:idCalculatorConfiguration - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Archives a promotion or tax by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `idCalculatorConfiguration` | path | (Required) Promotion ID or tax ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create multiple SKU promotion.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create multiple SKU promotion.yml new file mode 100644 index 0000000000..922bf5be4f --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create multiple SKU promotion.yml @@ -0,0 +1,78 @@ +info: + name: Create multiple SKU promotion + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/import/calculatorConfiguration" + headers: + - name: Content-Type + value: text/csv + - name: Accept + value: application/json + - name: X-VTEX-calculator-name + value: Test + - name: X-VTEX-cumulative + value: "false" + disabled: true + - name: X-VTEX-cluster-operator + value: any + disabled: true + - name: X-VTEX-cluster-expression + value: cluster_name=true + disabled: true + - name: X-VTEX-start-date + value: 2020-08-18T16:00:00+3:00 + - name: X-VTEX-end-date + value: 2020-08-18T16:30:00+3:00 + - name: X-VTEX-accumulate-with-manual-prices + value: "false" + body: + type: file + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/rnb/pvt/import/calculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a Multiple SKU promotion. This scenario allows the creation of a single promotion for multiples SKUs with the Percentage Effect. + >⚠️ The limit of SKUs on a Multiple Effects promotion is 400. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `X-VTEX-calculator-name` | header | (Required) Promotion Name. | + | `X-VTEX-cumulative` | header | Defines if the Promotion is cumulative with other promotions. | + | `X-VTEX-cluster-operator` | header | This header allows implementing the Promotion in multiples client clusters. You can set the value as `all` - the Promotion will be valid to all the clusters - or `any` - the Promotion will be valid to any of the clusters. | + | `X-VTEX-cluster-expression` | header | Cluster that will be included in the Promotion. To add multiple clusters, create a header for each one of them. | + | `X-VTEX-start-date` | header | (Required) Promotion start date. | + | `X-VTEX-end-date` | header | (Required) Promotion end date. | + | `X-VTEX-accumulate-with-manual-prices` | header | (Required) Condition that will accumulate the Promotion with manual prices or not. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create or update promotion or tax.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create or update promotion or tax.yml new file mode 100644 index 0000000000..b018927239 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Create or update promotion or tax.yml @@ -0,0 +1,330 @@ +info: + name: Create or update promotion or tax + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/calculatorconfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "idCalculatorConfiguration": "d8a1cd2e-b667-4054-b3ae-b79124c7218e", + "name": "Promotion Social Seller", + "description": "Promotion for Social Seller", + "beginDateUtc": "2020-05-01T18:47:15.89Z", + "lastModified": "2021-09-17T18:13:16.2896414Z", + "daysAgoOfPurchases": 0, + "isActive": true, + "isArchived": false, + "isFeatured": false, + "disableDeal": false, + "activeDaysOfWeek": [], + "offset": -3, + "activateGiftsMultiplier": false, + "newOffset": -3, + "maxPricesPerItems": [], + "cumulative": false, + "discountType": "percentual", + "nominalShippingDiscountValue": 0, + "absoluteShippingDiscountValue": 0, + "nominalDiscountValue": 10, + "nominalDiscountType": "item", + "maximumUnitPriceDiscount": 0, + "percentualDiscountValue": 10, + "rebatePercentualDiscountValue": 0, + "percentualShippingDiscountValue": 0, + "percentualTax": 0, + "shippingPercentualTax": 0, + "percentualDiscountValueList1": 0, + "percentualDiscountValueList2": 0, + "skusGift": { + "quantitySelectable": 0 + }, + "nominalRewardValue": 0, + "percentualRewardValue": 0, + "orderStatusRewardValue": "invoiced", + "maxNumberOfAffectedItems": 0, + "maxNumberOfAffectedItemsGroupKey": "perCart", + "applyToAllShippings": false, + "nominalTax": 0, + "origin": "marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [], + "stores": [], + "campaigns": [], + "conditionsIds": [ + "372e1868-2c0e-4437-be45-1ef8c9cab735" + ], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": false, + "brands": [], + "brandsAreInclusive": false, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "utmSource": "georgeSource", + "utmCampaign": "georgeTest", + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 0, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": false, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "accumulateWithManualPrice": false, + "type": "regular", + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [], + "optIn": { + "sellers": [ + "seller-id-1", + "seller-id-2" + ] + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration - Schema is valid", function () { + const schema = {"type":"object","properties":{"idCalculatorConfiguration":{"type":"string","description":"Promotion ID."},"name":{"type":"string","description":"Promotion Name."},"description":{"type":"string","description":"Promotion internal description."},"beginDateUtc":{"type":"string","description":"Promotion Begin Date (UTC)."},"endDateUtc":{"type":"string","description":"Promotion End Date (UTC)."},"lastModified":{"type":"string","description":"When the Promotion was last modified."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"isActive":{"type":"boolean","description":"If set as `true` the Promotion is activated. If set as `false` the Promotion is deactivated."},"isArchived":{"type":"boolean","description":"If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived."},"isFeatured":{"type":"boolean","description":"Insert a flag with the promotion name used in the product's window display and page."},"disableDeal":{"type":"boolean","description":"Indicates whether a deal is disabled (`true`) or not (`false`)."},"activeDaysOfWeek":{"type":"array","description":"Defines which days of the week the promotion will applied.","items":{"type":"string","description":"Day of the week that the promotion will be valid."}},"offset":{"type":"integer","description":"Time offset from UTC in seconds."},"activateGiftsMultiplier":{"type":"boolean","description":"If set as `true`, it activates gifts Multiplier."},"newOffset":{"type":"number","description":"New time offset from UTC in seconds."},"maxPricesPerItems":{"type":"array","description":"List of max price per items.","items":{"type":"string","description":"Max price."}},"cumulative":{"type":"boolean","description":"Defines if a promotion can accumulate with another one. (`true`) or not (`false`)."},"discountType":{"type":"string","description":"The type of discount that will apply to the promotion."},"nominalShippingDiscountValue":{"type":"number","description":"Exact discount to be applied for the shipping value."},"absoluteShippingDiscountValue":{"type":"number","description":"Maximum shipping value."},"nominalDiscountValue":{"type":"number","description":"Exact discount to be applied for the total purchase value."},"maximumUnitPriceDiscount":{"type":"number","description":"The maximum price for each item of the purchase will be the price set up."},"percentualDiscountValue":{"type":"number","description":"Percentage discount to be applied for total purchase value."},"rebatePercentualDiscountValue":{"type":"number","description":"Percentual Shipping Discount Value."},"percentualShippingDiscountValue":{"type":"number","description":"Percentage discount to be applied for shipping value."},"percentualTax":{"type":"number","description":"Percentual tax over purchase total value."},"shippingPercentualTax":{"type":"number","description":"Shipping Percentual tax over purchase total value."},"percentualDiscountValueList1":{"type":"number","description":"Valid discounts for the SKUs in `listSku1BuyTogether`, discount list used for Buy Together Promotions."},"percentualDiscountValueList2":{"type":"number","description":"Equivalent to `percentualDiscountValueList1`."},"skusGift":{"type":"object","description":"SKU Gift Object. Total discount on the product value set as a gift.","properties":{"quantitySelectable":{"type":"integer","description":"Quantity of SKU Gifts."},"gifts":{"type":"integer","description":"Array with SKU Gifts IDs."}}},"nominalRewardValue":{"type":"number","description":"Nominal value for rewards program."},"percentualRewardValue":{"type":"number","description":"Percentage value for rewards program."},"orderStatusRewardValue":{"type":"string","description":"Order status reward value."},"maxNumberOfAffectedItems":{"type":"integer","description":"The maximum number of affected items for a promotion."},"maxNumberOfAffectedItemsGroupKey":{"type":"string","description":"Defines the maximum number of affected items by group key for a promotion. Possible values: \r\n- `perProductId`: Maximum items per product\r\n- `perCart`: Maximum items per cart\r\n- `perSku`: Maximum items per SKU","enum":["perProductId","perCart","perSku"]},"applyToAllShippings":{"type":"boolean","description":"Promotion will be applied to all kind of shipping."},"nominalTax":{"type":"number","description":"Nominal tax."},"origin":{"type":"string","description":"Origin of the promotion, `marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSeller":{"type":"string","description":"Seller Name."},"idSellerIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any seller present on the `idSeller` field. If set to `false`, sellers present on that field will make this promotion not to be applied."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this promotion.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied."},"marketingTags":{"type":"array","description":"Promotion Marketing tags.","items":{"type":"string","description":"Promotion Marketing tag."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any marketing tag present on the `marketingTags` field. If set to `true`, marketing tags present on that field will make this promotion not to be applied."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign audience."}},"conditionsIds":{"type":"array","description":"Array with conditions IDs.","items":{"type":"string","description":"Condition ID."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU Name."}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied."},"utmSource":{"type":"string","description":"Coupon utmSource code."},"utmCampaign":{"type":"string","description":"Coupon utmCampaign code."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to activate the promotion."},"totalValueCeling":{"type":"number","description":"Maximum chart value to activate the promotion."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"Defines if products that already are receiving a promotion will be considered on the chart total value. There are three options available: `IncludeMatchedItems`, `ExcludeMatchedItems`, `AllItems`."},"collections":{"type":"array","description":"Object composed by the collections that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the promotion."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the promotion only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of the zip code that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code.","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the promotion will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the promotion can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the promotion can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the promotion can be used multiple times per client."},"accumulateWithManualPrice":{"type":"boolean","description":"Allows the promotion to apply to products whose prices have been manually added by a call-center operator."},"type":{"type":"string","description":"Defines what is the type of the promotion or indicates if it is a tax. Possible values: `regular` ([Regular Promotion](https://help.vtex.com/tutorial/regular-promotion--tutorials_327)), `combo` ([Buy Together](https://help.vtex.com/en/tutorial/buy-together--tutorials_323)), `forThePriceOf` ([More for Less](https://help.vtex.com/en/tutorial/creating-a-more-for-less-promotion--tutorials_325)), `progressive` ([Progressive Discount](https://help.vtex.com/en/tutorial/progressive-discount--tutorials_324)), `buyAndWin` ([Buy One Get One](https://help.vtex.com/en/tutorial/buy-one-get-one--tutorials_322)), `maxPricePerItem` (Deprecated), `campaign` ([Campaign Promotion](https://help.vtex.com/en/tutorial/campaign-promotion--1ChYXhK2AQGuS6wAqS8Ume)), `tax` (Tax), `multipleEffects` (Multiple Effects)."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}},"optIn":{"type":["object","null"],"description":"Object defining the sellers that opted in to participate in the promotion. If `null`, the promotion is not restricted by seller opt-in.","properties":{"sellers":{"type":"array","description":"List of seller IDs that opted in to the promotion.","items":{"type":"string","description":"Seller ID."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates or updates a specific Promotion by its Promotion ID or a specific tax by its tax ID. + + >⚠️ You should always include both the `id` and `name` when registering objects in the request body. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "idCalculatorConfiguration": "d8a1cd2e-b667-4054-b3ae-b79124c7218e", + "name": "Promoção Social Seller", + "beginDateUtc": "2020-05-01T18:47:15.89Z", + "lastModified": "2021-02-23T20:58:38.7963862Z", + "daysAgoOfPurchases": 0, + "isActive": true, + "isArchived": false, + "isFeatured": false, + "disableDeal": false, + "activeDaysOfWeek": [], + "offset": -3, + "activateGiftsMultiplier": false, + "newOffset": -3, + "maxPricesPerItems": [], + "cumulative": false, + "discountType": "percentual", + "nominalShippingDiscountValue": 0, + "absoluteShippingDiscountValue": 0, + "nominalDiscountValue": 0, + "maximumUnitPriceDiscount": 0, + "percentualDiscountValue": 10, + "rebatePercentualDiscountValue": 0, + "percentualShippingDiscountValue": 0, + "percentualTax": 0, + "shippingPercentualTax": 0, + "percentualDiscountValueList1": 0, + "percentualDiscountValueList2": 0, + "skusGift": { + "quantitySelectable": 0 + }, + "nominalRewardValue": 0, + "percentualRewardValue": 0, + "orderStatusRewardValue": "invoiced", + "maxNumberOfAffectedItems": 0, + "maxNumberOfAffectedItemsGroupKey": "perCart", + "applyToAllShippings": false, + "nominalTax": 0, + "origin": "marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [ + { + "id": "202", + "name": "Dinheiro (202)" + }, + { + "id": "2", + "name": "Visa (2)" + } + ], + "stores": [], + "campaigns": [], + "conditionsIds": [ + "372e1868-2c0e-4437-be45-1ef8c9cab735" + ], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": false, + "brands": [], + "brandsAreInclusive": false, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "utmSource": "georgeSource", + "utmCampaign": "georgeTest", + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 0, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": false, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "accumulateWithManualPrice": false, + "type": "regular", + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [], + "optIn": { + "sellers": [ + "seller-id-1", + "seller-id-2" + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all promotions.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all promotions.yml new file mode 100644 index 0000000000..3d260b33ad --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all promotions.yml @@ -0,0 +1,175 @@ +info: + name: Get all promotions + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/benefits/calculatorconfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration - Schema is valid", function () { + const schema = {"type":"object","properties":{"limitConfigurationMaxPrice":{"type":"object","description":"Limit configuration max price.","properties":{"activesCount":{"type":"integer","description":"Actives count."},"limit":{"type":"integer","description":"Limit."}}},"limitConfiguration":{"type":"object","description":"Limit configuration.","properties":{"activesCount":{"type":"integer","description":"Actives count."},"limit":{"type":"integer","description":"Limit."}}},"items":{"type":"array","description":"Array with information about a promotion.","items":{"type":"object","description":"Object with information about a promotion.","properties":{"idCalculatorConfiguration":{"type":"string","description":"Promotion ID."},"lastModifiedUtc":{"type":"string","description":"Date and time when the promotion was last modified (UTC)."},"name":{"type":"string","description":"Promotion Name."},"beginDate":{"type":"string","description":"Promotion Begin Date (UTC)."},"endDate":{"type":"string","description":"Promotion End Date (UTC)."},"isActive":{"type":"boolean","description":"If set as `true` the promotion is activated. If set as `false` the promotion is deactivated."},"description":{"type":"string","description":"Promotion internal description."},"type":{"description":"Defines the type of promotion.","type":"string"},"utmSource":{"type":"string","description":"utmSource code."},"utmCampain":{"type":"string","description":"utmCampaign code."},"utmiCampaign":{"type":"string","description":"utmiCampaign code."},"status":{"type":"string","description":"Status of the promotion."},"percentualTax":{"type":"number","description":"Percentual tax applied."},"isArchived":{"type":"boolean","description":"If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived."},"hasMaxPricePerItem":{"description":"Defines if there is a maximum price per item.","type":"boolean"},"isTax":{"description":"Defines if it is a tax.","type":"boolean"},"campaigns":{"description":"Campaign Audiences that activate this promotion.","type":"array","items":{"type":"string","description":"Campaign Audience."}},"activateGiftsMultiplier":{"description":"If set as `true`, it activates gifts Multiplier.","type":"boolean"},"scope":{"description":"Scope of the promotion.","type":"object","properties":{"allCatalog":{"description":"Determines if the promotion applies to all products in the Catalog (`true`) or not (`false`).","type":"boolean"},"skus":{"description":"Quantity of SKUs which activate or deactivate the promotion.","type":"number"},"skusAreInclusive":{"description":"If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied.","type":"boolean"},"products":{"description":"Quantity of products which activate or deactivate the promotion.","type":"number"},"productsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied.","type":"boolean"},"collections":{"description":"Quantity of collections which activate or deactivate the promotion.","type":"number"},"collectionsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied.","type":"boolean"},"categories":{"description":"Quantity of categories which activate or deactivate the promotion.","type":"number"},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied."},"brands":{"description":"Quantity of brands which activate or deactivate the promotion.","type":"number"},"brandsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied.","type":"boolean"},"sellers":{"description":"Quantity of sellers which activate or deactivate the promotion.","type":"number"},"sellersAreInclusive":{"description":"If set to `true`, this promotion will be applied to any seller present on the `sellers` field. If set to `false`, sellers present on that field will make this promotion not to be applied.","type":"boolean"}}},"maxUsage":{"type":"number","description":"Defines how many times the promotion can be used."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this promotion.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied."}}}},"disabledItems":{"type":"array","description":"Disabled items.","items":{"type":"string","description":"Disabled item."}},"archivedItems":{"type":"array","description":"Archived items.","items":{"type":"string","description":"Archived item."}},"nominalDiscountType":{"type":"string","description":"Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values:\n\n -`item`: applies the intended nominal discount on every item present on the cart. \n\n -`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all promotions from an account. + + > 📘 Onboarding guide + > + > Check the new [Promotions onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/promotions-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about the Promotions and is organized by focusing on the developer's journey. + + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "limitConfigurationMaxPrice": { + "activesCount": 0, + "limit": 10 + }, + "limitConfiguration": { + "activesCount": 4, + "limit": 100 + }, + "items": [ + { + "idCalculatorConfiguration": "d8a1cd2e-b667-4054-b3ae-b79124c7218e", + "lastModifiedUtc": "2021-09-17T18:13:16.2896414Z", + "name": "Promotion Social Seller", + "description": "Promotion for Social Seller", + "type": "regular", + "utmSource": "georgeSource", + "utmCampain": "georgeTest", + "utmiCampaign": "", + "status": "active", + "isActive": true, + "isArchived": false, + "hasMaxPricePerItem": false, + "isTax": false, + "Campaigns": [], + "conditionsIds": [ + "372e1868-2c0e-4437-be45-1ef8c9cab735" + ], + "activateGiftsMultiplier": false, + "scope": { + "allCatalog": true, + "skus": 0, + "skusAreInclusive": true, + "products": 0, + "productsAreInclusive": false, + "collections": 0, + "collectionsAreInclusive": false, + "categories": 0, + "categoriesAreInclusive": false, + "brands": 0, + "brandsAreInclusive": false, + "sellers": 0, + "sellersAreInclusive": false + }, + "maxUsage": 0, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false + }, + { + "idCalculatorConfiguration": "7c946926-7815-4446-9428-83bd577a9135", + "lastModifiedUtc": "2021-11-12T16:58:30.2553053Z", + "name": "Progressive Discount", + "beginDate": "2021-04-15T03:00:00Z", + "endDate": "2021-04-16T02:30:00Z", + "isActive": false, + "description": "The progressive discount.", + "type": "progressive", + "utmSource": "", + "utmCampain": "", + "utmiCampaign": "", + "nominalDiscountType": "item", + "status": "inactive", + "percentualTax": 0, + "isArchived": false, + "hasMaxPricePerItem": false, + "isTax": false, + "Campaigns": [], + "activateGiftsMultiplier": false, + "scope": { + "allCatalog": true, + "skus": 0, + "skusAreInclusive": true, + "products": 0, + "productsAreInclusive": true, + "collections": 0, + "collectionsAreInclusive": true, + "categories": 0, + "categoriesAreInclusive": true, + "brands": 0, + "brandsAreInclusive": true, + "sellers": 0, + "sellersAreInclusive": true + }, + "maxUsage": 0, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false + } + ], + "disabledItems": [], + "archivedItems": [] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all taxes.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all taxes.yml new file mode 100644 index 0000000000..7aade19919 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get all taxes.yml @@ -0,0 +1,128 @@ +info: + name: Get all taxes + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/taxes/calculatorconfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/taxes/calculatorconfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/taxes/calculatorconfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/taxes/calculatorconfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/taxes/calculatorconfiguration - Schema is valid", function () { + const schema = {"type":"object","properties":{"limitConfiguration":{"type":"object","description":"Limit configuration.","properties":{"activesCount":{"type":"integer","description":"Actives count."},"limit":{"type":"integer","description":"Limit."}}},"items":{"type":"array","description":"Array with taxes.","items":{"type":"object","description":"Object with information about a tax.","properties":{"idCalculatorConfiguration":{"type":"string","description":"Tax ID."},"lastModifiedUtc":{"type":"string","description":"Date and time when the tax was last modified (UTC)."},"name":{"type":"string","description":"Tax name."},"beginDate":{"type":"string","description":"Tax start date (UTC)."},"endDate":{"type":"string","description":"Tax end date (UTC)."},"isActive":{"type":"boolean","description":"If set as `true` the tax is activated. If set as `false` the tax is deactivated."},"description":{"type":"string","description":"Tax internal description."},"type":{"description":"Defines the type of tax.","type":"string"},"utmSource":{"type":"string","description":"utmSource code."},"utmCampain":{"type":"string","description":"utmCampaign code."},"utmiCampaign":{"type":"string","description":"utmiCampaign code."},"status":{"type":"string","description":"Status of the tax."},"percentualTax":{"type":"number","description":"Percentual tax applied."},"isArchived":{"type":"boolean","description":"If set as `true` the tax is archived. If set as `false` the tax is not archived."},"hasMaxPricePerItem":{"description":"Defines if there is a maximum price per item.","type":"boolean"},"isTax":{"description":"Defines if it is a tax.","type":"boolean"},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign."}},"activateGiftsMultiplier":{"description":"If set as `true`, it activates gifts Multiplier.","type":"boolean"},"scope":{"description":"Scope of the tax.","type":"object","properties":{"allCatalog":{"description":"Determines if the tax applies to all products in the Catalog (`true`) or not (`false`).","type":"boolean"},"skus":{"description":"Quantity of SKUs which activate or deactivate the tax.","type":"number"},"skusAreInclusive":{"description":"If set to `true`, this tax will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this tax not to be applied.","type":"boolean"},"products":{"description":"Quantity of products which activate or deactivate the tax.","type":"number"},"productsAreInclusive":{"description":"If set to `true`, this tax will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this tax not to be applied.","type":"boolean"},"collections":{"description":"Quantity of collections which activate or deactivate the tax.","type":"number"},"collectionsAreInclusive":{"description":"If set to `true`, this tax will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this tax not to be applied.","type":"boolean"},"categories":{"description":"Quantity of categories which activate or deactivate the tax.","type":"number"},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this tax will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this tax not to be applied."},"brands":{"description":"Quantity of brands which activate or deactivate the tax.","type":"number"},"brandsAreInclusive":{"description":"If set to `true`, this tax will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this tax not to be applied.","type":"boolean"},"sellers":{"description":"Quantity of sellers which activate or deactivate the tax.","type":"number"},"sellersAreInclusive":{"description":"If set to `true`, this tax will be applied to any seller present on the `sellers` field. If set to `false`, sellers present on that field will make this tax not to be applied.","type":"boolean"}}},"maxUsage":{"type":"number","description":"Defines how many times the tax can be used."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this tax.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this tax will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this tax not to be applied."}}}},"disabledItems":{"type":"array","description":"Disabled items.","items":{"type":"string","description":"Disabled item."}},"archivedItems":{"type":"array","description":"Archived items.","items":{"type":"string","description":"Archived item."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all taxes from an account. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "limitConfiguration": { + "activesCount": 1, + "limit": 100 + }, + "items": [ + { + "idCalculatorConfiguration": "90f4affc-fea0-424c-a7a7-c69aec7bbdc8", + "lastModifiedUtc": "2022-05-10T02:42:52.4493897Z", + "name": "Government tax", + "beginDate": "2022-05-09T03:00:00Z", + "endDate": "2022-06-01T02:30:00Z", + "isActive": true, + "description": "Tax applied by the government", + "type": "tax", + "utmSource": "", + "utmCampain": "", + "utmiCampaign": "", + "status": "active", + "percentualTax": 10, + "isArchived": false, + "hasMaxPricePerItem": false, + "isTax": true, + "Campaigns": [], + "activateGiftsMultiplier": false, + "scope": { + "allCatalog": false, + "skus": 1, + "skusAreInclusive": true, + "products": 1, + "productsAreInclusive": true, + "collections": 1, + "collectionsAreInclusive": true, + "categories": 1, + "categoriesAreInclusive": true, + "brands": 1, + "brandsAreInclusive": true, + "sellers": 0, + "sellersAreInclusive": false + }, + "maxUsage": 0, + "idsSalesChannel": [ + "1" + ], + "areSalesChannelIdsExclusive": false + } + ], + "disabledItems": [], + "archivedItems": [] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get promotion or tax by ID.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get promotion or tax by ID.yml new file mode 100644 index 0000000000..a659123a22 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Get promotion or tax by ID.yml @@ -0,0 +1,232 @@ +info: + name: Get promotion or tax by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: idCalculatorConfiguration + value: d8a1cd2e-b667-4054-b3ae-b79124c7218e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration - Schema is valid", function () { + const schema = {"type":"object","properties":{"idCalculatorConfiguration":{"type":"string","description":"Promotion ID."},"name":{"type":"string","description":"Promotion Name."},"description":{"type":"string","description":"Promotion internal description."},"beginDateUtc":{"type":"string","description":"Promotion Begin Date (UTC)."},"endDateUtc":{"type":"string","description":"Promotion End Date (UTC)."},"lastModified":{"type":"string","description":"When the Promotion was last modified."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"isActive":{"type":"boolean","description":"If set as `true` the Promotion is activated. If set as `false` the Promotion is deactivated."},"isArchived":{"type":"boolean","description":"If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived."},"isFeatured":{"type":"boolean","description":"Insert a flag with the promotion name used in the product's window display and page."},"disableDeal":{"type":"boolean","description":"Indicates whether a deal is disabled (`true`) or not (`false`)."},"activeDaysOfWeek":{"type":"array","description":"Defines which days of the week the promotion will applied.","items":{"type":"string","description":"Day of the week that the promotion will be valid."}},"offset":{"type":"integer","description":"Time offset from UTC in seconds."},"activateGiftsMultiplier":{"type":"boolean","description":"If set as `true`, it activates gifts Multiplier."},"newOffset":{"type":"number","description":"New time offset from UTC in seconds."},"maxPricesPerItems":{"type":"array","description":"List of max price per items.","items":{"type":"string","description":"Max price."}},"cumulative":{"type":"boolean","description":"Defines if a promotion can accumulate with another one. (`true`) or not (`false`)."},"discountType":{"type":"string","description":"The type of discount that will apply to the promotion."},"nominalShippingDiscountValue":{"type":"number","description":"Exact discount to be applied for the shipping value."},"absoluteShippingDiscountValue":{"type":"number","description":"Maximum value for the shipping."},"nominalDiscountValue":{"type":"number","description":"Exact discount to be applied for the total purchase value."},"nominalDiscountType":{"type":"string","description":"Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values:\n\n -`item`: applies the intended nominal discount on every item present on the cart. \n\n -`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items."},"maximumUnitPriceDiscount":{"type":"number","description":"The maximum price for each item of the purchase will be the price set up."},"percentualDiscountValue":{"type":"number","description":"Percentage discount to be applied for total purchase value."},"rebatePercentualDiscountValue":{"type":"number","description":"Percentual Shipping Discount Value."},"percentualShippingDiscountValue":{"type":"number","description":"Percentage discount to be applied for shipping value."},"percentualTax":{"type":"number","description":"Percentual tax over purchase total value."},"shippingPercentualTax":{"type":"number","description":"Shipping Percentual tax over purchase total value."},"percentualDiscountValueList1":{"type":"number","description":"Valid discounts for the SKUs in `listSku1BuyTogether`, discount list used for Buy Together Promotions."},"percentualDiscountValueList2":{"type":"number","description":"Equivalent to `percentualDiscountValueList1`."},"skusGift":{"type":"object","description":"SKU Gift Object. Total discount on the product value set as a gift.","properties":{"quantitySelectable":{"type":"integer","description":"Quantity of SKU Gifts."},"gifts":{"type":"integer","description":"Array with SKU Gifts IDs."}}},"nominalRewardValue":{"type":"number","description":"Nominal value for rewards program."},"percentualRewardValue":{"type":"number","description":"Percentage value for rewards program."},"orderStatusRewardValue":{"type":"string","description":"Order status reward value."},"maxNumberOfAffectedItems":{"type":"integer","description":"The maximum number of affected items for a promotion."},"maxNumberOfAffectedItemsGroupKey":{"type":"string","description":"The maximum number of affected items by group key for a promotion."},"applyToAllShippings":{"type":"boolean","description":"Promotion will be applied to all kind of shipping."},"nominalTax":{"type":"number","description":"Nominal tax."},"origin":{"type":"string","description":"Origin of the promotion, `marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSeller":{"type":"string","description":"Seller Name."},"idSellerIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any seller present on the idSeller field. If set to `false`, sellers present on that field will make this promotion not to be applied."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this promotion.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied."},"marketingTags":{"type":"array","description":"Promotion Marketing tags.","items":{"type":"string","description":"Promotion Marketing tag."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any marketing tag present on the `marketingTags` field. If set to `true`, marketing tags present on that field will make this promotion not to be applied."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign audience."}},"conditionsIds":{"type":"array","description":"Array with conditions IDs.","items":{"type":"string","description":"Condition ID."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the promotion.","items":{"type":"object","required":["id","name"],"description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID.","nullable":false},"name":{"type":"string","description":"SKU Name.","nullable":false}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied."},"utmSource":{"type":"string","description":"Coupon utmSource code."},"utmCampaign":{"type":"string","description":"Coupon utmCampaign code."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount** or **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to activate the promotion."},"totalValueCeling":{"type":"number","description":"Maximum chart value to activate the promotion."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"If products that already are receiving a promotion, will be considered on the chart total value. There are three options available: `IncludeMatchedItems`, `ExcludeMatchedItems`, `AllItems`."},"collections":{"type":"array","description":"Array composed by the collections that will be activated or deactivated the promotion.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the promotion."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the promotion only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of the zip code that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code.","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"countries":{"type":"array","description":"List of countries that are activated for this promotion.","items":{"type":"string","description":"Three-digit country code."}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the promotion will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"multipleSkusCause":{"type":"object","description":"Object composed by a list of SKUs on a Multiple Effects promotion. Structure: `\"{SkuId}\": {PercentageDiscount}`. There is a limit of 400 SKUs for this type of promotion.","additionalProperties":{"type":"string","description":"SKU ID."}},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the promotion can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the promotion can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the promotion can be used multiple times per client."},"accumulateWithManualPrice":{"type":"boolean","description":"Allows the promotion to apply to products whose prices have been manually added by a call center operator."},"type":{"type":"string","description":"Defines what is the type of the promotion or indicates if it is a tax. Possible values: `regular` ([Regular Promotion](https://help.vtex.com/tutorial/regular-promotion--tutorials_327)), `combo` ([Buy Together](https://help.vtex.com/en/tutorial/buy-together--tutorials_323)), `forThePriceOf` ([More for Less](https://help.vtex.com/en/tutorial/creating-a-more-for-less-promotion--tutorials_325)), `progressive` ([Progressive Discount](https://help.vtex.com/en/tutorial/progressive-discount--tutorials_324)), `buyAndWin` ([Buy One Get One](https://help.vtex.com/en/tutorial/buy-one-get-one--tutorials_322)), `maxPricePerItem` (Deprecated), `campaign` ([Campaign Promotion](https://help.vtex.com/en/tutorial/campaign-promotion--1ChYXhK2AQGuS6wAqS8Ume)), `tax` (Tax), `multipleEffects` (Multiple Effects)."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}},"optIn":{"type":["object","null"],"description":"Object defining the sellers that opted in to participate in the promotion. If `null`, the promotion is not restricted by seller opt-in.","properties":{"sellers":{"type":"array","description":"List of seller IDs that opted in to the promotion.","items":{"type":"string","description":"Seller ID."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific promotion by its Promotion ID or a specific tax by its tax ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `idCalculatorConfiguration` | path | (Required) Promotion ID or tax ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "idCalculatorConfiguration": "d8a1cd2e-b667-4054-b3ae-b79124c7218e", + "name": "Social Seller Promotion", + "beginDateUtc": "2020-05-01T18:47:15.89Z", + "lastModified": "2021-02-23T20:58:38.7963862Z", + "daysAgoOfPurchases": 0, + "isActive": true, + "isArchived": false, + "isFeatured": false, + "disableDeal": false, + "activeDaysOfWeek": [], + "offset": -3, + "activateGiftsMultiplier": false, + "newOffset": -3, + "maxPricesPerItems": [], + "cumulative": false, + "discountType": "percentual", + "nominalShippingDiscountValue": 0, + "absoluteShippingDiscountValue": 0, + "nominalDiscountValue": 0, + "nominalDiscountType": "item", + "maximumUnitPriceDiscount": 0, + "percentualDiscountValue": 10, + "rebatePercentualDiscountValue": 0, + "percentualShippingDiscountValue": 0, + "percentualTax": 0, + "shippingPercentualTax": 0, + "percentualDiscountValueList1": 0, + "percentualDiscountValueList2": 0, + "skusGift": { + "quantitySelectable": 0 + }, + "nominalRewardValue": 0, + "percentualRewardValue": 0, + "orderStatusRewardValue": "invoiced", + "maxNumberOfAffectedItems": 0, + "maxNumberOfAffectedItemsGroupKey": "perCart", + "applyToAllShippings": false, + "nominalTax": 0, + "origin": "marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [ + { + "id": "202", + "name": "Dinheiro (202)" + }, + { + "id": "2", + "name": "Visa (2)" + } + ], + "stores": [], + "campaigns": [], + "conditionsIds": [ + "372e1868-2c0e-4437-be45-1ef8c9cab735" + ], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": false, + "brands": [], + "brandsAreInclusive": false, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "utmSource": "georgeSource", + "utmCampaign": "georgeTest", + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 0, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [ + { + "id": "2", + "name": "gustaBT" + }, + { + "id": "5", + "name": "exampleSKU" + } + ], + "listSku2BuyTogether": [ + { + "id": "3", + "name": "anotherSKU" + }, + { + "id": "6", + "name": "exampleProduct" + } + ], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": false, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "countries": [ + "BRA" + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "accumulateWithManualPrice": false, + "type": "regular", + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [], + "optIn": { + "sellers": [ + "seller-id-1", + "seller-id-2" + ] + } + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived promotions.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived promotions.yml new file mode 100644 index 0000000000..939ccfbfc2 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived promotions.yml @@ -0,0 +1,121 @@ +info: + name: List archived promotions + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/archive/benefits/calculatorConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/archive/benefits/calculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/archive/benefits/calculatorConfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/archive/benefits/calculatorConfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/archive/benefits/calculatorConfiguration - Schema is valid", function () { + const schema = {"type":"object","description":"Response object.","properties":{"items":{"type":"array","description":"Array with information about a promotion.","items":{"type":"object","description":"Object with information about a promotion.","properties":{"idCalculatorConfiguration":{"type":"string","description":"Promotion ID."},"lastModifiedUtc":{"type":"string","description":"Date and time when the promotion was last modified (UTC)."},"name":{"type":"string","description":"Promotion Name."},"beginDate":{"type":"string","description":"Promotion Begin Date (UTC)."},"endDate":{"type":"string","description":"Promotion End Date (UTC)."},"isActive":{"type":"boolean","description":"If set as `true` the promotion is activated. If set as `false` the promotion is deactivated."},"description":{"type":"string","description":"Promotion internal description."},"type":{"description":"Defines the type of promotion.","type":"string"},"utmSource":{"type":"string","description":"utmSource code."},"utmCampain":{"type":"string","description":"utmCampaign code."},"utmiCampaign":{"type":"string","description":"utmiCampaign code."},"status":{"type":"string","description":"Status of the promotion."},"percentualTax":{"type":"number","description":"Percentual tax applied."},"isArchived":{"type":"boolean","description":"If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived."},"hasMaxPricePerItem":{"description":"Defines if there is a maximum price per item.","type":"boolean"},"isTax":{"description":"Defines if it is a tax.","type":"boolean"},"campaigns":{"description":"Campaign Audiences that activate this promotion.","type":"array","items":{"type":"string","description":"Campaign Audience."}},"activateGiftsMultiplier":{"description":"If set as `true`, it activates gifts Multiplier.","type":"boolean"},"scope":{"description":"Scope of the promotion.","type":"object","properties":{"allCatalog":{"description":"Determines if the promotion applies to all products in the Catalog (`true`) or not (`false`).","type":"boolean"},"skus":{"description":"Quantity of SKUs which activate or deactivate the promotion.","type":"number"},"skusAreInclusive":{"description":"If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied.","type":"boolean"},"products":{"description":"Quantity of products which activate or deactivate the promotion.","type":"number"},"productsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied.","type":"boolean"},"collections":{"description":"Quantity of collections which activate or deactivate the promotion.","type":"number"},"collectionsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied.","type":"boolean"},"categories":{"description":"Quantity of categories which activate or deactivate the promotion.","type":"number"},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied."},"brands":{"description":"Quantity of brands which activate or deactivate the promotion.","type":"number"},"brandsAreInclusive":{"description":"If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied.","type":"boolean"},"sellers":{"description":"Quantity of sellers which activate or deactivate the promotion.","type":"number"},"sellersAreInclusive":{"description":"If set to `true`, this promotion will be applied to any seller present on the `sellers` field. If set to `false`, sellers present on that field will make this promotion not to be applied.","type":"boolean"}}},"maxUsage":{"type":"number","description":"Defines how many times the promotion can be used."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this promotion.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied."}}}},"nominalDiscountType":{"type":"string","description":"Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values:\n\n -`item`: applies the intended nominal discount on every item present on the cart. \n\n -`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all archived promotions. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "idCalculatorConfiguration": "05558233-b415-4f2e-9822-ebdb3918623b", + "lastModifiedUtc": "2021-04-30T17:56:29.7157634Z", + "name": "Promoção Progressiva", + "beginDate": "2021-04-15T03:00:00Z", + "endDate": "2021-04-16T02:30:00Z", + "isActive": false, + "description": "Progressive discount promotion.", + "type": "progressive", + "utmSource": "", + "utmCampain": "", + "utmiCampaign": "", + "nominalDiscountType": "item", + "status": "inactive", + "percentualTax": 0, + "isArchived": true, + "hasMaxPricePerItem": false, + "isTax": false, + "Campaigns": [], + "activateGiftsMultiplier": false, + "scope": { + "allCatalog": true, + "skus": 0, + "skusAreInclusive": true, + "products": 0, + "productsAreInclusive": true, + "collections": 0, + "collectionsAreInclusive": true, + "categories": 0, + "categoriesAreInclusive": true, + "brands": 0, + "brandsAreInclusive": true, + "sellers": 0, + "sellersAreInclusive": true + }, + "maxUsage": 0, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived taxes.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived taxes.yml new file mode 100644 index 0000000000..d155412a78 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/List archived taxes.yml @@ -0,0 +1,122 @@ +info: + name: List archived taxes + type: http + seq: 12 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/archive/taxes/calculatorConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/archive/taxes/calculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/archive/taxes/calculatorConfiguration - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/archive/taxes/calculatorConfiguration - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/archive/taxes/calculatorConfiguration - Schema is valid", function () { + const schema = {"type":"object","description":"Response object.","properties":{"items":{"type":"array","description":"Array with taxes.","items":{"type":"object","description":"Object with information about a tax.","properties":{"idCalculatorConfiguration":{"type":"string","description":"Tax ID."},"lastModifiedUtc":{"type":"string","description":"Date and time when the tax was last modified (UTC)."},"name":{"type":"string","description":"Tax name."},"beginDate":{"type":"string","description":"Tax start date (UTC)."},"endDate":{"type":"string","description":"Tax end date (UTC)."},"isActive":{"type":"boolean","description":"If set as `true` the tax is activated. If set as `false` the tax is deactivated."},"description":{"type":"string","description":"Tax internal description."},"type":{"description":"Defines the type of tax.","type":"string"},"utmSource":{"type":"string","description":"utmSource code."},"utmCampain":{"type":"string","description":"utmCampaign code."},"utmiCampaign":{"type":"string","description":"utmiCampaign code."},"status":{"type":"string","description":"Status of the tax."},"percentualTax":{"type":"number","description":"Percentual tax applied."},"isArchived":{"type":"boolean","description":"If set as `true` the tax is archived. If set as `false` the tax is not archived."},"hasMaxPricePerItem":{"description":"Defines if there is a maximum price per item.","type":"boolean"},"isTax":{"description":"Defines if it is a tax.","type":"boolean"},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign."}},"activateGiftsMultiplier":{"description":"If set as `true`, it activates gifts Multiplier.","type":"boolean"},"scope":{"description":"Scope of the tax.","type":"object","properties":{"allCatalog":{"description":"Determines if the tax applies to all products in the Catalog (`true`) or not (`false`).","type":"boolean"},"skus":{"description":"Quantity of SKUs which activate or deactivate the tax.","type":"number"},"skusAreInclusive":{"description":"If set to `true`, this tax will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this tax not to be applied.","type":"boolean"},"products":{"description":"Quantity of products which activate or deactivate the tax.","type":"number"},"productsAreInclusive":{"description":"If set to `true`, this tax will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this tax not to be applied.","type":"boolean"},"collections":{"description":"Quantity of collections which activate or deactivate the tax.","type":"number"},"collectionsAreInclusive":{"description":"If set to `true`, this tax will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this tax not to be applied.","type":"boolean"},"categories":{"description":"Quantity of categories which activate or deactivate the tax.","type":"number"},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this tax will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this tax not to be applied."},"brands":{"description":"Quantity of brands which activate or deactivate the tax.","type":"number"},"brandsAreInclusive":{"description":"If set to `true`, this tax will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this tax not to be applied.","type":"boolean"},"sellers":{"description":"Quantity of sellers which activate or deactivate the tax.","type":"number"},"sellersAreInclusive":{"description":"If set to `true`, this tax will be applied to any seller present on the `sellers` field. If set to `false`, sellers present on that field will make this tax not to be applied.","type":"boolean"}}},"maxUsage":{"type":"number","description":"Defines how many times the tax can be used."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this tax.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this tax will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this tax not to be applied."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all archived taxes. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "items": [ + { + "idCalculatorConfiguration": "90f4affc-fea0-424c-a7a7-c69aec7bbdc8", + "lastModifiedUtc": "2022-05-16T19:43:06.1801742Z", + "name": "Test Tax", + "beginDate": "2022-05-09T03:00:00Z", + "endDate": "2022-06-01T02:30:00Z", + "isActive": false, + "description": "My description", + "type": "tax", + "utmSource": "", + "utmCampain": "", + "utmiCampaign": "", + "status": "inactive", + "percentualTax": 10, + "isArchived": true, + "hasMaxPricePerItem": false, + "isTax": true, + "Campaigns": [], + "activateGiftsMultiplier": false, + "scope": { + "allCatalog": false, + "skus": 1, + "skusAreInclusive": true, + "products": 1, + "productsAreInclusive": true, + "collections": 1, + "collectionsAreInclusive": true, + "categories": 1, + "categoriesAreInclusive": true, + "brands": 1, + "brandsAreInclusive": true, + "sellers": 0, + "sellersAreInclusive": false + }, + "maxUsage": 0, + "idsSalesChannel": [ + "1" + ], + "areSalesChannelIdsExclusive": false + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Search promotion by name.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Search promotion by name.yml new file mode 100644 index 0000000000..ca8ef23692 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Search promotion by name.yml @@ -0,0 +1,210 @@ +info: + name: Search promotion by name + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rnb/pvt/benefits/calculatorconfiguration/search?byName=shirt" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: byName + value: shirt + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rnb/pvt/benefits/calculatorconfiguration/search - Schema is valid", function () { + const schema = {"type":"array","description":"List of promotions whose name matches the search.","items":{"type":"object","description":"Object with information about a promotion.","properties":{"idCalculatorConfiguration":{"type":"string","description":"Promotion ID."},"name":{"type":"string","description":"Promotion Name."},"description":{"type":"string","description":"Promotion internal description."},"beginDateUtc":{"type":"string","description":"Promotion Begin Date (UTC)."},"endDateUtc":{"type":"string","description":"Promotion End Date (UTC)."},"lastModified":{"type":"string","description":"When the Promotion was last modified."},"daysAgoOfPurchases":{"type":"integer","description":"Number of days that are considered to add the purchase history."},"isActive":{"type":"boolean","description":"If set as `true` the Promotion is activated. If set as `false` the Promotion is deactivated."},"isArchived":{"type":"boolean","description":"If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived."},"isFeatured":{"type":"boolean","description":"Insert a flag with the promotion name used in the product's window display and page."},"disableDeal":{"type":"boolean","description":"Indicates whether a deal is disabled (`true`) or not (`false`)."},"activeDaysOfWeek":{"type":"array","description":"Defines which days of the week the promotion will applied.","items":{"type":"string","description":"Day of the week that the promotion will be valid."}},"offset":{"type":"integer","description":"Time offset from UTC in seconds."},"activateGiftsMultiplier":{"type":"boolean","description":"If set as `true`, it activates gifts Multiplier."},"newOffset":{"type":"number","description":"New time offset from UTC in seconds."},"maxPricesPerItems":{"type":"array","description":"List of prices per items.","items":{"type":"string","description":"Price."}},"cumulative":{"type":"boolean","description":"Defines if a promotion can accumulate with another one. (`true`) or not (`false`)."},"effectType":{"type":"string","description":"The type of effect that will apply to the promotion."},"discountType":{"type":"string","description":"The type of discount that will apply to the promotion."},"nominalShippingDiscountValue":{"type":"number","description":"Exact discount to be applied for the shipping value."},"absoluteShippingDiscountValue":{"type":"number","description":"Maximum value for the shipping."},"nominalDiscountValue":{"type":"number","description":"Exact discount to be applied for the total purchase value."},"nominalDiscountType":{"type":"string","description":"Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values:\r\n-`item`: applies the intended nominal discount on every item present on the cart. \r\n-`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items."},"maximumUnitPriceDiscount":{"type":"number","description":"The maximum price for each item of the purchase will be the price set up."},"percentualDiscountValue":{"type":"number","description":"Percentage discount to be applied for total purchase value."},"rebatePercentualDiscountValue":{"type":"number","description":"Percentual Shipping Discount Value."},"percentualShippingDiscountValue":{"type":"number","description":"Percentage discount to be applied for shipping value."},"percentualTax":{"type":"number","description":"Percentual tax over purchase total value."},"shippingPercentualTax":{"type":"number","description":"Shipping Percentual tax over purchase total value."},"percentualDiscountValueList1":{"type":"number","description":"Valid discounts for the SKUs in `listSku1BuyTogether`, discount list used for Buy Together Promotions."},"percentualDiscountValueList2":{"type":"number","description":"Equivalent to `percentualDiscountValueList1`."},"skusGift":{"type":"object","description":"SKU Gift Object. Total discount on the product value set as a gift.","properties":{"quantitySelectable":{"type":"integer","description":"Quantity of SKU Gifts."},"gifts":{"type":"integer","description":"Array with SKU Gifts IDs."}}},"nominalRewardValue":{"type":"number","description":"Nominal value for rewards program."},"percentualRewardValue":{"type":"number","description":"Percentage value for rewards program."},"orderStatusRewardValue":{"type":"string","description":"Order status reward value."},"maxNumberOfAffectedItems":{"type":"integer","description":"The maximum number of affected items for a promotion."},"maxNumberOfAffectedItemsGroupKey":{"type":"string","description":"The maximum number of affected items by group key for a promotion."},"applyToAllShippings":{"type":"boolean","description":"Promotion will be applied to all kind of shipping."},"nominalTax":{"type":"number","description":"Nominal tax."},"origin":{"type":"string","description":"Origin of the promotion, `marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information."},"idSeller":{"type":"string","description":"Seller Name."},"idSellerIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any seller present on the idSeller field. If set to `false`, sellers present on that field will make this promotion not to be applied."},"idsSalesChannel":{"type":"array","description":"List of Trade Policies that activate this promotion.","items":{"type":"string","description":"Trade policy ID."}},"areSalesChannelIdsExclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied."},"marketingTags":{"type":"array","description":"Promotion Marketing tags.","items":{"type":"string","description":"Promotion Marketing tag."}},"marketingTagsAreNotInclusive":{"type":"boolean","description":"If set to `false`, this promotion will be applied to any marketing tag present on the `marketingTags` field. If set to `true`, marketing tags present on that field will make this promotion not to be applied."},"paymentsMethods":{"type":"array","description":"Array composed by all the Payments Methods.","items":{"type":"object","description":"Object with information of the Payment Method.","properties":{"id":{"type":"string","description":"Payment Method ID."},"name":{"type":"string","description":"Payment Method Name."}}}},"stores":{"type":"array","description":"List of stores.","items":{"type":"string","description":"Store."}},"campaigns":{"type":"array","description":"Campaign Audiences that activate this promotion.","items":{"type":"string","description":"Campaign audience."}},"conditionsIds":{"type":"array","description":"Array with conditions IDs.","items":{"type":"string","description":"Condition ID."}},"storesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied."},"categories":{"type":"array","description":"Object composed by the categories that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the category.","properties":{"id":{"type":"string","description":"Category ID."},"name":{"type":"string","description":"Category Name."}}}},"categoriesAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied."},"brands":{"type":"array","description":"Object composed by the brands that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the brand.","properties":{"id":{"type":"string","description":"Brand ID."},"name":{"type":"string","description":"Brand Name."}}}},"brandsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied."},"products":{"type":"array","description":"Object composed by the products that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the product.","properties":{"id":{"type":"string","description":"Product ID."},"name":{"type":"string","description":"Product Name."}}}},"productsAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied."},"skus":{"type":"array","description":"Object composed by the SKUs that will activate or deactivate the promotion.","items":{"type":"object","description":"Object with information of the SKU.","properties":{"id":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU Name."}}}},"skusAreInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied."},"utmSource":{"type":"string","description":"Coupon utmSource code."},"utmCampaign":{"type":"string","description":"Coupon utmCampaign code."},"collections1BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"collections2BuyTogether":{"type":"array","description":"Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount** or **Buy One Get One**.","items":{"type":"object","description":"Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.","properties":{"id":{"type":"string","description":"ID of the collection to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the collection to be added to the first list of the **Buy Together** promotion."}}}},"minimumQuantityBuyTogether":{"type":"integer","description":"Minimum quantity for **Buy Together** promotion."},"quantityToAffectBuyTogether":{"type":"integer","description":"Quantity to affect **Buy Together** promotion."},"enableBuyTogetherPerSku":{"type":"boolean","description":"Enable **Buy Together** per SKU."},"listSku1BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the first list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the first list of the **Buy Together** promotion."}}}},"listSku2BuyTogether":{"type":"array","description":"Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","items":{"type":"object","description":"Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.","properties":{"id":{"type":"string","description":"ID of the SKU to be added to the second list of the **Buy Together** promotion."},"name":{"type":"string","description":"Name of the SKU to be added to the second list of the **Buy Together** promotion."}}}},"coupon":{"type":"array","description":"List of coupons.","items":{"type":"string","description":"Coupon code."}},"totalValueFloor":{"type":"number","description":"Minimum chart value to activate the promotion."},"totalValueCeling":{"type":"number","description":"Maximum chart value to activate the promotion."},"totalValueIncludeAllItems":{"type":"boolean","description":"Total value including all items."},"totalValueMode":{"type":"string","description":"If products that already are receiving a promotion, will be considered on the chart total value. There are three options available: `IncludeMatchedItems`, `ExcludeMatchedItems`, `AllItems`."},"collections":{"type":"array","description":"Array composed by the collections that will be activated or deactivated the promotion.","items":{"type":"object","description":"Object with information of the collection.","properties":{"id":{"type":"string","description":"Collection ID."},"name":{"type":"string","description":"Collection Name."}}}},"collectionsIsInclusive":{"type":"boolean","description":"If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied."},"restrictionsBins":{"type":"array","description":"The discount will be granted if the card's BIN is given.","items":{"type":"string","description":"Card's BIN."}},"cardIssuers":{"type":"array","description":"List of card issuers.","items":{"type":"string","description":"Card issuer."}},"totalValuePurchase":{"type":"number","description":"Total value a client must have in past orders to active the promotion."},"slasIds":{"type":"array","description":"The discount will be granted if the shipping method is the same as the one given.","items":{"type":"string","description":"Shipping method."}},"isSlaSelected":{"type":"boolean","description":"Applies selected discount only when one of the defined shipping method is selected by the customer."},"isFirstBuy":{"type":"boolean","description":"Applies the discount only if it's a first buy."},"firstBuyIsProfileOptimistic":{"type":"boolean","description":"Applies the discount even if the user is not logged."},"compareListPriceAndPrice":{"type":"boolean","description":"If the **List Price** and **Price** are the same."},"isDifferentListPriceAndPrice":{"type":"boolean","description":"Applies the promotion only if the list price and price is different."},"zipCodeRanges":{"type":"array","description":"Range of the zip code that applies the promotion.","items":{"type":"object","description":"Object with information of the Zip Code","properties":{"zipCodeFrom":{"type":"string","description":"Initial Zip Code."},"zipCodeTo":{"type":"string","description":"Final Zip Code."},"inclusive":{"type":"boolean","description":"Defines if the zip code range is included in the promotion."}}}},"itemMaxPrice":{"type":"number","description":"Maximum price of the item."},"itemMinPrice":{"type":"number","description":"Minimum price of the item."},"installment":{"type":"integer","description":"Installment."},"isMinMaxInstallments":{"type":"boolean","description":"Set if the promotion will be applied considering a minimum and maximum values for installments."},"minInstallment":{"type":"integer","description":"Minimum value for installment."},"maxInstallment":{"type":"integer","description":"Maximum value for installment."},"merchants":{"type":"array","description":"List of merchants.","items":{"type":"string","description":"Merchant."}},"clusterExpressions":{"type":"array","description":"Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).","items":{"type":"string","description":"Cluster expression."}},"clusterOperator":{"type":"string","description":"Cluster operator."},"paymentsRules":{"type":"array","description":"List of payment rules.","items":{"type":"string","description":"Payment rule."}},"giftListTypes":{"type":"array","description":"Gifts List Type.","items":{"type":"string","description":"Gift List Type."}},"productsSpecifications":{"type":"array","description":"List of product specifications.","items":{"type":"string","description":"Product specification."}},"affiliates":{"type":"array","description":"Marketplace order identifier. The discount will apply to selected affiliates.","items":{"type":"object","description":"Object with information of the affiliate.","properties":{"id":{"type":"string","description":"Affiliate ID."},"name":{"type":"string","description":"Affiliate Name."}}}},"maxUsage":{"type":"integer","description":"Defines how many times the promotion can be used."},"maxUsagePerClient":{"type":"integer","description":"Defines if the promotion can be used multiple times per client."},"shouldDistributeDiscountAmongMatchedItems":{"type":"boolean","description":"Should distribute discount among matched items."},"multipleUsePerClient":{"type":"boolean","description":"Defines if the promotion can be used multiple times per client."},"accumulateWithManualPrice":{"type":"boolean","description":"Allows the promotion to apply to products whose prices have been manually added by a call center operator."},"type":{"type":"string","description":"Defines what is the type of the promotion or indicates if it is a tax. Possible values: `regular` ([Regular Promotion](https://help.vtex.com/tutorial/regular-promotion--tutorials_327)), `combo` ([Buy Together](https://help.vtex.com/en/tutorial/buy-together--tutorials_323)), `forThePriceOf` ([More for Less](https://help.vtex.com/en/tutorial/creating-a-more-for-less-promotion--tutorials_325)), `progressive` ([Progressive Discount](https://help.vtex.com/en/tutorial/progressive-discount--tutorials_324)), `buyAndWin` ([Buy One Get One](https://help.vtex.com/en/tutorial/buy-one-get-one--tutorials_322)), `maxPricePerItem` (Deprecated), `campaign` ([Campaign Promotion](https://help.vtex.com/en/tutorial/campaign-promotion--1ChYXhK2AQGuS6wAqS8Ume)), `tax` (Tax), `multipleEffects` (Multiple Effects)."},"useNewProgressiveAlgorithm":{"type":"boolean","description":"Use new progressive algorithm."},"percentualDiscountValueList":{"type":"array","description":"Percentual discount value list.","items":{"type":"number","description":"Percentual discount value."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all promotions whose name contains the searched term. + + > 📘 Onboarding guide + > + > Check the new [Promotions onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/promotions-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about the Promotions and is organized by focusing on the developer's journey. + + + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `byName` | query | (Required) Search term used to find a promotion by name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "idCalculatorConfiguration": "5ee78a73-a77e-4f84-b54e-d0c75a4b101a", + "name": "Black shirt", + "beginDateUtc": "2021-11-09T03:00:00Z", + "endDateUtc": "2021-11-26T02:30:00Z", + "lastModified": "2021-11-16T22:09:55.071735Z", + "daysAgoOfPurchases": 0, + "isActive": true, + "isArchived": false, + "isFeatured": false, + "disableDeal": false, + "activeDaysOfWeek": [], + "offset": -3, + "activateGiftsMultiplier": false, + "newOffset": -3, + "maxPricesPerItems": [], + "cumulative": false, + "nominalShippingDiscountValue": 0, + "absoluteShippingDiscountValue": 0, + "nominalDiscountValue": 1, + "nominalDiscountType": "cart", + "maximumUnitPriceDiscount": 0, + "percentualDiscountValue": 0, + "rebatePercentualDiscountValue": 0, + "percentualShippingDiscountValue": 0, + "percentualTax": 0, + "shippingPercentualTax": 0, + "percentualDiscountValueList1": 0, + "percentualDiscountValueList2": 0, + "skusGift": { + "quantitySelectable": 1, + "gifts": 1 + }, + "nominalRewardValue": 0, + "percentualRewardValue": 0, + "orderStatusRewardValue": "invoiced", + "maxNumberOfAffectedItems": 0, + "maxNumberOfAffectedItemsGroupKey": "perCart", + "applyToAllShippings": false, + "nominalTax": 0, + "origin": "Marketplace", + "idSellerIsInclusive": true, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [], + "stores": [], + "campaigns": [], + "storesAreInclusive": true, + "categories": [], + "categoriesAreInclusive": true, + "brands": [], + "brandsAreInclusive": true, + "products": [ + { + "id": "1", + "name": "Pricing QA Test Product 1 (Produto 1)" + }, + { + "id": "3", + "name": "Pricing QA Test Product 3 (Produto 3)" + } + ], + "productsAreInclusive": true, + "skus": [], + "skusAreInclusive": true, + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 0, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [], + "listSku2BuyTogether": [], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": true, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": true, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "itemMaxPrice": 0, + "itemMinPrice": 0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "clusterOperator": "all", + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "accumulateWithManualPrice": false, + "type": "regular", + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Seller opt-in or opt-out.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Seller opt-in or opt-out.yml new file mode 100644 index 0000000000..ed1e7af4b9 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Seller opt-in or opt-out.yml @@ -0,0 +1,102 @@ +info: + name: Seller opt-in or opt-out + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/calculatorconfiguration/:promotionId/seller-opt?an=mystore" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: if-Match + value: 2025-05-27T14:05:41.7706903Z + params: + - name: an + value: mystore + type: query + - name: promotionId + value: d8a10358-cbb7-42ae-b020-91e104d997e7 + type: path + body: + type: json + data: |- + { + "sellerIds": [ + "seller-id-1", + "seller-id-2" + ], + "operation": "OptIn" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration/:promotionId/seller-opt - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration/:promotionId/seller-opt - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration/:promotionId/seller-opt - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rnb/pvt/calculatorconfiguration/:promotionId/seller-opt - Schema is valid", function () { + const schema = {"type":"object","properties":{"lastModified":{"type":"string","description":"Timestamp of the promotion's last modification (UTC)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds or removes one or more sellers to or from a specified promotion. + + >⚠️ When the first seller opts in to an inactive promotion, it's activated, and when the last seller opts out, it's deactivated. + + + ## Permissions + + Any 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 `401` error. These are the applicable resources for this endpoint + + | **Product** | **Category** | **Resource** | + | ----------------------- | ----------------------------- | ------------------------------------- | + | Rates and Benefits | Manage external seller promos | **External_Seller_Promotions** | + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `promotionId` | path | (Required) The ID of the promotion. | + | `an` | query | (Required) The VTEX account name that owns the promotion. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `if-Match` | header | (Required) Must match the current `lastModified` value of the promotion. | + + ## Example response (`200`) + + ```json + { + "lastModified": "2025-05-27T14:05:41.7706903Z" + } + ``` diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Unarchive promotion or tax.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Unarchive promotion or tax.yml new file mode 100644 index 0000000000..181dc520ec --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Unarchive promotion or tax.yml @@ -0,0 +1,61 @@ +info: + name: Unarchive promotion or tax + type: http + seq: 10 + +http: + method: POST + url: "{{baseUrl}}/api/rnb/pvt/unarchive/calculatorConfiguration/:idCalculatorConfiguration" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: idCalculatorConfiguration + value: d8a1cd2e-b667-4054-b3ae-b79124c7218e + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/rnb/pvt/unarchive/calculatorConfiguration/:idCalculatorConfiguration - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rnb/pvt/unarchive/calculatorConfiguration/:idCalculatorConfiguration - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Unarchives a promotion or tax by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `idCalculatorConfiguration` | path | (Required) Promotion ID or tax ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Update multiple SKU promotion.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Update multiple SKU promotion.yml new file mode 100644 index 0000000000..7ddc2f359b --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/Update multiple SKU promotion.yml @@ -0,0 +1,83 @@ +info: + name: Update multiple SKU promotion + type: http + seq: 8 + +http: + method: PUT + url: "{{baseUrl}}/api/rnb/pvt/import/calculatorConfiguration/:promotionId" + headers: + - name: Content-Type + value: text/csv + - name: Accept + value: application/json + - name: X-VTEX-calculator-name + value: Test + - name: X-VTEX-cumulative + value: "false" + disabled: true + - name: X-VTEX-cluster-operator + value: any + disabled: true + - name: X-VTEX-cluster-expression + value: cluster_name=true + disabled: true + - name: X-VTEX-start-date + value: 2020-08-18T16:00:00+3:00 + - name: X-VTEX-end-date + value: 2020-08-18T16:30:00+3:00 + - name: X-VTEX-accumulate-with-manual-prices + value: "false" + params: + - name: promotionId + value: dc6b6f59-ec2b-4a13-8490-0d1e0c53ddf9 + type: path + body: + type: file + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/rnb/pvt/import/calculatorConfiguration/:promotionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates information from a Multiple SKU promotion. This scenario allows the creation of a single promotion for multiple SKUs with the Percentage Effect. + >⚠️ The limit of SKUs on a Multiple Effects promotion is 400. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `promotionId` | path | (Required) Promotion unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `X-VTEX-calculator-name` | header | (Required) Promotion Name. | + | `X-VTEX-cumulative` | header | Defines if the Promotion is cumulative with other promotions. | + | `X-VTEX-cluster-operator` | header | This header allows implementing the Promotion in multiples client clusters. You can set the value as `all` - the Promotion will be valid to all the clusters - or `any` - the Promotion will be valid to any of the clusters. | + | `X-VTEX-cluster-expression` | header | Cluster that will be included in the Promotion. To add multiple clusters, create a header for each one of them. | + | `X-VTEX-start-date` | header | (Required) Promotion start date. | + | `X-VTEX-end-date` | header | (Required) Promotion end date. | + | `X-VTEX-accumulate-with-manual-prices` | header | (Required) Condition that will accumulate the Promotion with manual prices or not. | diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/folder.yml b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/folder.yml new file mode 100644 index 0000000000..e9b531199f --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/Promotions and taxes/folder.yml @@ -0,0 +1,4 @@ +info: + name: Promotions and taxes + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/environments/VTEX.yml b/BrunoCollections/VTEX - Promotions & Taxes API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Promotions & Taxes API/opencollection.yml b/BrunoCollections/VTEX - Promotions & Taxes API/opencollection.yml new file mode 100644 index 0000000000..5ed15802e8 --- /dev/null +++ b/BrunoCollections/VTEX - Promotions & Taxes API/opencollection.yml @@ -0,0 +1,80 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Promotions & Taxes API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + Check the new [Promotions onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/promotions-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Promotions and is organized by focusing on the developer's journey. + + The Promotions & Taxes API allows you to manage and retrieve all promotions, coupons and tax rules from your VTEX store. + + ## Index + + ### Promotions and taxes + - `GET` [Get all promotions](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/benefits/calculatorconfiguration) + - `GET` [Get all taxes](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/taxes/calculatorconfiguration) + - `GET` [Search promotion by name](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/benefits/calculatorconfiguration/search) + - `GET` [Get promotion or tax by ID](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/calculatorconfiguration/-idCalculatorConfiguration-) + - `POST` [Create or Update promotion or tax](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/calculatorconfiguration) + - `POST` [Create Multiple SKU promotion](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/import/calculatorConfiguration) + - `PUT` [Update Multiple SKU promotion](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#put-/api/rnb/pvt/import/calculatorConfiguration/-promotionId-) + - `POST` [Archive promotion or tax](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/archive/calculatorConfiguration/-idCalculatorConfiguration-) + - `POST` [Unarchive promotion or tax](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/unarchive/calculatorConfiguration/-idCalculatorConfiguration-) + - `GET` [List archived promotions](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/archive/benefits/calculatorConfiguration) + - `GET` [List archived taxes](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/archive/taxes/calculatorConfiguration) + - `POST`[Seller opt-in or opt-out](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api#post-/api/rnb/pvt/calculatorconfiguration/-promotionId-/seller-opt) + + ### Coupons + - `POST` [Create multiple coupons](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/multiple-coupons) + - `POST` [Create or update coupon](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/coupon) + - `GET` [Get coupon by coupon code](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/coupon/-couponCode-) + - `GET` [Get archived coupon by coupon code](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/archive/coupon/-couponCode-) + - `POST` [Archive coupon by coupon code](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/archive/coupon/-couponCode-) + - `GET` [Get all coupons](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/coupon) + - `POST` [Generate coupons in bulk](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/coupons) + - `GET` [Get coupon usage](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/coupon/usage/-couponCode-) + - `POST` [Unarchive coupon by coupon code](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/unarchive/coupon/-couponCode-) + + ### Prices (Legacy - v1) + - `GET` [Get Price by SKU ID](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/price-sheet/-skuId-) + - `DELETE` [Delete Price by SKU ID](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#delete-/price-sheet/-skuId-) + - `GET` [Get all paged prices](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/price-sheet/all/-page-/-pageSize-) + - `POST` [Get Price by context](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/price-sheet/context) + - `GET` [Get Price by SKU ID and trade policy](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/price-sheet/-skuId-/-tradePolicy-) + - `POST` [Save Price](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/price-sheet) + + ### Bundles + - `POST` [Calculate discounts and taxes (Bundles)](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/pub/bundles) + + ### Campaign Audiences + - `GET` [Get campaign audience configuration](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/campaignConfiguration/-campaignId-) + - `GET` [Get all campaign audiences](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#get-/api/rnb/pvt/campaignConfiguration) + - `POST` [Create campaign audience](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pvt/campaignConfiguration) + + ### Notifications + - `POST` [Usage notification](https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api/#post-/api/rnb/pub/notifications) + + + ## Common parameters in the documentation + + | Parameter name | Description | + | - | - | + | `{{accountName}}`| Name of the VTEX account. Used as part of the URL. | + | `{{environment}}`| Name of the VTEX account. Used as part of the URL. | + | `{{X-VTEX-API-AppKey}}` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | + | `{{X-VTEX-API-AppToken}}` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Punchout API/Punchout login/Finish punchout login flow.yml b/BrunoCollections/VTEX - Punchout API/Punchout login/Finish punchout login flow.yml new file mode 100644 index 0000000000..3dc29e0358 --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/Punchout login/Finish punchout login flow.yml @@ -0,0 +1,58 @@ +info: + name: Finish punchout login flow + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/authenticator/v1/punchout/finish?ott=xyz123" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: ott + value: xyz123 + type: query + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/authenticator/v1/punchout/finish - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Exchanges the one-time token (OTT) for VTEX session cookies and completes the authentication process. + + In browser-based integrations, this flow happens automatically when the user's browser accesses the URL returned by the start endpoint. + + For headless operations where no browser is involved, integrators must explicitly call this endpoint to obtain the necessary authentication cookies. + + This endpoint: + - Validates the OTT (checks existence, expiration, and single-use status) + - Creates a VTEX session (based on VTEX user or pre-authenticated user info) + - Sets authentication cookies (returned in response headers) + + The created session includes `authMethod: "Punchout"` to track the login source. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `ott` | query | (Required) One-time token obtained from the start endpoint. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Punchout API/Punchout login/Start VTEX user punchout flow.yml b/BrunoCollections/VTEX - Punchout API/Punchout login/Start VTEX user punchout flow.yml new file mode 100644 index 0000000000..d615ea3652 --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/Punchout login/Start VTEX user punchout flow.yml @@ -0,0 +1,87 @@ +info: + name: Start VTEX user punchout flow + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/authenticator/v1/punchout/start" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: returnURL + value: /path + type: query + disabled: true + body: + type: json + data: |- + { + "username": "user@example.com", + "password": "mypassword123" + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/authenticator/v1/punchout/start - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/authenticator/v1/punchout/start - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/authenticator/v1/punchout/start - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/authenticator/v1/punchout/start - Schema is valid", function () { + const schema = {"type":"object","properties":{"url":{"type":"string","description":"URL containing a one-time token for authentication. The token expires after 5 minutes and is single-use to prevent replay attacks."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Initiates punchout authentication for an existing VTEX user. + + This endpoint validates the credentials against the VTEX user database. If validation succeeds, it returns a URL containing a one-time token that can be accessed via web browser to start an authenticated session. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `returnURL` | query | Optional path that will complement the `storeHost` for post-authentication redirection. This value is validated against a list of authorized hosts to prevent open redirect vulnerabilities. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "url": "https://apiexamples.com/intermediate-path?token=xyz123" + } + ``` diff --git a/BrunoCollections/VTEX - Punchout API/Punchout login/Start pre-authenticated user punchout flow.yml b/BrunoCollections/VTEX - Punchout API/Punchout login/Start pre-authenticated user punchout flow.yml new file mode 100644 index 0000000000..89e90d1157 --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/Punchout login/Start pre-authenticated user punchout flow.yml @@ -0,0 +1,99 @@ +info: + name: Start pre-authenticated user punchout flow + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/authenticator/v1/punchout/authenticated/start" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: returnURL + value: /path + type: query + disabled: true + body: + type: json + data: |- + { + "username": "procurement.user@example.com" + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/authenticator/v1/punchout/authenticated/start - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/authenticator/v1/punchout/authenticated/start - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/authenticator/v1/punchout/authenticated/start - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/authenticator/v1/punchout/authenticated/start - Schema is valid", function () { + const schema = {"type":"object","properties":{"url":{"type":"string","description":"URL containing a one-time token for authentication. The token expires after 5 minutes and is single-use to prevent replay attacks."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Initiates punchout authentication for a pre-authenticated user who doesn't exist in VTEX. This endpoint must be called with valid API key/token credentials associated with a role with the CanPunchout permission. No password validation is performed as the caller is pre-authenticated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have the appropriate [License Manager resource](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. This is the applicable resource for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Vtex ID | Identity Providers | **CanPunchout** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `returnURL` | query | Optional path that will complement the `storeHost` for post-authentication redirection. This value is validated against a list of authorized hosts to prevent open redirect vulnerabilities. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "url": "https://apiexamples.com/intermediate-path?token=xyz123" + } + ``` diff --git a/BrunoCollections/VTEX - Punchout API/Punchout login/folder.yml b/BrunoCollections/VTEX - Punchout API/Punchout login/folder.yml new file mode 100644 index 0000000000..2d27056414 --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/Punchout login/folder.yml @@ -0,0 +1,4 @@ +info: + name: Punchout login + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Punchout API/environments/VTEX.yml b/BrunoCollections/VTEX - Punchout API/environments/VTEX.yml new file mode 100644 index 0000000000..6ef584ca4c --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: storeHost + value: apiexamples.com + - name: baseUrl + value: https://{{storeHost}} + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Punchout API/opencollection.yml b/BrunoCollections/VTEX - Punchout API/opencollection.yml new file mode 100644 index 0000000000..f4c9b56df3 --- /dev/null +++ b/BrunoCollections/VTEX - Punchout API/opencollection.yml @@ -0,0 +1,22 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Punchout API + +docs: + content: |- + The Punchout API enables seamless login integration between external procurement systems and VTEX. It allows procurement system users to authenticate into VTEX without manual credential management, using a secure OAuth2-like flow with real-time credential validation and one-time tokens (OTT). + + >ℹ️ Learn more about [Punchout login integration](https://developers.vtex.com/docs/guides/punchout-login-integration). + + ## Endpoint requirements + + - OTTs expire after 5 minutes and are single-use to prevent replay attacks. + - Return URLs are validated against authorized hosts to prevent open redirect vulnerabilities. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Events/Product view.yml b/BrunoCollections/VTEX - Recommendations BFF API/Events/Product view.yml new file mode 100644 index 0000000000..cc01ee0af0 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Events/Product view.yml @@ -0,0 +1,72 @@ +info: + name: Product view + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/recommend-bff/v2/events/product-view?an=apiexamples" + headers: + - name: x-vtex-rec-origin + value: apiexamples/storefront/vtex.recommendation-shelf@2.x + - name: user-agent + value: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 + disabled: true + - name: Content-Type + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "userId": "550e8400-e29b-41d4-a716-446655440000", + "product": "2000026", + "source": "WEB_DESKTOP", + "name": "Coca-Cola Lata 350ml", + "category": "Bebidas/Refrigerantes", + "url": "https://loja.com.br/coca-cola-lata-350ml/p" + } + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/recommend-bff/v2/events/product-view - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Records when a user views a product detail page. This event is used to measure performance and improve recommendations. + + ## When to send + + Send this event when the user opens a product detail page (PDP). + + ## Important notes + + - Always use the same session `recommendationsUserId` in the `userId` field for accurate tracking. + - When `source` is not provided, the API attempts to infer it from the `user-agent` header. + - For web integrations, use `WEB_DESKTOP` or `WEB_MOBILE`. + - For mobile app integrations, use `WEB_MOBILE` or `MOBILE_APP`. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. Must match the account name in the `x-vtex-rec-origin` header. | + | `x-vtex-rec-origin` | header | (Required) Required format: `{accountName}/{sourceType}/{appOrIntegrationId}`. Must match the `an` query parameter for account name. | + | `user-agent` | header | User agent string identifying the client application or browser. | diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation click.yml b/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation click.yml new file mode 100644 index 0000000000..adb0f539c1 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation click.yml @@ -0,0 +1,68 @@ +info: + name: Recommendation click + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/recommend-bff/v2/events/recommendation-click?an=apiexamples" + headers: + - name: x-vtex-rec-origin + value: apiexamples/storefront/vtex.recommendation-shelf@2.x + - name: Content-Type + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "userId": "198e0f50-acf8-42f7-998a-5cd125464749", + "correlationId": "d2e8c706-e67c-45d7-8de9-b80976960f89", + "product": "14", + "campaignId": "ca2acae8-41a4-4bcd-9ffd-0ac40b7c0a57" + } + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/recommend-bff/v2/events/recommendation-click - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Records when a user clicks on a recommended product. + + ## When to send + + **Web storefronts**: Automatically captured through Activity Flow when proper data attributes are rendered on each product card. See the integration guides for details. + + **Mobile apps**: Send this event when the user taps on a recommended product. + + ## Important notes + + - Always use the same session `recommendationsUserId` in the `userId` field for accurate tracking. + - Include the `correlationId` returned in the [Fetch recommendations](https://developers.vtex.com/docs/api-reference/recommendations-bff-api#get-/api/recommend-bff/v2/recommendations) response. + - Include the `campaignId` from `campaign.id` in the [Fetch recommendations](https://developers.vtex.com/docs/api-reference/recommendations-bff-api#get-/api/recommend-bff/v2/recommendations) response. + - The `product` field should contain the clicked product ID. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. Must match the account name in the `x-vtex-rec-origin` header. | + | `x-vtex-rec-origin` | header | (Required) Required format: `{accountName}/{sourceType}/{appOrIntegrationId}`. Must match the `an` query parameter for account name. | diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation view.yml b/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation view.yml new file mode 100644 index 0000000000..88754fc685 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Events/Recommendation view.yml @@ -0,0 +1,71 @@ +info: + name: Recommendation view + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/recommend-bff/v2/events/recommendation-view?an=apiexamples" + headers: + - name: x-vtex-rec-origin + value: apiexamples/storefront/vtex.recommendation-shelf@2.x + - name: Content-Type + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "userId": "198e0f50-acf8-42f7-998a-5cd125464749", + "correlationId": "d2e8c706-e67c-45d7-8de9-b80976960f89", + "products": [ + "14", + "12" + ], + "campaignId": "ca2acae8-41a4-4bcd-9ffd-0ac40b7c0a57" + } + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/recommend-bff/v2/events/recommendation-view - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Records when a recommendation shelf enters the viewport. + + ## When to send + + **Web storefronts**: Automatically captured through Activity Flow when proper data attributes are rendered on the shelf container. See the integration guides for details. + + **Mobile apps**: Send this event when the recommendation shelf becomes visible (e.g., when at least 50% of the shelf is visible for 1 second). Ensure events are properly debounced to prevent duplicates. + + ## Important notes + + - Always use the same session `recommendationsUserId` in the `userId` field for accurate tracking. + - Include the `correlationId` returned in the [Fetch recommendations](https://developers.vtex.com/docs/api-reference/recommendations-bff-api#get-/api/recommend-bff/v2/recommendations) response. + - Include the `campaignId` from `campaign.id` in the [Fetch recommendations](https://developers.vtex.com/docs/api-reference/recommendations-bff-api#get-/api/recommend-bff/v2/recommendations) response. + - The `products` array should contain all product IDs rendered in the shelf. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. Must match the account name in the `x-vtex-rec-origin` header. | + | `x-vtex-rec-origin` | header | (Required) Required format: `{accountName}/{sourceType}/{appOrIntegrationId}`. Must match the `an` query parameter for account name. | diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Events/folder.yml b/BrunoCollections/VTEX - Recommendations BFF API/Events/folder.yml new file mode 100644 index 0000000000..906ef75a61 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Events/folder.yml @@ -0,0 +1,4 @@ +info: + name: Events + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/Fetch recommendations.yml b/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/Fetch recommendations.yml new file mode 100644 index 0000000000..fdaac870c6 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/Fetch recommendations.yml @@ -0,0 +1,207 @@ +info: + name: Fetch recommendations + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/recommend-bff/v2/recommendations?an=apiexamples&campaignVrn=vrn:recommendations:apiexamples:rec-top-items-v2:123e4567-e89b-12d3-a456-426614174000" + headers: + - name: x-vtex-rec-origin + value: apiexamples/storefront/vtex.recommendation-shelf@2.x + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: campaignVrn + value: vrn:recommendations:apiexamples:rec-top-items-v2:123e4567-e89b-12d3-a456-426614174000 + type: query + - name: userId + value: 198e0f50-acf8-42f7-998a-5cd125464749 + type: query + disabled: true + - name: products + value: product-id-1,product-id-2,product-id-3 + type: query + disabled: true + - name: salesChannel + value: "1" + type: query + disabled: true + - name: locale + value: en-US + type: query + disabled: true + - name: zipCode + value: "90210" + type: query + disabled: true + - name: pickupPoint + value: pickup-1234 + type: query + disabled: true + - name: regionId + value: southeast-1 + type: query + disabled: true + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/recommend-bff/v2/recommendations - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/recommend-bff/v2/recommendations - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/recommend-bff/v2/recommendations - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/recommend-bff/v2/recommendations - Schema is valid", function () { + const schema = {"type":"object","description":"Response containing recommended products with full product details and campaign information.","properties":{"products":{"type":"array","description":"List of recommended products with full details including brand, name, images, and pricing.","items":{"type":"object","description":"Product object with full details.","properties":{"brand":{"type":"string","description":"Product brand name."},"productId":{"type":"string","description":"Product ID."},"productName":{"type":"string","description":"Product name."},"link":{"type":"string","description":"Product page URL path."},"tags":{"type":"array","description":"Product tags. When `advertisement` tag is present, the product is sponsored and should display a sponsored label.","items":{"type":"string","description":"Tag name."}},"items":{"type":"array","description":"List of SKUs for this product.","items":{"type":"object","description":"SKU object with variant details.","properties":{"itemId":{"type":"string","description":"SKU ID."},"nameComplete":{"type":"string","description":"Complete SKU name including variant information."},"images":{"type":"array","description":"SKU images.","items":{"type":"object","description":"Image object.","properties":{"imageUrl":{"type":"string","description":"Image URL."}}}},"sellers":{"type":"array","description":"List of sellers offering this SKU.","items":{"type":"object","description":"Seller object with pricing information.","properties":{"sellerId":{"type":"string","description":"Seller ID."},"commertialOffer":{"type":"object","description":"Commercial offer details.","properties":{"Price":{"type":"number","description":"Selling price."},"ListPrice":{"type":"number","description":"List price (before discount)."},"AvailableQuantity":{"type":"number","description":"Available stock quantity."}}}}}}}}}}}},"correlationId":{"type":"string","description":"Correlation ID for the recommendation request. Must be included when tracking recommendation view and click events."},"campaign":{"type":"object","description":"Campaign information.","properties":{"id":{"type":"string","description":"Campaign ID. Should be included when tracking recommendation view and click events."},"title":{"type":"string","description":"Campaign title."},"type":{"type":"string","description":"Campaign type. Supported types:\n\n- **TOP_ITEMS**: Most popular - products with the highest number of views.\n- **PERSONALIZED**: Recommended for you - custom recommendations based on user profile and behavior.\n- **SIMILAR_ITEMS**: Similar products - products similar to a specific one.\n- **CROSS_SELL**: Frequently bought together - complementary products commonly purchased together.\n- **CART_RECOMMENDATIONS**: Cart recommendations based on cart contents.\n- **LAST_SEEN**: Recently viewed - products recently viewed by the user.\n- **RECENT_INTERACTIONS**: Products the user recently interacted with.\n- **VISUAL_SIMILARITY**: Visually similar products - products visually similar to a specific one.\n- **SEARCH_BASED**: Manual collection - recommendations from a manually created collection.\n- **NEXT_INTERACTION**: Recent interactions - products most likely to engage the user in the future.","enum":["TOP_ITEMS","PERSONALIZED","SIMILAR_ITEMS","CROSS_SELL","CART_RECOMMENDATIONS","LAST_SEEN","RECENT_INTERACTIONS","VISUAL_SIMILARITY","SEARCH_BASED","NEXT_INTERACTION"]}},"required":["id","type"]}},"required":["products","correlationId","campaign"]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves recommended products with full product details based on the provided campaign VRN (Virtual Resource Name). + + The campaign VRN identifies a specific recommendation strategy and follows the format: `vrn:recommendations:{store-name}:{campaignType}:{campaignId}` + + You can obtain the full VRN from: + - [VTEX Support](https://help.vtex.com/en/support). + - VTEX Admin at **Storefront > Recommendations** (click the three dots next to a shelf and select **Copy ID**). + + ## Campaign types and requirements + + **Non-contextual campaigns** (no `products` parameter needed): + - `rec-top-items-v2`: Most popular (products with the highest number of views). + - `rec-persona-v2`: Recommended for you (custom recommendations based on user profile and behavior). + - `rec-last-v2`: Recently viewed (products recently viewed by the user). + - `rec-search-v2`: Manual collection (recommendations from a manually created collection). + + **Contextual campaigns** (require `products` parameter): + - `rec-similar-v2`: Similar products (products similar to a specific one). + - `rec-cross-v2`: Frequently bought together (complementary products commonly purchased together). + - `rec-visual-v2`: Visually similar products (products visually similar to a specific one). + - `rec-next-v2`: Recent interactions (products most likely to engage the user in the future). + - Cart recommendations (requires all product IDs currently in the cart). + + ## Response details + + - Returns full product objects with brand, name, link, items (SKUs), images, and pricing information. + - Products marked with the `advertisement` tag are sponsored and should display a sponsored label. + - The `correlationId` must be used when tracking recommendation view and click events. + - The `campaign.id` should be included in event tracking calls. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. Must match the account name in the `x-vtex-rec-origin` header. | + | `campaignVrn` | query | (Required) VRN identifier for an existing campaign, following the pattern: `vrn:recommendations:{store-name}:{campaignType}:{campaignId}`. Available campaign types: - `rec-top-items-v2`: Most popular (products with the highest number of views). - `rec-persona-v2`: Recommended for you (custom recommendations based on user profile and behavior). - `rec-similar-v2`: Similar products (products similar to a specific one). - `rec-cross-v2`: Frequently bought together (complementary products commonly purchased together). - `rec-cart-v2`: Cart-based recommendations. - `rec-last-v2`: Recently viewed (products recently viewed by the user). - `rec-visual-v2`: Visually similar products (products visually similar to a specific one). - `rec-search-v2`: Manual collection (recommendations from a manually created collection). - `rec-next-v2`: Recent interactions (products most likely to engage the user in the future). | + | `userId` | query | The `recommendationsUserId` returned by the `POST` [Start session](https://developers.vtex.com/docs/api-reference/recommendations-bff-api#post-/api/recommend-bff/v2/users/start-session) endpoint. Required for personalized recommendations based on user behavior. This value is also stored in the `vtex-rec-user-id` cookie. | + | `products` | query | Comma-separated list of product IDs for context-based recommendations. **Required** for: similar products (`rec-similar-v2`), buy together (`rec-cross-v2`), visually similar products (`rec-visual-v2`), next interaction (`rec-next-v2`), and cart recommendations. For similar items and cross-sell campaigns, send only **one product ID**. For cart recommendations, send **all product IDs** currently in the user's cart. | + | `salesChannel` | query | Trade policy ID. We also try to extract it from the segment cookie. If none is provided in the query, we will use the default trade policy. | + | `locale` | query | The user's locale information. If not provided, it is extracted from the segment cookie. This is important for multi-language stores. | + | `zipCode` | query | Zip code for location-based recommendations. If not provided, it is extracted from the segment cookie. | + | `pickupPoint` | query | Pickup point identifier for location-based recommendations. If not provided, it is extracted from the segment cookie. | + | `regionId` | query | Region identifier for location-based recommendations. If not provided, it is extracted from the segment cookie. | + | `x-vtex-rec-origin` | header | (Required) Required format: `{accountName}/{sourceType}/{appOrIntegrationId}`. Must match the `an` query parameter for account name. | + + ## Example response (`200`) + + ```json + { + "products": [ + { + "brand": "Mizuno", + "productId": "14", + "productName": "Standard Sunglasses", + "link": "/standard-sunglasses/p", + "items": [ + { + "itemId": "31", + "nameComplete": "Standard Sunglasses", + "images": [ + { + "imageUrl": "https://biggy.vtexassets.com/arquivos/ids/155412/images.png?v=637528820142830000" + } + ], + "sellers": [ + { + "sellerId": "1", + "commertialOffer": { + "Price": 330, + "ListPrice": 330, + "AvailableQuantity": 10000 + } + } + ] + } + ] + }, + { + "brand": "Google", + "productId": "12", + "productName": "Trail Backpack", + "link": "/trail-backpack/p", + "tags": [ + "advertisement" + ], + "items": [ + { + "itemId": "29", + "nameComplete": "Trail Backpack - variant 2", + "images": [ + { + "imageUrl": "https://biggy.vtexassets.com/arquivos/ids/155410/mochila-para-trilha-thule-alltrail-25l-masc-01.jpg?v=637528813555100000" + } + ], + "sellers": [ + { + "sellerId": "1", + "commertialOffer": { + "Price": 121, + "ListPrice": 121, + "AvailableQuantity": 10000 + } + } + ] + } + ] + } + ], + "correlationId": "d2e8c706-e67c-45d7-8de9-b80976960f89", + "campaign": { + "id": "ca2acae8-41a4-4bcd-9ffd-0ac40b7c0a57", + "title": "Complementary products", + "type": "CROSS_SELL" + } + } + ``` diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/folder.yml b/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/folder.yml new file mode 100644 index 0000000000..2e08ea4ade --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Recommendations/folder.yml @@ -0,0 +1,4 @@ +info: + name: Recommendations + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Users/Start session.yml b/BrunoCollections/VTEX - Recommendations BFF API/Users/Start session.yml new file mode 100644 index 0000000000..c29a5dbe1a --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Users/Start session.yml @@ -0,0 +1,111 @@ +info: + name: Start session + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/recommend-bff/v2/users/start-session?an=apiexamples" + headers: + - name: x-vtex-rec-origin + value: apiexamples/storefront/vtex.recommendation-shelf@2.x + - name: x-forwarded-host + value: www.apixamples.com + disabled: true + - name: host + value: apiexamples.vtexcommercestable.com.br + disabled: true + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "orderFormId": "d761924de4254f6883a8ec2e9a28597d" + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/recommend-bff/v2/users/start-session - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/recommend-bff/v2/users/start-session - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/recommend-bff/v2/users/start-session - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/recommend-bff/v2/users/start-session - Schema is valid", function () { + const schema = {"type":"object","description":"Response body for starting a user session. The returned ID is also stored in the `vtex-rec-user-id` cookie.","properties":{"recommendationsUserId":{"type":"string","description":"The recommendations user ID to use in subsequent API calls. This value is also stored in the `vtex-rec-user-id` cookie and saved in the orderForm custom data for purchase attribution."}},"required":["recommendationsUserId"]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Starts or updates a user's recommendation session by associating the `userId` with the current `orderFormId` and returning the `recommendationsUserId` to use in subsequent requests. + + This endpoint: + - Sets the `vtex-rec-user-id` cookie with the returned `recommendationsUserId`. + - Sets the `vtex-rec-user-start-session` cookie to control when a new session call is needed. + - Saves the recommendations identifier in the orderForm custom data for purchase attribution. + - Links anonymous browsing behavior to completed purchases when the order is processed. + + ## When to call + + **Web storefronts (headless or FastStore)**: + - On the first session load where an order form is available (via request body or `checkout.vtex.com` cookie). + - Every time the `vtex-rec-user-start-session` cookie expires. + - `orderFormId` is **optional** in the request body when the `checkout.vtex.com` cookie is forwarded (the API extracts it from the cookie). + + **Mobile apps**: + - On the first session load where an `orderFormId` exists. + - Every time the `orderFormId` changes. + - Both `userId` and `orderFormId` are **required** in the request body. + - Ensure the HTTP client preserves cookies or stores required values for subsequent calls. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. Must match the account name in the `x-vtex-rec-origin` header. | + | `x-vtex-rec-origin` | header | (Required) Origin identifier for tracking integration sources. Required format: `{accountName}/{sourceType}/{appOrIntegrationId}`. The account name must match the `an` query parameter. Example: `apiexamples/storefront/vtex.recommendation-shelf@2.x` | + | `x-forwarded-host` | header | Forwarded host header, typically containing the original host requested by the client. | + | `host` | header | Host header containing the domain name of the API server. | + + ## Example response (`200`) + + ```json + { + "recommendationsUserId": "198e0f50-acf8-42f7-998a-5cd125464749" + } + ``` diff --git a/BrunoCollections/VTEX - Recommendations BFF API/Users/folder.yml b/BrunoCollections/VTEX - Recommendations BFF API/Users/folder.yml new file mode 100644 index 0000000000..bfe290a5e9 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/Users/folder.yml @@ -0,0 +1,4 @@ +info: + name: Users + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Recommendations BFF API/environments/VTEX.yml b/BrunoCollections/VTEX - Recommendations BFF API/environments/VTEX.yml new file mode 100644 index 0000000000..e02e45732b --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://api.{{environment}}.com.br diff --git a/BrunoCollections/VTEX - Recommendations BFF API/opencollection.yml b/BrunoCollections/VTEX - Recommendations BFF API/opencollection.yml new file mode 100644 index 0000000000..d7ddf69da4 --- /dev/null +++ b/BrunoCollections/VTEX - Recommendations BFF API/opencollection.yml @@ -0,0 +1,30 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Recommendations BFF API + +docs: + content: |- + The Recommendations BFF API allows VTEX stores, integrators, and partners to fetch product recommendations, record user/product events, and manage recommendation sessions for headless, FastStore, and mobile storefronts. + + This API powers personalized and contextual product recommendations, tracks user interactions, and enables advanced analytics. It supports multiple recommendation strategies including best sellers, personalized recommendations, similar products, cross-sell, and visually similar items. + + > ℹ️ This feature is in beta. For questions about enablement, account configuration, or campaigns, contact [VTEX Support](https://help.vtex.com/en/support). + + ## Integration guides + + - [Integrating product recommendations in headless or FastStore web stores](https://developers.vtex.com/docs/guides/integrating-product-recommendations-in-headless-or-faststore-web-stores) + - [Integrating product recommendations in mobile stores](https://developers.vtex.com/docs/guides/integrating-product-recommendations-in-mobile-stores) + + ## Event tracking + + **Web storefronts (headless or FastStore)**: Recommendation shelf view and click events are automatically captured through [Activity Flow](https://developers.vtex.com/docs/guides/activity-flow) when proper data attributes are rendered on shelf elements. Cart and order events are also automatically captured. Product view events must be sent via this API. + + **Mobile apps**: All events (recommendation view, recommendation click, and product view) must be sent via this API. Cart and order events require [Activity Flow integration for mobile apps](https://developers.vtex.com/docs/guides/installing-activity-flow-in-mobile-apps). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Add Subscription item.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Add Subscription item.yml new file mode 100644 index 0000000000..310fe379db --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Add Subscription item.yml @@ -0,0 +1,63 @@ +info: + name: Add Subscription item + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/subscriptions/:recurrenceId/items" + headers: + - name: Content-Type + value: application/json + params: + - name: recurrenceId + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + [ + { + "sku": "20", + "seller": "1", + "quantity": 2, + "frequency": { + "periodicity": "monthly", + "interval": 1 + }, + "shippingAddressId": "-1461618656161" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/subscriptions/:recurrenceId/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds an item to a Subscription (formerly Recurrence). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription addresses.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription addresses.yml new file mode 100644 index 0000000000..d6a3f24461 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription addresses.yml @@ -0,0 +1,45 @@ +info: + name: Get Subscription addresses + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/:recurrenceId/addresses" + params: + - name: recurrenceId + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/:recurrenceId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the addresses attached to a given subscription (formerly recurrence) by recurrenceId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription by recurrenceId.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription by recurrenceId.yml new file mode 100644 index 0000000000..40b0c5d71d --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription by recurrenceId.yml @@ -0,0 +1,45 @@ +info: + name: Get Subscription by recurrenceId + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/:recurrenceId" + params: + - name: recurrenceId + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/:recurrenceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a given Subscription (formerly recurrence) by recurrenceId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription settings.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription settings.yml new file mode 100644 index 0000000000..bbd8b36720 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscription settings.yml @@ -0,0 +1,41 @@ +info: + name: Get Subscription settings + type: http + seq: 9 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/settings" + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves your store's Subscriptions' (formerly recurrence) settings. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscriptions.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscriptions.yml new file mode 100644 index 0000000000..44c46ef52b --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get Subscriptions.yml @@ -0,0 +1,49 @@ +info: + name: Get Subscriptions + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/subscriptions?email={{email}}&cycleStatus={{cycleStatus}}" + params: + - name: email + value: "{{email}}" + type: query + - name: cycleStatus + value: "{{cycleStatus}}" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a given Subscription (formerly recurrence). There are three options of filtering your Subscruptions v1. It's possible to get a list of all Subscriptions v1, by not adding any query params to your request, and simply executing a call to the url. It is also possible to list the Subscriptions by email, filtering by the email query param. And finnally, it is possible to list recurrences with failures on the last execution cycle, filtering by the cycleStatus query param. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `email` | query | If you wish to list tasks by email, insert the desired user's email. | + | `cycleStatus` | query | If you wish to list tasks by Subscriptions with failures on the last execution cycle, insert the desired cycleStatus. | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get payment accounts.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get payment accounts.yml new file mode 100644 index 0000000000..6c12268cac --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get payment accounts.yml @@ -0,0 +1,45 @@ +info: + name: Get payment accounts + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/:recurrenceid/accounts" + params: + - name: recurrenceid + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/:recurrenceid/accounts - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists payment accounts of a given Subscription (formerly Recurrence) by recurrenceId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceid` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get self Subscription.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get self Subscription.yml new file mode 100644 index 0000000000..34698ea6a5 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Get self Subscription.yml @@ -0,0 +1,41 @@ +info: + name: Get self Subscription + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/me" + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/me - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists details of your self Subscription (formerly Recurrence). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Reindex Subscription.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Reindex Subscription.yml new file mode 100644 index 0000000000..37f55c12ef --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Reindex Subscription.yml @@ -0,0 +1,59 @@ +info: + name: Reindex Subscription + type: http + seq: 6 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions/:recurrenceId/reindex" + headers: + - name: Content-Type + value: application/json + params: + - name: recurrenceId + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + [ + { + "frequency": { + "periodicity": "yearly", + "interval": 1 + } + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions/:recurrenceId/reindex - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Alters the frequency of a given Subscription (formerly Recurrence) by changing period and interval. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription settings.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription settings.yml new file mode 100644 index 0000000000..ce6b9071c4 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription settings.yml @@ -0,0 +1,51 @@ +info: + name: Update Subscription settings + type: http + seq: 10 + +http: + method: PUT + url: "{{baseUrl}}/subscriptions/settings" + headers: + - name: Content-Type + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "salesChannel": "1", + "defaultSLA": "Normal" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/subscriptions/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the Subscriptions' (formerly Recurrence) settings of your store by salesChannel and defaultSLA. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription.yml new file mode 100644 index 0000000000..45fefbb48a --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update Subscription.yml @@ -0,0 +1,65 @@ +info: + name: Update Subscription + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/subscriptions" + headers: + - name: Content-Type + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "email": "user@vtex.com.br", + "deliveryDay": 26, + "deliveryWeekday": "Friday", + "items": [ + { + "sku": "18", + "seller": "1", + "quantity": 2, + "frequency": { + "periodicity": "weekly", + "interval": 1 + }, + "shippingAddressId": "-1461618656161" + } + ], + "paymentAccountId": "87FE21B06C0D42908D31A5B11E6FC043" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates details of a given Subscription (formerly recurrence). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update partial Subscription.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update partial Subscription.yml new file mode 100644 index 0000000000..df06eeb978 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/Update partial Subscription.yml @@ -0,0 +1,56 @@ +info: + name: Update partial Subscription + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions/:recurrenceId" + headers: + - name: Content-Type + value: application/json + params: + - name: recurrenceId + value: cupidatat esse proident irure + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "deliveryDay": 18, + "deliveryWeekday": "Monday", + "status": "inactive" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions/:recurrenceId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates partial information of a given subscription (formerly Recurrence). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `recurrenceId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/folder.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/folder.yml new file mode 100644 index 0000000000..11e5922cac --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/Miscellaneous/folder.yml @@ -0,0 +1,4 @@ +info: + name: Miscellaneous + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/environments/VTEX.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/environments/VTEX.yml new file mode 100644 index 0000000000..7edf97864b --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/environments/VTEX.yml @@ -0,0 +1,14 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api + - name: cycleStatus + value: "" + - name: email + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/opencollection.yml b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/opencollection.yml new file mode 100644 index 0000000000..9ffa237a32 --- /dev/null +++ b/BrunoCollections/VTEX - Recurrence (v1 - deprecated)/opencollection.yml @@ -0,0 +1,17 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Recurrence (v1 - deprecated) + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Rating/Get product rating.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Rating/Get product rating.yml new file mode 100644 index 0000000000..0116aaf008 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Rating/Get product rating.yml @@ -0,0 +1,83 @@ +info: + name: Get product rating + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/reviews-and-ratings/api/rating/:productId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/reviews-and-ratings/api/rating/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/reviews-and-ratings/api/rating/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/reviews-and-ratings/api/rating/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/reviews-and-ratings/api/rating/:productId - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"average":{"description":"Average rating of the product.","type":"number"},"totalCount":{"description":"Total amount of ranting of the product.","type":"number"},"starsFive":{"description":"Total five-star ratings received by the product.","type":"number"},"starsFour":{"description":"Total four-star ratings received by the product.","type":"number"},"starsThree":{"description":"Total three-star ratings received by the product.","type":"number"},"starsTwo":{"description":"Total two-star ratings received by the product.","type":"number"},"starsOne":{"description":"Total one-star ratings received by the product.","type":"number"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the rating of a product. + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product ID. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "average": 3.25, + "starsFive": 4, + "starsFour": 0, + "starsThree": 1, + "starsTwo": 0, + "starsOne": 3, + "totalCount": 8 + } + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Rating/folder.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Rating/folder.yml new file mode 100644 index 0000000000..63b51639c9 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Rating/folder.yml @@ -0,0 +1,4 @@ +info: + name: Rating + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create a review.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create a review.yml new file mode 100644 index 0000000000..149dd77a57 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create a review.yml @@ -0,0 +1,102 @@ +info: + name: Create a review + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/reviews-and-ratings/api/review" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "productId": "65444", + "rating": 5, + "title": "Good Product", + "text": "It is the best product that I have seen", + "reviewerName": "Arturo", + "approved": true + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/reviews-and-ratings/api/review - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/reviews-and-ratings/api/review - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/reviews-and-ratings/api/review - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/reviews-and-ratings/api/review - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"id":{"description":"Review ID.","type":"string"},"productId":{"description":"Product ID.","type":"string"},"rating":{"description":"Customer rating.","type":"number"},"title":{"description":"Review's title.","type":"string"},"text":{"description":"Review's text.","type":"string"},"reviewerName":{"description":"Reviewer name.","type":"string"},"shopperId":{"description":"Shopper email.","type":"string"},"reviewDateTime":{"description":"Review's date and time.","type":"string"},"searchDate":{"description":"Review's search date.","type":"string"},"verifiedPurchaser":{"description":"Indicates if the reviewer is a verified purchaser (`true`) or not (`false`).","type":"boolean"},"sku":{"description":"SKU ID.","type":["string","null"]},"approved":{"description":"Indicates if the review was approved (`true`) or not (`false`).","type":"boolean"},"location":{"description":"Review's origin location.","type":["string","null"]},"locale":{"description":"Review's locale.","type":["string","null"]},"pastReviews":{"description":"Past reviews of the same product.","type":["string","null"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a single review. + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + For authentication, you must generate and use only your `VtexidClientAutCookie` to work with this endpoint. Refer to the [Generating user tokens](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens#generating-a-user-token-with-the-vtex-io-cli) guide for more information. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", + "productId": "65444", + "rating": 5, + "title": "Good Product", + "text": "It is the best product that I have seen", + "reviewerName": "Arturo", + "shopperId": "user@email.com", + "reviewDateTime": "04/19/2022 18:55:58", + "searchDate": "2022-04-19T18:55:58Z", + "verifiedPurchaser": false, + "sku": "2", + "approved": false, + "location": null, + "locale": "en-US", + "pastReviews": null + } + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create multiple reviews.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create multiple reviews.yml new file mode 100644 index 0000000000..a74f6d803b --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Create multiple reviews.yml @@ -0,0 +1,97 @@ +info: + name: Create multiple reviews + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/reviews-and-ratings/api/reviews" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "id": "1", + "productId": "65444", + "rating": 4, + "title": "Great product", + "text": "Great product!", + "reviewerName": "Arturo", + "approved": true + }, + { + "id": "2", + "productId": "65444", + "rating": 4, + "title": "Great product", + "text": "Great product!", + "reviewerName": "Arturo", + "approved": true + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/reviews-and-ratings/api/reviews - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/reviews-and-ratings/api/reviews - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/reviews-and-ratings/api/reviews - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/reviews-and-ratings/api/reviews - Schema is valid", function () { + const schema = {"description":"List of review IDs.","type":"array","items":{"description":"Review ID.","type":"string"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates multiple reviews for more than one product in a single operation. + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + For authentication, you must generate and use only the API key and the Application Token to work with this endpoint. Refer to the [API authentication using application keys](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) and [Generating internal application keys](https://help.vtex.com/en/tutorial/api-keys--2iffYzlvvz4BDMr6WGUtet#generating-internal-api-keys) guide for more information. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + "8e1a5e11-c0c9-11ec-835d-0a591b8a3ec1", + "9257c203-c0c9-11ec-835d-0e02dd207951" + ] + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete multiple reviews.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete multiple reviews.yml new file mode 100644 index 0000000000..72c7a0a4d7 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete multiple reviews.yml @@ -0,0 +1,78 @@ +info: + name: Delete multiple reviews + type: http + seq: 6 + +http: + method: DELETE + url: "{{baseUrl}}/reviews-and-ratings/api/reviews" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + "babefcf4-e0f7-11ec-835d-16c4e59c4351", + "c123def5-e0f7-11ec-835d-16c4e59c4352" + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/reviews-and-ratings/api/reviews - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/reviews-and-ratings/api/reviews - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/reviews-and-ratings/api/reviews - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/reviews-and-ratings/api/reviews - Schema is valid", function () { + const schema = {"description":"Indicates if the review was deleted (`true`) or not (`false`).","type":"boolean"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes multiple reviews at once. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete review.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete review.yml new file mode 100644 index 0000000000..d3a0f7ac73 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Delete review.yml @@ -0,0 +1,80 @@ +info: + name: Delete review + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/reviews-and-ratings/api/review/:reviewId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reviewId + value: "1" + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/reviews-and-ratings/api/review/:reviewId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/reviews-and-ratings/api/review/:reviewId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/reviews-and-ratings/api/review/:reviewId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/reviews-and-ratings/api/review/:reviewId - Schema is valid", function () { + const schema = {"description":"Indicates if the review was deleted (`true`) or not (`false`).","type":"boolean"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes an existing review. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reviewId` | path | (Required) Review ID. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get list of reviews.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get list of reviews.yml new file mode 100644 index 0000000000..3b2f752103 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get list of reviews.yml @@ -0,0 +1,160 @@ +info: + name: Get list of reviews + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/reviews-and-ratings/api/reviews" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: search_term + value: search_term + type: query + disabled: true + - name: from + value: "0" + type: query + disabled: true + - name: to + value: "3" + type: query + disabled: true + - name: order_by + value: SearchDate:asc + type: query + disabled: true + - name: status + value: "true" + type: query + disabled: true + - name: product_id + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/reviews-and-ratings/api/reviews - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/reviews-and-ratings/api/reviews - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/reviews-and-ratings/api/reviews - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/reviews-and-ratings/api/reviews - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"data":{"description":"Array of reviews.","type":"array","items":{"description":"Review's information.","type":"object","properties":{"id":{"description":"Review ID.","type":"string"},"productId":{"description":"Product ID.","type":"string"},"rating":{"description":"Customer rating.","type":"number"},"title":{"description":"Review's title.","type":"string"},"text":{"description":"Review's text.","type":"string"},"reviewerName":{"description":"Reviewer name.","type":"string"},"shopperId":{"description":"Shopper email.","type":"string"},"reviewDateTime":{"description":"Review's date and time.","type":"string"},"searchDate":{"description":"Review's search date.","type":"string"},"verifiedPurchaser":{"description":"Indicates if the reviewer is a verified purchaser (`true`) or not (`false`).","type":"boolean"},"sku":{"description":"SKU ID.","type":["string","null"]},"approved":{"description":"Indicates if the review was approved (`true`) or not (`false`).","type":"boolean"},"location":{"description":"Review's origin location.","type":["string","null"]},"locale":{"description":"Review's locale.","type":["string","null"]},"pastReviews":{"description":"Past reviews of the same product.","type":["string","null"]}}}},"range":{"description":"Range of the reviews list.","type":"object","properties":{"total":{"description":"Total number of reviews on the list.","type":"number"},"from":{"description":"Zero base starting record number.","type":"number"},"to":{"description":"Zero base ending record number.","type":"number"}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of reviews related to a product. + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `search_term` | query | Returns Reviews that contain the search term in `productId`, `sku`, `shopperId`, or `reviewerName`. | + | `from` | query | Zero base starting record number, `0` is the default value. | + | `to` | query | Zero base ending record number, `3` is the default value. | + | `order_by` | query | Field name to order records. The field name must have the first letter uppercase. Allowed field names: `ProductId`, `ShopperId`, `Approved`, `ReviewDateTime`, `SearchDate`, `Rating`, `Locale`. Optionally add `:asc` or `:desc`. | + | `status` | query | Status of the review, approved (`true`) or not (`false`). | + | `product_id` | query | Filter the reviews by product ID. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "data": [ + { + "id": "1", + "productId": "880035", + "rating": 3, + "title": "anon", + "text": "anon", + "reviewerName": "anon", + "shopperId": "anon@email.com", + "reviewDateTime": "06/02/2021 20:58:43", + "searchDate": "2021-06-02T20:58:43Z", + "verifiedPurchaser": false, + "sku": null, + "approved": true, + "location": "", + "locale": null, + "pastReviews": null + }, + { + "id": "2", + "productId": "880035", + "rating": 5, + "title": "logged in", + "text": "it's cool", + "reviewerName": "Brian", + "shopperId": "brian@email.com.br", + "reviewDateTime": "06/02/2021 21:00:00", + "searchDate": "2021-06-02T21:00:00Z", + "verifiedPurchaser": false, + "sku": null, + "approved": true, + "location": "", + "locale": null, + "pastReviews": null + }, + { + "id": "c66d8bc0-787c-11ec-82ac-028dd4526e77", + "productId": "880035", + "rating": 3, + "title": "Korean", + "text": "ko-KR", + "reviewerName": "ko-KR", + "shopperId": "user@email.com", + "reviewDateTime": "01/18/2022 16:36:33", + "searchDate": "2022-01-18T16:36:33Z", + "verifiedPurchaser": false, + "sku": null, + "approved": true, + "location": null, + "locale": "ko-KR", + "pastReviews": null + } + ], + "range": { + "total": 26, + "from": 0, + "to": 3 + } + } + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get product review by review ID.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get product review by review ID.yml new file mode 100644 index 0000000000..37ccc7fee0 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Get product review by review ID.yml @@ -0,0 +1,92 @@ +info: + name: Get product review by review ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/reviews-and-ratings/api/review/:reviewId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reviewId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/reviews-and-ratings/api/review/:reviewId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/reviews-and-ratings/api/review/:reviewId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/reviews-and-ratings/api/review/:reviewId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/reviews-and-ratings/api/review/:reviewId - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"id":{"description":"Review ID.","type":"string"},"productId":{"description":"Product ID.","type":"string"},"rating":{"description":"Customer rating.","type":"number"},"title":{"description":"Review's title.","type":"string"},"text":{"description":"Review's text.","type":"string"},"reviewerName":{"description":"Reviewer name.","type":"string"},"shopperId":{"description":"Shopper email.","type":"string"},"reviewDateTime":{"description":"Review's date and time.","type":"string"},"searchDate":{"description":"Review's search date.","type":"string"},"verifiedPurchaser":{"description":"Indicates if the reviewer is a verified purchaser (`true`) or not (`false`).","type":"boolean"},"sku":{"description":"SKU ID.","type":["string","null"]},"approved":{"description":"Indicates if the review was approved (`true`) or not (`false`).","type":"boolean"},"location":{"description":"Review's origin location.","type":["string","null"]},"locale":{"description":"Review's locale.","type":["string","null"]},"pastReviews":{"description":"Past reviews of the same product.","type":["string","null"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information of a product review based on the review's ID. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reviewId` | path | (Required) Review ID. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", + "productId": "1", + "rating": 5, + "title": "Great product", + "text": "Great product.", + "reviewerName": "Arturo", + "shopperId": "user@email.com", + "reviewDateTime": "04/19/2022 18:55:58", + "searchDate": "2022-04-19T18:55:58Z", + "verifiedPurchaser": false, + "sku": "2", + "approved": false, + "location": null, + "locale": "en-US", + "pastReviews": null + } + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/Update a review.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Update a review.yml new file mode 100644 index 0000000000..b302162531 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/Update a review.yml @@ -0,0 +1,105 @@ +info: + name: Update a review + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/reviews-and-ratings/api/review/:reviewId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reviewId + value: 5323fdaa-c012-11ec-835d-0ebee58edbb3 + type: path + body: + type: json + data: |- + { + "productId": "1", + "rating": 5, + "title": "Great product", + "text": "Great product.", + "reviewerName": "Arturo", + "shopperId": "user@email.com", + "verifiedPurchaser": false, + "locale": "en-US" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/reviews-and-ratings/api/review/:reviewId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/reviews-and-ratings/api/review/:reviewId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/reviews-and-ratings/api/review/:reviewId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/reviews-and-ratings/api/review/:reviewId - Schema is valid", function () { + const schema = {"description":"Response body object.","type":"object","properties":{"id":{"description":"Review ID.","type":"string"},"productId":{"description":"Product ID.","type":"string"},"rating":{"description":"Customer rating.","type":"number"},"title":{"description":"Review's title.","type":"string"},"text":{"description":"Review's text.","type":"string"},"reviewerName":{"description":"Reviewer name.","type":"string"},"shopperId":{"description":"Shopper email.","type":"string"},"reviewDateTime":{"description":"Review's date and time.","type":"string"},"searchDate":{"description":"Review's search date.","type":"string"},"verifiedPurchaser":{"description":"Indicates if the reviewer is a verified purchaser (`true`) or not (`false`).","type":"boolean"},"sku":{"description":"SKU ID.","type":["string","null"]},"approved":{"description":"Indicates if the review was approved (`true`) or not (`false`).","type":"boolean"},"location":{"description":"Review's origin location.","type":["string","null"]},"locale":{"description":"Review's locale.","type":["string","null"]},"pastReviews":{"description":"Past reviews of the same product.","type":["string","null"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the information of a review. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reviewId` | path | (Required) Review ID. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", + "productId": "1", + "rating": 5, + "title": "Great product", + "text": "Great product.", + "reviewerName": "Arturo", + "shopperId": "user@email.com", + "reviewDateTime": "04/19/2022 18:55:58", + "searchDate": "2022-04-19T18:55:58Z", + "verifiedPurchaser": false, + "sku": "2", + "approved": false, + "location": null, + "locale": "en-US", + "pastReviews": null + } + ``` diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/Review/folder.yml b/BrunoCollections/VTEX - Reviews and Ratings API/Review/folder.yml new file mode 100644 index 0000000000..19141cf6f1 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/Review/folder.yml @@ -0,0 +1,4 @@ +info: + name: Review + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/environments/VTEX.yml b/BrunoCollections/VTEX - Reviews and Ratings API/environments/VTEX.yml new file mode 100644 index 0000000000..f2b56a3347 --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/environments/VTEX.yml @@ -0,0 +1,8 @@ +name: VTEX +variables: + - name: accountName + value: storecomponents + - name: baseUrl + value: https://{{accountName}}.myvtex.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Reviews and Ratings API/opencollection.yml b/BrunoCollections/VTEX - Reviews and Ratings API/opencollection.yml new file mode 100644 index 0000000000..4ad921ea2e --- /dev/null +++ b/BrunoCollections/VTEX - Reviews and Ratings API/opencollection.yml @@ -0,0 +1,21 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Reviews and Ratings API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: "[Reviews & Ratings](https://developers.vtex.com/vtex-developer-docs/docs/vtex-reviews-and-ratings) is a VTEX IO app that allows shoppers to submit reviews and ratings for products, and view them while navigating the store. With the Reviews and Ratings API you can manage the reviews and ratings associated with the products in your store." + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Activate SKU binding.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Activate SKU binding.yml new file mode 100644 index 0000000000..69e39f57fd --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Activate SKU binding.yml @@ -0,0 +1,62 @@ +info: + name: Activate SKU binding + type: http + seq: 10 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/activate/:sellerId/:skuSellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: skuSellerId + value: "71" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/activate/:sellerId/:skuSellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the status of an SKU binding to active, setting `isActive` to `true`. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/activate/{sellerId}/{skuSellerId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `skuSellerId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Bind a seller's SKU to another SKU.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Bind a seller's SKU to another SKU.yml new file mode 100644 index 0000000000..17b485e50f --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Bind a seller's SKU to another SKU.yml @@ -0,0 +1,73 @@ +info: + name: Bind a seller's SKU to another SKU + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: sellerSkuId + value: "1" + type: path + body: + type: json + data: |- + { + "StockKeepingUnitId": 1 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Associates a seller's SKU to another marketplace SKU. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/{sellerId}/{sellerSkuId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with SKU ID.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with SKU ID.yml new file mode 100644 index 0000000000..9875e779b3 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with SKU ID.yml @@ -0,0 +1,60 @@ +info: + name: Change notification with SKU ID + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/changenotification/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "10" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/changenotification/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends a seller notification to the VTEX marketplace about a SKU suggestion using the SKU ID. It can be either a new suggestion or an update to an existing one. For example, a seller SKU previously approved by the marketplace may have had price or inventory changes. + + This request does not require a request body. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/changenotification/{skuId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) A string that identifies the SKU in the marketplace. This is the ID that the marketplace will use to look for the SKU whose change the seller wants to inform. If the marketplace finds this ID, it responds with status code `200`. Otherwise, it responds with status code `404`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with seller ID and seller SKU ID.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with seller ID and seller SKU ID.yml new file mode 100644 index 0000000000..9b1eaafeaf --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Change notification with seller ID and seller SKU ID.yml @@ -0,0 +1,82 @@ +info: + name: Change notification with seller ID and seller SKU ID + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/changenotification/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: sellerSkuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/changenotification/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends a seller notification to the VTEX marketplace about a SKU suggestion, which can be either a new suggestion or an update. For example, a seller SKU previously approved by the marketplace may have had price or inventory changes. + + The main information sent by the seller is its identification (`sellerId`) and the SKU binding code (`sellerSkuId`), both passed as path parameters. This request doesn't require a request body. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/changenotification/{sellerId}/{sellerSkuId}`. + + ## Example + + Let's say your seller has the ID `123` in the marketplace, and you want to inform the marketplace that there has been a change to the SKU with ID `700`. + + In this case, you would replace the `sellerId` parameter with the value `123`, and the `sellerSkuId` parameter with the value `700`. The URL would be the following: + + ``` + https://accountName.vtexcommercestable.com.br/api/sku-binding/pvt/skuseller/changenotification/123/700 + ``` + + ## Response codes + + The following response codes are possible: + * 200: The SKU whose ID was informed in the URL already exists in the marketplace and was found. The marketplace can now proceed with a fulfillment simulation in order to get updated information about this SKU's inventory and price. + * 403: Failure in the authentication. + * 404: The SKU was not found in the marketplace. The body of the response, in this case, should follow this format: "Seller StockKeepingUnit `{{skuId}}` not found for this seller id `{{sellerId}}`. This means that the seller can now proceed with sending an offer to the marketplace in order to suggest that this SKU is sold there. + * 429: Failure due to too many requests. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) ID of the binding of the seller with the SKU. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Deactivate SKU binding.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Deactivate SKU binding.yml new file mode 100644 index 0000000000..4e59d3d840 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Deactivate SKU binding.yml @@ -0,0 +1,62 @@ +info: + name: Deactivate SKU binding + type: http + seq: 11 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/inactivate/:sellerId/:skuSellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: skuSellerId + value: "71" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/inactivate/:sellerId/:skuSellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Changes the status of an SKU binding to inactive, setting `isActive` to `false`. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/inactivate/{sellerId}/{skuSellerId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `skuSellerId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings by SKU ID.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings by SKU ID.yml new file mode 100644 index 0000000000..447ad37495 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings by SKU ID.yml @@ -0,0 +1,96 @@ +info: + name: Get SKU bindings by SKU ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/sku-binding/pvt/skusellers/:skuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: skuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/sku-binding/pvt/skusellers/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/sku-binding/pvt/skusellers/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/sku-binding/pvt/skusellers/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/sku-binding/pvt/skusellers/:skuId - Schema is valid", function () { + const schema = {"type":"array","description":"Array containing objects with information about each SKU Binding.","items":{"type":"object","description":"Object with information about an SKU Binding.","properties":{"Id":{"type":"integer","description":"SKU Binding ID."},"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID in the VTEX marketplace."},"SellerSkuId":{"type":"string","description":"SKU seller ID."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."},"LastUpdateDate":{"type":"string","description":"Date when the SKU binding was updated for the last time, in UTC format."},"SalesPolicy":{"type":"integer","description":"Sales policy ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves SKU bindings details searching by SKU ID. + + >❗ The path `/api/catalog/pvt/skusellers/{skuId}` is deprecated. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `skuId` | path | (Required) SKU's unique identifier in the marketplace. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 48, + "SellerId": "cosmetics1", + "StockKeepingUnitId": 1, + "SellerSkuId": "42", + "IsActive": true, + "LastUpdateDate": "2025-10-21T19:13:00.657", + "SalesPolicy": 0 + } + ] + ``` diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings information.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings information.yml new file mode 100644 index 0000000000..c2579615f5 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get SKU bindings information.yml @@ -0,0 +1,119 @@ +info: + name: Get SKU bindings information + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/sku-binding/pvt/skuseller/admin" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: vtxkfj7352 + type: query + disabled: true + - name: skuId + value: "1" + type: query + disabled: true + - name: sellerSkuId + value: "71" + type: query + disabled: true + - name: isActive + value: "true" + type: query + disabled: true + - name: size + value: "1" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/sku-binding/pvt/skuseller/admin - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/sku-binding/pvt/skuseller/admin - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/sku-binding/pvt/skuseller/admin - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/sku-binding/pvt/skuseller/admin - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"SKU bindings information regarding a given seller ID.","properties":{"IsPersisted":{"type":"boolean","description":"Defines if the seller is persisted."},"IsRemoved":{"type":"boolean","description":"Defines if the seller is removed."},"SkuSellerId":{"type":"integer","description":"SKU Binding ID."},"UpdateDate":{"type":"string","description":"Date when the SKU binding was updated for the last time, in UTC format."},"RequestedUpdateDate":{"type":["string","null"],"description":"Date when an SKU binding update was requested for the last time, in UTC format."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID in the seller's store."},"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID in the VTEX marketplace."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves SKU bindings administrative information using optional query params `sellerId`, `skuId`, `sellerSkuId` and `IsActive` to filter results and `size` to restrict the amount of results. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/admin`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | query | ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. | + | `skuId` | query | SKU's unique identifier in the marketplace. | + | `sellerSkuId` | query | SKU ID in the seller's store. | + | `isActive` | query | Defines if the SKU binding is active. | + | `size` | query | Amount of results. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "IsPersisted": true, + "IsRemoved": false, + "SkuSellerId": 102, + "UpdateDate": "2025-04-12T20:06:59.413Z", + "RequestedUpdateDate": null, + "SellerStockKeepingUnitId": "71", + "SellerId": "fashionstore", + "StockKeepingUnitId": 25, + "IsActive": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get all SKU bindings by seller ID.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get all SKU bindings by seller ID.yml new file mode 100644 index 0000000000..675f083fb9 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get all SKU bindings by seller ID.yml @@ -0,0 +1,95 @@ +info: + name: Get all SKU bindings by seller ID + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/sku-binding/pvt/skuseller/list/bysellerId/:sellerId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/sku-binding/pvt/skuseller/list/bysellerId/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/sku-binding/pvt/skuseller/list/bysellerId/:sellerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/sku-binding/pvt/skuseller/list/bysellerId/:sellerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/sku-binding/pvt/skuseller/list/bysellerId/:sellerId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Seller's SKU bindings information.","properties":{"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID in the seller's store."},"FreightCommissionPercentage":{"type":["number","null"],"description":"The percentage that must be filled in as agreed between the marketplace and the seller."},"ProductCommissionPercentage":{"type":["number","null"],"description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."},"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID in the marketplace."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of SKU bindings given a specific seller ID. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/list/bysellerId/{sellerId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "SellerStockKeepingUnitId": "24", + "FreightCommissionPercentage": null, + "ProductCommissionPercentage": null, + "SellerId": "fashionstore", + "StockKeepingUnitId": 121, + "IsActive": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get details of a seller's SKU.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get details of a seller's SKU.yml new file mode 100644 index 0000000000..fa727954c8 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get details of a seller's SKU.yml @@ -0,0 +1,100 @@ +info: + name: Get details of a seller's SKU + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: sellerSkuId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/sku-binding/pvt/skuseller/:sellerId/:sellerSkuId - Schema is valid", function () { + const schema = {"type":"object","required":["IsPersisted","IsRemoved","SkuSellerId","SellerId","StockKeepingUnitId","SellerStockKeepingUnitId","IsActive","UpdateDate","RequestedUpdateDate"],"properties":{"IsPersisted":{"type":"boolean","description":"Defines if the seller is persisted."},"IsRemoved":{"type":"boolean","description":"Defines if the seller is removed."},"SkuSellerId":{"type":"integer","description":"SKU ID in the seller's store."},"UpdateDate":{"type":"string","description":"Date when the SKU binding was updated for the last time, in UTC format."},"RequestedUpdateDate":{"type":["string","null"],"description":"Date when an SKU binding update was requested for the last time, in UTC format."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU seller ID."},"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID in the VTEX marketplace."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a seller SKU details, given a seller ID and the SKU ID in the seller's store. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/{sellerId}/{sellerSkuId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "IsPersisted": true, + "IsRemoved": false, + "SkuSellerId": 799, + "UpdateDate": "2025-10-11T04:52:42.1", + "RequestedUpdateDate": null, + "SellerStockKeepingUnitId": "502", + "SellerId": "fashionstore", + "StockKeepingUnitId": 50, + "IsActive": true + } + ``` diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get paged SKU bindings by seller ID.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get paged SKU bindings by seller ID.yml new file mode 100644 index 0000000000..ce2be899f5 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Get paged SKU bindings by seller ID.yml @@ -0,0 +1,111 @@ +info: + name: Get paged SKU bindings by seller ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/sku-binding/pvt/skuseller/paged/sellerid/:sellerId?page=1&size=2" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: page + value: "1" + type: query + - name: size + value: "2" + type: query + - name: sellerId + value: fashionstore + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/sku-binding/pvt/skuseller/paged/sellerid/:sellerId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/sku-binding/pvt/skuseller/paged/sellerid/:sellerId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/sku-binding/pvt/skuseller/paged/sellerid/:sellerId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/sku-binding/pvt/skuseller/paged/sellerid/:sellerId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"SKU binding information regarding a given seller ID.","properties":{"SellerId":{"type":"string","description":"ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID."},"StockKeepingUnitId":{"type":"integer","description":"SKU ID in the marketplace."},"SellerStockKeepingUnitId":{"type":"string","description":"SKU ID in the seller's store."},"IsActive":{"type":"boolean","description":"Defines if the SKU binding is active."},"FreightCommissionPercentage":{"type":["number","null"],"description":"The percentage that must be filled in as agreed between the marketplace and the seller."},"ProductCommissionPercentage":{"type":["number","null"],"description":"The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a paged list of SKU bindings given a specific seller ID. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/paged/sellerid/{sellerId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **View Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `page` | query | (Required) Page number. | + | `size` | query | (Required) Amount of results per page. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "SellerId": "101", + "StockKeepingUnitId": 121, + "SellerStockKeepingUnitId": "24", + "IsActive": true, + "FreightCommissionPercentage": null, + "ProductCommissionPercentage": null + }, + { + "SellerId": "fashionstore", + "StockKeepingUnitId": 14, + "SellerStockKeepingUnitId": "60", + "IsActive": true, + "FreightCommissionPercentage": null, + "ProductCommissionPercentage": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Insert SKU binding.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Insert SKU binding.yml new file mode 100644 index 0000000000..45364a2e9c --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Insert SKU binding.yml @@ -0,0 +1,62 @@ +info: + name: Insert SKU binding + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/insertion" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "StockKeepingUnitId": 1, + "IsActive": true, + "SellerId": "fashionstore", + "SellerStockKeepingUnitId": "71" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/insertion - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates an SKU binding, associating a seller's SKU with a marketplace's SKU. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/insertion`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Remove a seller's SKU binding.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Remove a seller's SKU binding.yml new file mode 100644 index 0000000000..f7303a5083 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/Remove a seller's SKU binding.yml @@ -0,0 +1,62 @@ +info: + name: Remove a seller's SKU binding + type: http + seq: 12 + +http: + method: POST + url: "{{baseUrl}}/sku-binding/pvt/skuseller/remove/:sellerId/:sellerSkuId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: sellerId + value: fashionstore + type: path + - name: sellerSkuId + value: "71" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/sku-binding/pvt/skuseller/remove/:sellerId/:sellerSkuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a seller's SKU binding, given the seller ID and the SKU ID in the seller's store. + + > ℹ This path is an updated version of `/api/catalog_system/pvt/skuseller/remove/{sellerId}/{sellerSkuId}`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Catalog API | General | **Edit Product** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `sellerId` | path | (Required) ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the VTEX Admin to get the correct ID. | + | `sellerSkuId` | path | (Required) SKU ID in the seller's store. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/folder.yml b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/folder.yml new file mode 100644 index 0000000000..ff1c147bb2 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/SKU Bindings/folder.yml @@ -0,0 +1,4 @@ +info: + name: SKU Bindings + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - SKU Bindings API/environments/VTEX.yml b/BrunoCollections/VTEX - SKU Bindings API/environments/VTEX.yml new file mode 100644 index 0000000000..decfdf1670 --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - SKU Bindings API/opencollection.yml b/BrunoCollections/VTEX - SKU Bindings API/opencollection.yml new file mode 100644 index 0000000000..5fb6ba7dec --- /dev/null +++ b/BrunoCollections/VTEX - SKU Bindings API/opencollection.yml @@ -0,0 +1,34 @@ +opencollection: 1.0.0 + +info: + name: VTEX - SKU Bindings API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The SKU Bindings API enables sellers to manage their SKUs offered across different VTEX marketplaces. + + It allows sellers to send new suggestions to marketplaces, update SKU prices or inventory, and perform other operations, promoting accurate and flexible catalog management. + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Get SSL certificate by ID.yml b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Get SSL certificate by ID.yml new file mode 100644 index 0000000000..426d70b42f --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Get SSL certificate by ID.yml @@ -0,0 +1,106 @@ +info: + name: Get SSL certificate by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/edge/certificates/:certificateId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: certificateId + value: 8c66122e-85cd-4bff-885d-aa9846e97541 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/edge/certificates/:certificateId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/edge/certificates/:certificateId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/edge/certificates/:certificateId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/edge/certificates/:certificateId - Schema is valid", function () { + const schema = {"type":"object","description":"Information about an SSL certificate.","properties":{"id":{"type":"string","description":"Unique identifier of the certificate.","nullable":false},"account":{"type":"string","description":"Account name associated with the certificate.","nullable":false},"host":{"type":"string","description":"Primary host/domain of the certificate.","nullable":false},"serialNumber":{"type":"string","description":"Certificate serial number.","nullable":false},"subjectDistinguishedName":{"type":"string","description":"Full distinguished name of the subject.","nullable":false},"subjectCommonName":{"type":"string","description":"Common name (CN) of the certificate subject.","nullable":false},"subjectOrganization":{"type":["string","null"],"description":"Organization (O) of the certificate subject."},"issuerDistinguishedName":{"type":"string","description":"Full distinguished name of the issuing certificate authority.","nullable":false},"issuerCommonName":{"type":"string","description":"Common name (CN) of the certificate issuer.","nullable":false},"issuerOrganization":{"type":"string","description":"Organization (O) of the certificate issuer.","nullable":false},"installDate":{"type":"string","description":"Timestamp when the certificate was installed in ISO 8601 format.","nullable":false},"startDate":{"type":"string","description":"Certificate validity start date in ISO 8601 format.","nullable":false},"expiryDate":{"type":"string","description":"Certificate expiry date in ISO 8601 format.","nullable":false},"signatureAlgorithm":{"type":"string","description":"Algorithm used to sign the certificate.","nullable":false},"x509Version":{"type":"string","description":"X.509 version of the certificate.","nullable":false},"installedBy":{"type":"string","description":"ID of the user that installed the certificate.","nullable":false},"createdAt":{"type":"string","description":"Creation timestamp of the certificate entry in ISO 8601 format.","nullable":false},"updatedAt":{"type":"string","description":"Timestamp of the last certificate update in ISO 8601 format.","nullable":false},"status":{"type":"string","description":"Current status of the certificate, which can be one of the following:\n\n- **Active**: Valid and active for the host.\n- **Overwritten**: The certificate for this host has been replaced by another through an external method, such as an API call on the CDN.\n- **Installing**: Certificate installation in progress.\n- **Unknown**: The certificate status couldn't be determined due to internal technical problems with communication, configuration, or monitoring.\n- **Expires soon**: The certificate is close to its expiration date (30 days before or less).\n- **Installation failed**: After the status Installing, the installation can fail, and the user will need to try again later.\n- **Expired**: The expiration date passed.","nullable":false,"enum":["Active","Overwritten","Installing","Unknown","Expires soon","Installation failed","Expired"]}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a specific SSL certificate. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CDN API | Certificate management | **View certificate** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `certificateId` | path | (Required) SSL certificate unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8c66122e-85cd-4bff-885d-aa9846e97541", + "account": "myaccountname", + "host": "mystore.com", + "serialNumber": "05C51F848EDBAC18E91D9AE43D8F6728D4F8", + "subjectDistinguishedName": "CN=mystore.com", + "subjectCommonName": "mystore.com", + "subjectOrganization": null, + "issuerDistinguishedName": "CN=R10, O=Let's Encrypt, C=US", + "issuerCommonName": "R10", + "issuerOrganization": "Let's Encrypt", + "installDate": "2025-04-22T16:24:58.768939Z", + "startDate": "2024-08-29T01:43:25Z", + "expiryDate": "2024-11-27T01:43:24Z", + "signatureAlgorithm": "sha256RSA", + "x509Version": "3", + "installedBy": "22b312e1-f863-43t7-8c59-5n2f9ll0d09x", + "createdAt": "2024-10-25T17:51:51.222052Z", + "updatedAt": "2025-04-22T16:24:58.768939Z", + "status": "Active" + } + ``` diff --git a/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Install or renew SSL certificate.yml b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Install or renew SSL certificate.yml new file mode 100644 index 0000000000..79ea6c555e --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/Install or renew SSL certificate.yml @@ -0,0 +1,114 @@ +info: + name: Install or renew SSL certificate + type: http + seq: 2 + +http: + method: PUT + url: "{{baseUrl}}/api/edge/certificates" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "hosts": [ + "mystore.com", + "mystore.com" + ], + "certificate": "LS0tLS1CRUd...S0tLS0K", + "privateKey": "LS0tLS1CRUd...LS0NCg==" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/edge/certificates - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/edge/certificates - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/edge/certificates - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/edge/certificates - Schema is valid", function () { + const schema = {"type":"array","description":"List of SSL certificates.","items":{"type":"object","description":"Information about each SSL certificate.","properties":{"id":{"type":"string","description":"Unique identifier of the certificate.","nullable":false},"account":{"type":"string","description":"Account name associated with the certificate.","nullable":false},"host":{"type":"string","description":"Primary host/domain of the certificate.","nullable":false},"serialNumber":{"type":"string","description":"Certificate serial number.","nullable":false},"subjectDistinguishedName":{"type":"string","description":"Full distinguished name of the subject.","nullable":false},"subjectCommonName":{"type":"string","description":"Common name (CN) of the certificate subject.","nullable":false},"subjectOrganization":{"type":["string","null"],"description":"Organization (O) of the certificate subject."},"issuerDistinguishedName":{"type":"string","description":"Full distinguished name of the issuing certificate authority.","nullable":false},"issuerCommonName":{"type":"string","description":"Common name (CN) of the certificate issuer.","nullable":false},"issuerOrganization":{"type":"string","description":"Organization (O) of the certificate issuer.","nullable":false},"installDate":{"type":"string","description":"Timestamp when the certificate was installed in ISO 8601 format.","nullable":false},"startDate":{"type":"string","description":"Certificate validity start date in ISO 8601 format.","nullable":false},"expiryDate":{"type":"string","description":"Certificate expiry date in ISO 8601 format.","nullable":false},"signatureAlgorithm":{"type":"string","description":"Algorithm used to sign the certificate.","nullable":false},"x509Version":{"type":"string","description":"X.509 version of the certificate.","nullable":false},"installedBy":{"type":"string","description":"ID of the user that installed the certificate.","nullable":false},"createdAt":{"type":"string","description":"Creation timestamp of the certificate entry in ISO 8601 format.","nullable":false},"updatedAt":{"type":"string","description":"Timestamp of the last certificate update in ISO 8601 format.","nullable":false},"status":{"type":"string","description":"Current status of the certificate, which can be one of the following:\n\n- **Active**: Valid and active for the host.\n- **Overwritten**: The certificate for this host has been replaced by another through an external method, such as an API call on the CDN.\n- **Installing**: Certificate installation in progress.\n- **Unknown**: The certificate status couldn't be determined due to internal technical problems with communication, configuration, or monitoring.\n- **Expires soon**: The certificate is close to its expiration date (30 days before or less).\n- **Installation failed**: After the status Installing, the installation can fail, and the user will need to try again later.\n- **Expired**: The expiration date passed.","nullable":false,"enum":["Active","Overwritten","Installing","Unknown","Expires soon","Installation failed","Expired"]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Installs or renews an SSL certificate using `application/json` or `multipart/form-data` content types. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CDN API | Certificate management | **Update certificate** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "8c66122e-85cd-4bff-885d-aa9846e97541", + "account": "myaccountname", + "host": "mystore.com", + "serialNumber": "05C51F848EDBAC18E91D9AE43D8F6728D4F8", + "subjectDistinguishedName": "CN=mystore.com", + "subjectCommonName": "mystore.com", + "subjectOrganization": null, + "issuerDistinguishedName": "CN=R10, O=Let's Encrypt, C=US", + "issuerCommonName": "R10", + "issuerOrganization": "Let's Encrypt", + "installDate": "2025-04-22T16:24:58.768939Z", + "startDate": "2024-08-29T01:43:25Z", + "expiryDate": "2024-11-27T01:43:24Z", + "signatureAlgorithm": "sha256RSA", + "x509Version": "3", + "installedBy": "22b312e1-f863-43t7-8c59-5n2f9ll0d09x", + "createdAt": "2024-10-25T17:51:51.222052Z", + "updatedAt": "2025-04-22T16:24:58.768939Z", + "status": "Installing" + } + ] + ``` diff --git a/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/List SSL certificates.yml b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/List SSL certificates.yml new file mode 100644 index 0000000000..5d35b9beba --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/List SSL certificates.yml @@ -0,0 +1,103 @@ +info: + name: List SSL certificates + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/edge/certificates" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/edge/certificates - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/edge/certificates - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/edge/certificates - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/edge/certificates - Schema is valid", function () { + const schema = {"type":"array","description":"List of SSL certificates.","items":{"type":"object","description":"Information about each SSL certificate.","properties":{"id":{"type":"string","description":"Unique identifier of the certificate.","nullable":false},"account":{"type":"string","description":"Account name associated with the certificate.","nullable":false},"host":{"type":"string","description":"Primary host/domain of the certificate.","nullable":false},"serialNumber":{"type":"string","description":"Certificate serial number.","nullable":false},"subjectDistinguishedName":{"type":"string","description":"Full distinguished name of the subject.","nullable":false},"subjectCommonName":{"type":"string","description":"Common name (CN) of the certificate subject.","nullable":false},"subjectOrganization":{"type":["string","null"],"description":"Organization (O) of the certificate subject."},"issuerDistinguishedName":{"type":"string","description":"Full distinguished name of the issuing certificate authority.","nullable":false},"issuerCommonName":{"type":"string","description":"Common name (CN) of the certificate issuer.","nullable":false},"issuerOrganization":{"type":"string","description":"Organization (O) of the certificate issuer.","nullable":false},"installDate":{"type":"string","description":"Timestamp when the certificate was installed in ISO 8601 format.","nullable":false},"startDate":{"type":"string","description":"Certificate validity start date in ISO 8601 format.","nullable":false},"expiryDate":{"type":"string","description":"Certificate expiry date in ISO 8601 format.","nullable":false},"signatureAlgorithm":{"type":"string","description":"Algorithm used to sign the certificate.","nullable":false},"x509Version":{"type":"string","description":"X.509 version of the certificate.","nullable":false},"installedBy":{"type":"string","description":"ID of the user that installed the certificate.","nullable":false},"createdAt":{"type":"string","description":"Creation timestamp of the certificate entry in ISO 8601 format.","nullable":false},"updatedAt":{"type":"string","description":"Timestamp of the last certificate update in ISO 8601 format.","nullable":false},"status":{"type":"string","description":"Current status of the certificate, which can be one of the following:\n\n- **Active**: Valid and active for the host.\n- **Overwritten**: The certificate for this host has been replaced by another through an external method, such as an API call on the CDN.\n- **Installing**: Certificate installation in progress.\n- **Unknown**: The certificate status couldn't be determined due to internal technical problems with communication, configuration, or monitoring.\n- **Expires soon**: The certificate is close to its expiration date (30 days before or less).\n- **Installation failed**: After the status Installing, the installation can fail, and the user will need to try again later.\n- **Expired**: The expiration date passed.","nullable":false,"enum":["Active","Overwritten","Installing","Unknown","Expires soon","Installation failed","Expired"]}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of SSL certificates. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CDN API | Certificate management | **View certificate** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "8c66122e-85cd-4bff-885d-aa9846e97541", + "account": "myaccountname", + "host": "mystore.com", + "serialNumber": "05C51F848EDBAC18E91D9AE43D8F6728D4F8", + "subjectDistinguishedName": "CN=mystore.com", + "subjectCommonName": "mystore.com", + "subjectOrganization": null, + "issuerDistinguishedName": "CN=R10, O=Let's Encrypt, C=US", + "issuerCommonName": "R10", + "issuerOrganization": "Let's Encrypt", + "installDate": "2025-04-22T16:24:58.768939Z", + "startDate": "2024-08-29T01:43:25Z", + "expiryDate": "2024-11-27T01:43:24Z", + "signatureAlgorithm": "sha256RSA", + "x509Version": "3", + "installedBy": "22b312e1-f863-43t7-8c59-5n2f9ll0d09x", + "createdAt": "2024-10-25T17:51:51.222052Z", + "updatedAt": "2025-04-22T16:24:58.768939Z", + "status": "Active" + } + ] + ``` diff --git a/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/folder.yml b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/folder.yml new file mode 100644 index 0000000000..9064c5452a --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/SSL Certificates/folder.yml @@ -0,0 +1,4 @@ +info: + name: SSL Certificates + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - SSL Certificates API/environments/VTEX.yml b/BrunoCollections/VTEX - SSL Certificates API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - SSL Certificates API/opencollection.yml b/BrunoCollections/VTEX - SSL Certificates API/opencollection.yml new file mode 100644 index 0000000000..55adeb0f70 --- /dev/null +++ b/BrunoCollections/VTEX - SSL Certificates API/opencollection.yml @@ -0,0 +1,38 @@ +opencollection: 1.0.0 + +info: + name: VTEX - SSL Certificates API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The SSL Certificates API allows VTEX users to programmatically manage SSL certificates for their store domains. It enables users to list all installed certificates and install or renew certificates using JSON or multipart form data. + + The API provides detailed metadata about each certificate, including issuer, subject, validity period, installation status, and more. This helps ensure secure HTTPS connections for custom domains, automating certificate lifecycle management and supporting integration with external certificate authorities or automation tools. + + >ℹ️ Learn more about [Custom SSL certificates](https://help.vtex.com/en/tutorial/custom-ssl-certificates--1hoaDEbU50PDZSe6AYep9q). + + >ℹ️ This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you are already a VTEX customer and want to adopt VTEX Shield for your business, please contact [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you are not yet a customer but are interested in this solution, please complete our [contact form](https://vtex.com/br-pt/contato/). + + ## Common parameters + + | Parameter name | Description | Type | + |-|-|-| + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Search API/Autocomplete/Product search autocomplete.yml b/BrunoCollections/VTEX - Search API/Autocomplete/Product search autocomplete.yml new file mode 100644 index 0000000000..5ab12f82db --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Autocomplete/Product search autocomplete.yml @@ -0,0 +1,101 @@ +info: + name: Product search autocomplete + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/buscaautocomplete?productNameContains=jeans" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: productNameContains + value: jeans + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/buscaautocomplete - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/buscaautocomplete - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/buscaautocomplete - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/buscaautocomplete - Schema is valid", function () { + const schema = {"type":"object","description":"The root schema comprises the entire JSON document.","example":{"itemsReturned":[{"items":[],"thumb":"","thumbUrl":null,"name":"Cacilds in Coronas","href":"https://merch.vtexcommercestable.com.br/coronas/Cacilds","criteria":"£Cacilds in Coronas¢/coronas/Cacilds"},{"items":[{"productId":"3","itemId":"5","name":"Llf","nameComplete":"Cacilds Llf","imageUrl":"https://merch.vteximg.com.br/arquivos/ids/172754-25-25/Diablo.jpg?v=637521970448770000"}],"thumb":"\"image-433ec3e72d7e4b94964481e843c9dd88\"","thumbUrl":"https://merch.vteximg.com.br/arquivos/ids/172754-25-25/Diablo.jpg?v=637521970448770000","name":"cacilds - llf","href":"https://merch.vtexcommercestable.com.br/bay-max-3/p","criteria":null}]},"required":["itemsReturned"],"properties":{"itemsReturned":{"type":"array","description":"Autocomplete returned items.","items":{"type":"object","required":["items","thumb","thumbUrl","name","href","criteria"],"properties":{"items":{"type":"array","description":"Array of products.","items":{"type":"object","description":"Product information.","properties":{"productId":{"type":"string","description":"Product ID."},"itemId":{"type":"string","description":"Item ID."},"name":{"type":"string","description":"Product name."},"nameComplete":{"type":"string","description":"Complete product name."},"imageUrl":{"type":"string","description":"Product image URL."}}}},"thumb":{"type":"string","description":"Item thumbnail."},"thumbUrl":{"type":["string","null"],"description":"Item thumbnail URL."},"name":{"type":"string","description":"Item name."},"href":{"type":"string","description":"Item URL."},"criteria":{"type":["string","null"],"description":"Item criteria."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves product's information related to the searched string. + `{{searchString}} is the part of string the user is looking for. + E.g.: `ref` | `refrig` | `refrigerator` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productNameContains` | query | (Required) Part of the string that will be searched. | + | `Content-Type` | header | (Required) Type of the content being sent | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand | + + ## Example response (`200`) + + ```json + { + "itemsReturned": [ + { + "items": [], + "thumb": "", + "thumbUrl": null, + "name": "Cacilds in Coronas", + "href": "https://merch.vtexcommercestable.com.br/coronas/Cacilds", + "criteria": "£Cacilds in Coronas¢/coronas/Cacilds" + }, + { + "items": [ + { + "productId": "3", + "itemId": "5", + "name": "Llf", + "nameComplete": "Cacilds Llf", + "imageUrl": "https://merch.vteximg.com.br/arquivos/ids/172754-25-25/Diablo.jpg?v=637521970448770000" + } + ], + "thumb": "\"image-433ec3e72d7e4b94964481e843c9dd88\"", + "thumbUrl": "https://merch.vteximg.com.br/arquivos/ids/172754-25-25/Diablo.jpg?v=637521970448770000", + "name": "cacilds - llf", + "href": "https://merch.vtexcommercestable.com.br/bay-max-3/p", + "criteria": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Search API/Autocomplete/folder.yml b/BrunoCollections/VTEX - Search API/Autocomplete/folder.yml new file mode 100644 index 0000000000..b7c2eea1b0 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Autocomplete/folder.yml @@ -0,0 +1,4 @@ +info: + name: Autocomplete + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of accessories.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of accessories.yml new file mode 100644 index 0000000000..f5f96b4b63 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of accessories.yml @@ -0,0 +1,35 @@ +info: + name: Get product search of accessories + type: http + seq: 5 + +http: + method: GET + url: https://entelperu.{{environment}}.com.br/api/catalog_system/pub/products/crossselling/accessories/api/catalog_system/pub/products/crossselling/accessories/:productId + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the product's accessories. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique identifier | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of show together.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of show together.yml new file mode 100644 index 0000000000..b920c5eb98 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of show together.yml @@ -0,0 +1,35 @@ +info: + name: Get product search of show together + type: http + seq: 4 + +http: + method: GET + url: https://entelperu.{{environment}}.com.br/api/catalog_system/pub/products/crossselling/accessories/api/catalog_system/pub/products/crossselling/showtogether/:productId + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the products that are show together with the product in question. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique identifier | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of similars.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of similars.yml new file mode 100644 index 0000000000..aa3a1fc7b1 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of similars.yml @@ -0,0 +1,44 @@ +info: + name: Get product search of similars + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/crossselling/similars/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/catalog_system/pub/products/crossselling/similars/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about related product searches. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique identifier | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of suggestions.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of suggestions.yml new file mode 100644 index 0000000000..86e970976d --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of suggestions.yml @@ -0,0 +1,44 @@ +info: + name: Get product search of suggestions + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/crossselling/suggestions/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/api/catalog_system/pub/products/crossselling/suggestions/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about other product suggestions related to the product. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product's unique identifier | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who bought also bought.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who bought also bought.yml new file mode 100644 index 0000000000..484474e3da --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who bought also bought.yml @@ -0,0 +1,70 @@ +info: + name: Get product search of who bought also bought + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/crossselling/whoboughtalsobought/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whoboughtalsobought/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whoboughtalsobought/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whoboughtalsobought/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whoboughtalsobought/:productId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Cluster highlight ID and name."},"productClusters":{"type":"object","description":"Product clusters' IDs and names."},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names."},"categories":{"type":"array","description":"Array of the product's categories URLs."},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs."},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference Code."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Used only in cases when you need to convert the unit of measure for sale. In common cases, use 'un'."},"unitMultiplier":{"type":"number","description":"numerical unit that multiplies the selected quantity of the product when it is inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal Type."},"isKit":{"type":"boolean","description":"If the SKU is part of a kit."},"kitItems":{"type":"array","description":"Array with information of SKUs components from a Kit.","items":{"type":"object","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU component in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU image.","items":{"type":"object","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":"string","description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"If the seller is default or not."},"commertialOffer":{"type":"object","description":"AKA Commertial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount hightlight."},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs."},"Teasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question."},"ItemMetadataAttachment":{"type":"array","description":"Item metadata attachment."},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"If the product is available or not."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples.","items":{"type":"object","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"installment options.","items":{"type":"object","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Value."},"installments":{"type":"array","description":"Installments.","items":{"type":"object","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments.","items":{"type":"object","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems.","items":{"type":"object","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens."}}}}}}}},"Videos":{"type":"array","description":"Videos."},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗ This endpoint is deprecated and may not work as expected. Instead, it returns a list of products from the same category. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also bought.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also bought.yml new file mode 100644 index 0000000000..5b3e777374 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also bought.yml @@ -0,0 +1,70 @@ +info: + name: Get product search of who saw also bought + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/crossselling/whosawalsobought/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsobought/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsobought/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsobought/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsobought/:productId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with product search information.","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Cluster highlight ID and name."},"productClusters":{"type":"object","description":"Product clusters' IDs and names.","additionalProperties":true},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names.","additionalProperties":true},"categories":{"type":"array","description":"Array of the product's categories URLs.","items":{"type":"string","description":"Product category URL."}},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs.","items":{"type":"string","description":"Product category ID."}},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","description":"Product SKU general information object.","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference Code."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Used only in cases when you need to convert the unit of measure for sale. In common cases, use 'un'."},"unitMultiplier":{"type":"number","description":"Numerical unit that multiplies the selected quantity of the product when inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal Type."},"isKit":{"type":"boolean","description":"If the SKU is part of a kit."},"kitItems":{"type":"array","description":"Array with information of SKUs components from a Kit.","items":{"type":"object","description":"Information about a given SKU component.","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU component in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU image.","items":{"type":"object","description":"Information about a given SKU image.","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":["string","null"],"description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","description":"Information about a given SKU seller.","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"If the seller is default or not."},"commertialOffer":{"type":"object","description":"Also known as Commercial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount highlight."},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs."},"Teasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}`.","properties":{"{field}":{"type":"string","description":"General value."}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","description":"Information about a given promotion teaser.","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}`.","properties":{"{field}":{"type":"string","description":"General value."}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question."},"ItemMetadataAttachment":{"type":"array","description":"Item metadata attachment."},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"If the product is available or not."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples.","items":{"type":"object","description":"Information about a given SLA sample.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":["array","null"],"description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"Installment options.","items":{"type":"object","description":"Information about an installment option.","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Value."},"installments":{"type":"array","description":"List of installments.","items":{"type":"object","description":"Installment object.","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments.","items":{"type":"object","description":"Information about a given seller merchant installment.","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems.","items":{"type":"object","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens."}}}}}}}},"Videos":{"type":["array","null"],"description":"Videos.","items":{"type":"string","description":"Video URL."}},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗ This endpoint is deprecated and may not work as expected. Instead, it returns a list of products from the same category. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 13 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also saw.yml b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also saw.yml new file mode 100644 index 0000000000..23831c2567 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/Get product search of who saw also saw.yml @@ -0,0 +1,70 @@ +info: + name: Get product search of who saw also saw + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/crossselling/whosawalsosaw/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsosaw/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsosaw/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsosaw/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/crossselling/whosawalsosaw/:productId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Information about the product.","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Product clusters highlights. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the key and the value are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster highlight."}}},"productClusters":{"type":"object","description":"Product clusters' IDs and names. Structure: \"{Product cluster ID}\": \"{Product cluster name}\". Both the keys and the values are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster name."}}},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names. Structure: \"{Searchable cluster ID}\": \"{Searchable cluster name}\". Both the keys and the values are strings.","additionalProperties":{"type":"string","description":"Product cluster ID.","additionalProperties":{"type":"string","description":"Product cluster name."}}},"categories":{"type":"array","description":"Array of the product's categories URLs.","items":{"type":"string","description":"The product's category URL."}},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs.","items":{"type":"string","description":"Product category ID."}},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","description":"Information about the SKU.","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","description":"Reference code key and value.","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference code key."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Measurement unit. This field should only be used when it is necessary to convert the unit of measure for sale. In common cases, use `un` (unit).\n\rThe acceptables values are:\n\r- `un`: Unit\n\r- `kg`: Kilogram\n\r- `g`: Gram\n\r- `mg`: Milligram\n\r- `m`: Meter\n\r- `m²`: Square meter\n\r- `m³`: Cubic meter\n\r- `cm`: Centimeter\n\r- `cm²`: Square centimeter\n\r- `cm³`: Cubic centimeter\n\r- `mm`: Millimeter\n\r- `mm²`: Square millimeter\n\r- `mm³`: Cubic millimeter\n\r- `oz`: Ounce\n\r- `lb`: Pound\n\r- `ft`: Foot\n\r- `ft²`: Square foot\n\r- `ft³`: Cubic foot\n\r- `in`: Inch\n\r- `in²`: Square inch\n\r- `in³`: Cubic inch","enum":["un","kg","g","mg","m","m²","m³","cm","cm²","cm³","mm","mm²","mm³","oz","lb","ft","ft²","ft³","in","in²","in³"]},"unitMultiplier":{"type":"number","description":"Numerical unit that multiplies the selected quantity of the product when it's inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal type."},"isKit":{"type":"boolean","description":"Defines if the SKU is part of a kit (`true`) or not (`false`)."},"kitItems":{"type":"array","description":"Array with information about SKU components from a kit.","items":{"type":"object","description":"Information about a given SKU component from a kit.","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU components in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU images.","items":{"type":"object","description":"Information about a given SKU image.","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":"string","description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","description":"Information about a given seller.","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"Defines if the seller is default (`true`) or not (`false`)."},"commertialOffer":{"type":"object","description":"AKA Commertial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types.","items":{"type":"string","description":"Delivery SLA type."}},"Region":{"type":["string","null"],"description":"Delivery SLA region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","description":"Information about a given installment option.","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount hightlights.","items":{"type":"string","description":"Discount hightlight name."}},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs.","items":{"type":"string","description":"SKU gift ID."}},"Teasers":{"type":"array","description":"List with teasers information.","items":{"type":"object","description":"Information about a given teaser.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}`.","properties":{"{field}":{"type":"string","description":"General value."}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers information.","items":{"type":"object","description":"Information about a given promotion teaser.","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}`.","properties":{"{field}":{"type":"string","description":"General value."}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question.","items":{"type":"string","description":"Product ID."}},"ItemMetadataAttachment":{"description":"Item metadata attachment.","type":"array","items":{"description":"Item metadata attachment information.","type":"object","properties":{"Name":{"description":"SKU name.","type":"string"},"NameComplete":{"description":"Complete name of the product combined with the SKU name.","type":"string"},"MainImage":{"description":"Main image URL.","type":"string"},"BrandName":{"description":"Brand name.","type":"string"},"CategoryId":{"description":"Category unique identifier.","type":"number"},"ProductId":{"description":"Product unique identifier.","type":"number"},"id":{"description":"SKU unique identifier.","type":"string"},"seller":{"description":"Seller unique identifier.","type":"string"},"assemblyOptions":{"description":"Assembly options attachment.","type":"array","items":{"description":"Assembly options attachment information.","type":"object","properties":{"id":{"description":"Attachment unique identifier.","type":"string"},"name":{"description":"Attachment name.","type":"string"},"required":{"description":"Defines whether the attachment is required (`true`) or not (`false`).","type":"boolean"},"inputValues":{"description":"Input values information.","type":"object","additionalProperties":true}}}}}}},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Available quantity. Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"Defines if the product is available (`true`) or not (`false`)."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples information.","items":{"type":"object","description":"Information about a given delivery SLA sample.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types.","items":{"type":"string","description":"Delivery SLA type."}},"Region":{"type":["string","null"],"description":"Delivery SLA region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"Information about installment options.","items":{"type":"object","description":"Information about a given installment.","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"First six digits of the card number."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Installment value."},"installments":{"type":"array","description":"Information about installments.","items":{"type":"object","description":"Information about a given installment.","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Installment count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"List of seller merchant installments.","items":{"type":"object","description":"Seller merchant installment.","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems information.","items":{"type":"object","description":"Information about a given payment system.","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens.","items":{"type":"string","description":"Available token name."}}}}}}}}},"Videos":{"type":"array","description":"Videos information.","items":{"type":"string","description":"Video URL."}},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >❗ This endpoint is deprecated and may not work as expected. Instead, it returns a list of products from the same category. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/CrossSelling/folder.yml b/BrunoCollections/VTEX - Search API/CrossSelling/folder.yml new file mode 100644 index 0000000000..21c854bd68 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/CrossSelling/folder.yml @@ -0,0 +1,4 @@ +info: + name: CrossSelling + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Search API/Facets/Get category facets.yml b/BrunoCollections/VTEX - Search API/Facets/Get category facets.yml new file mode 100644 index 0000000000..1626be7a36 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Facets/Get category facets.yml @@ -0,0 +1,109 @@ +info: + name: Get category facets + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/facets/category/:categoryId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: _from + value: "1" + type: query + disabled: true + - name: _to + value: "50" + type: query + disabled: true + - name: categoryId + value: "1" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/facets/category/:categoryId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/facets/category/:categoryId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/facets/category/:categoryId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/facets/category/:categoryId - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Object with name and ID of the category's facet.","required":["Name","Id"],"properties":{"Name":{"type":"string","description":"Category's facet name."},"Id":{"type":"integer","description":"Category's facet ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the names and IDs of the categories facets. + >⚠️ This endpoint returns a maximum of 50 items per response, so the difference between `_from` and `_to` should not exceed this number. The result order is descending, from the highest product ID to the lowest. + + ## Response body example: + + ```json + [ + [ + { + "Name":"Tamanho Global", + "Id":45 + }, + { + "Name":"Percentuals", + "Id":25 + } + ] + ] + ``` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `categoryId` | path | (Required) Category unique number identifier. | + | `_from` | query | Starter page range. These parameters allow the API to be paginated. Take into account that the initial and final pages cannot have a separation superior to 50 pages. Thus, it will be displayed 50 items per page. | + | `_to` | query | Finisher page range. These parameters allow the API to be paginated. Take into account that the initial and final pages cannot have a separation superior to 50 pages. Thus, it will be displayed 50 items per page. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "Name": "Tamanho Global", + "Id": 45 + }, + { + "Name": "Percentuals", + "Id": 25 + } + ] + ``` diff --git a/BrunoCollections/VTEX - Search API/Facets/Search by store facets.yml b/BrunoCollections/VTEX - Search API/Facets/Search by store facets.yml new file mode 100644 index 0000000000..ccf9684582 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Facets/Search by store facets.yml @@ -0,0 +1,74 @@ +info: + name: Search by store facets + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/facets/search/:term?map=c" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: map + value: c + type: query + - name: term + value: "2" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/facets/search/:term - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/facets/search/:term - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/facets/search/:term - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/facets/search/:term - Schema is valid", function () { + const schema = {"type":"object","required":["Departments","Brands","SpecificationFilters","CategoriesTrees","PriceRanges","Summary"],"properties":{"Departments":{"type":"array","description":"Array of general information about the categories.","items":{"type":"object","required":["Quantity","Position","Name","Link","LinkEncoded","Map","Value"],"properties":{"Quantity":{"type":"integer","description":"Quantity of facets."},"Position":{"type":["integer","null"],"description":"Position of the facets."},"Name":{"type":"string","description":"Category name."},"Link":{"type":"string","description":"Link of the facet."},"LinkEncoded":{"type":"string","description":"Encoded link of the facet."},"Map":{"type":"string","description":"Mapping of the facet."},"Value":{"type":"string","description":"Value of the facet."}}}},"Brands":{"type":"array","description":"Array of general information about the brands.","items":{"type":"object","required":["Quantity","Position","Name","Link","LinkEncoded","Map","Value"],"properties":{"Quantity":{"type":"integer","description":"Quantity of facets."},"Position":{"type":["integer","null"],"description":"Position of the facet."},"Name":{"type":"string","description":"Brand name."},"Link":{"type":"string","description":"Link of the facet."},"LinkEncoded":{"type":"string","description":"Enconded link of the facet."},"Map":{"type":"string","description":"Mapping of the facet."},"Value":{"type":"string","description":"Value of the facet."}}}},"SpecificationFilters":{"type":"object","description":"Object with general information of specifications."},"CategoriesTrees":{"type":"array","description":"Array of the category tree.","items":{"type":"object","required":["Id","Quantity","Position","Name","Link","LinkEncoded","Map","Value","Children"],"properties":{"Id":{"type":"integer","description":"Category ID."},"Quantity":{"type":"integer","description":"Quantity of the facets."},"Position":{"type":["integer","null"],"description":"Position of the facet."},"Name":{"type":"string","description":"Category name."},"Link":{"type":"string","description":"Link of the facet."},"LinkEncoded":{"type":"string","description":"Encoded link of the facet."},"Map":{"type":"string","description":"Mapping of the facet."},"Value":{"type":"string","description":"Value of the facet."},"Children":{"type":"array","description":"Category children.","items":{"type":"object","required":["Id","Quantity","Position","Name","Link","LinkEncoded","Map","Value","Children"],"properties":{"Id":{"type":"integer","description":"Category ID."},"Quantity":{"type":"integer","description":"Quantity of the facets."},"Position":{"type":["integer","null"],"description":"Position of the facet."},"Name":{"type":"string","description":"Category name."},"Link":{"type":"string","description":"Link of the facet."},"LinkEncoded":{"type":"string","description":"Encoded link of the facet."},"Map":{"type":"string","description":"Mapping of the facet."},"Value":{"type":"string","description":"Value of the facet."},"Children":{"type":"array","description":"Category children."}}}}}}},"PriceRanges":{"type":"array","description":"Array with general information of the price ranges."},"Summary":{"type":"object","description":"Summary of the facets.","required":["Departments","CategoriesTrees","Brands","PriceRanges","SpecificationFilters"],"properties":{"Departments":{"type":"object","description":"Departments' quantity of displayed and total items.","required":["DisplayedItems","TotalItems"],"properties":{"DisplayedItems":{"type":"integer","description":"Quantity of displayed items."},"TotalItems":{"type":"integer","description":"Quantity of total items."}}},"CategoriesTrees":{"type":"object","description":"Category tree's quantity of displayed and total items.","required":["DisplayedItems","TotalItems"],"properties":{"DisplayedItems":{"type":"integer","description":"Quantity of displayed items."},"TotalItems":{"type":"integer","description":"Quantity of total items."}}},"Brands":{"type":"object","description":"Brands' quantity of displayed and total items.","required":["DisplayedItems","TotalItems"],"properties":{"DisplayedItems":{"type":"integer","description":"Quantity of displayed items."},"TotalItems":{"type":"integer","description":"Quantity of total items."}}},"PriceRanges":{"type":"object","description":"Price ranges' quantity of displayed and total items.","required":["DisplayedItems","TotalItems"],"properties":{"DisplayedItems":{"type":"integer","description":"Quantity of displayed items."},"TotalItems":{"type":"integer","description":"Quantity of total items."}}},"SpecificationFilters":{"type":"object","description":"Specification filters' quantity of displayed and total items."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves products by store facets. The result order is descending, from the highest product ID to the lowest. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `term` | path | (Required) Term used for the facet's search. You can search for as much term as you want. The term can be: `categoryId`, `brandId`, `specificationId`. | + | `map` | query | (Required) Mapping of the term. It can be `c` for a category, `b` for a brand, or `specificationFilter_{specificationId}` for a specification. You need to include a map for each term you are searching for in the same term's order. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 8 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/Facets/folder.yml b/BrunoCollections/VTEX - Search API/Facets/folder.yml new file mode 100644 index 0000000000..9636d37ca4 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Facets/folder.yml @@ -0,0 +1,4 @@ +info: + name: Facets + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Search API/Offers/Search SKU offers.yml b/BrunoCollections/VTEX - Search API/Offers/Search SKU offers.yml new file mode 100644 index 0000000000..3c951e3abd --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Offers/Search SKU offers.yml @@ -0,0 +1,122 @@ +info: + name: Search SKU offers + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/offers/:productId/sku/:skuId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "3" + type: path + - name: skuId + value: "5" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId/sku/:skuId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId/sku/:skuId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId/sku/:skuId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId/sku/:skuId - Schema is valid", function () { + const schema = {"type":"array","example":[{"SkuId":"5","EanId":"272727","RefId":"BIGHEROBML","Name":"Llf","NameComplete":"Cacilds Llf","IsActive":true,"MainImage":{"ImageId":"172754","ImageLabel":null,"ImageTag":"\"\"","ImagePath":"~/arquivos/ids/172754-#width#-#height#/Diablo.jpg","IsMain":true,"IsZoomSize":false,"ImageText":null,"LastModified":"2021-03-24T15:37:24.877"},"Offers":[{"SellerId":"1","SellerSkuId":"5","OffersPerSalesChannel":[{"AvailableQuantity":0,"SaleChannel":1,"Price":200,"ListPrice":200,"PriceWithoutDiscount":200,"IsAvailable":false},{"AvailableQuantity":0,"SaleChannel":2,"Price":200,"ListPrice":200,"PriceWithoutDiscount":200,"IsAvailable":false}],"AvailableSalesChannels":null}],"LastModified":"2021-07-06T19:13:45.831483","ProductId":"3"}],"items":{"type":"object","required":["SkuId","EanId","RefId","Name","NameComplete","IsActive","MainImage","Offers","LastModified","ProductId"],"properties":{"SkuId":{"type":"string","description":"SKU ID."},"EanId":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"RefId":{"type":"string","description":"Unique reference code used internally for organizational purposes."},"Name":{"type":"string","description":"SKU name."},"NameComplete":{"type":"string","description":"SKU complete name."},"IsActive":{"type":"boolean","description":"If the SKU is active or not."},"MainImage":{"type":"object","description":"General information of the main image of the SKU.","required":["ImageId","ImageLabel","ImageTag","ImagePath","IsMain","IsZoomSize","ImageText","LastModified"],"properties":{"ImageId":{"type":"string","description":"Unique identifier of the association of the Image to the SKU."},"ImageLabel":{"type":["string","null"],"description":"Image Label."},"ImageTag":{"type":"string","description":"Image HTML tag."},"ImagePath":{"type":"string","description":"Image file path."},"IsMain":{"type":"boolean","description":"If the image is the main image of the SKU or not."},"IsZoomSize":{"type":"boolean","description":"If the image has zoom applied."},"ImageText":{"type":["string","null"],"description":"General text of the image."},"LastModified":{"type":"string","description":"Time that the image was last modified."}}},"Offers":{"type":"array","description":"AKA Commertial Condition.","items":{"type":"object","required":["SellerId","SellerSkuId","OffersPerSalesChannel","AvailableSalesChannels"],"properties":{"SellerId":{"type":"string","description":"Seller ID."},"SellerSkuId":{"type":"string","description":"ID of the association of the SKU with the seller."},"OffersPerSalesChannel":{"type":"array","description":"Offers per trade policy.","items":{"type":"object","required":["AvailableQuantity","SaleChannel","Price","ListPrice","PriceWithoutDiscount","IsAvailable"],"properties":{"AvailableQuantity":{"type":"integer","description":"SKU available quantity."},"SaleChannel":{"type":"integer","description":"SKU trade policy."},"Price":{"type":"number","description":"SKU price."},"ListPrice":{"type":"number","description":"SKU list price."},"PriceWithoutDiscount":{"type":"number","description":"SKU precie without discount."},"IsAvailable":{"type":"boolean","description":"If the SKU is available or not."}}}},"AvailableSalesChannels":{"type":["string","null"],"description":"Trade policy that the SKU in contained."}}}},"LastModified":{"type":"string","description":"Time that the offer was last modified."},"ProductId":{"type":"string","description":"Product ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves existing offers of a specific SKU. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique number identifier. | + | `skuId` | path | (Required) Product unique number identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "SkuId": "5", + "EanId": "272727", + "RefId": "BIGHEROBML", + "Name": "Llf", + "NameComplete": "Cacilds Llf", + "IsActive": true, + "MainImage": { + "ImageId": "172754", + "ImageLabel": null, + "ImageTag": "\"\"", + "ImagePath": "~/arquivos/ids/172754-#width#-#height#/Diablo.jpg", + "IsMain": true, + "IsZoomSize": false, + "ImageText": null, + "LastModified": "2021-03-24T15:37:24.877" + }, + "Offers": [ + { + "SellerId": "1", + "SellerSkuId": "5", + "OffersPerSalesChannel": [ + { + "AvailableQuantity": 0, + "SaleChannel": 1, + "Price": 200, + "ListPrice": 200, + "PriceWithoutDiscount": 200, + "IsAvailable": false + }, + { + "AvailableQuantity": 0, + "SaleChannel": 2, + "Price": 200, + "ListPrice": 200, + "PriceWithoutDiscount": 200, + "IsAvailable": false + } + ], + "AvailableSalesChannels": null + } + ], + "LastModified": "2021-07-06T19:13:45.831483", + "ProductId": "3" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Search API/Offers/Search product offers.yml b/BrunoCollections/VTEX - Search API/Offers/Search product offers.yml new file mode 100644 index 0000000000..fbf147e9a2 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Offers/Search product offers.yml @@ -0,0 +1,118 @@ +info: + name: Search product offers + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/offers/:productId" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: productId + value: "3" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/offers/:productId - Schema is valid", function () { + const schema = {"type":"array","example":[{"SkuId":"5","EanId":"272727","RefId":"BIGHEROBML","Name":"Llf","NameComplete":"Cacilds Llf","IsActive":true,"MainImage":{"ImageId":"172754","ImageLabel":null,"ImageTag":"\"\"","ImagePath":"~/arquivos/ids/172754-#width#-#height#/Diablo.jpg","IsMain":true,"IsZoomSize":false,"ImageText":null,"LastModified":"2021-03-24T15:37:24.877"},"Offers":[{"SellerId":"1","SellerSkuId":"5","OffersPerSalesChannel":[{"AvailableQuantity":0,"SaleChannel":1,"Price":200,"ListPrice":200,"PriceWithoutDiscount":200,"IsAvailable":false},{"AvailableQuantity":0,"SaleChannel":2,"Price":200,"ListPrice":200,"PriceWithoutDiscount":200,"IsAvailable":false}],"AvailableSalesChannels":null}],"LastModified":"2021-07-06T19:13:45.831483","ProductId":"3"}],"items":{"type":"object","required":["SkuId","EanId","RefId","Name","NameComplete","IsActive","MainImage","Offers","LastModified","ProductId"],"properties":{"SkuId":{"type":"string","description":"SKU ID."},"EanId":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"RefId":{"type":"string","description":"Unique reference code used internally for organizational purposes."},"Name":{"type":"string","description":"SKU name."},"NameComplete":{"type":"string","description":"SKU complete name."},"IsActive":{"type":"boolean","description":"If the SKU is active or not."},"MainImage":{"type":"object","description":"General information of the main image of the SKU.","required":["ImageId","ImageLabel","ImageTag","ImagePath","IsMain","IsZoomSize","ImageText","LastModified"],"properties":{"ImageId":{"type":"string","description":"Unique identifier of the association of the Image to the SKU."},"ImageLabel":{"type":["string","null"],"description":"Image Label."},"ImageTag":{"type":"string","description":"Image HTML tag."},"ImagePath":{"type":"string","description":"Image file path."},"IsMain":{"type":"boolean","description":"If the image is the main image of the SKU or not."},"IsZoomSize":{"type":"boolean","description":"If the image has zoom applied."},"ImageText":{"type":["string","null"],"description":"General text of the image."},"LastModified":{"type":"string","description":"Time that the image was last modified."}}},"Offers":{"type":"array","description":"AKA Commertial Condition.","items":{"type":"object","required":["SellerId","SellerSkuId","OffersPerSalesChannel","AvailableSalesChannels"],"properties":{"SellerId":{"type":"string","description":"Seller ID."},"SellerSkuId":{"type":"string","description":"ID of the association of the SKU with the seller."},"OffersPerSalesChannel":{"type":"array","description":"Offers per trade policy.","items":{"type":"object","required":["AvailableQuantity","SaleChannel","Price","ListPrice","PriceWithoutDiscount","IsAvailable"],"properties":{"AvailableQuantity":{"type":"integer","description":"SKU available quantity."},"SaleChannel":{"type":"integer","description":"SKU trade policy."},"Price":{"type":"number","description":"SKU price."},"ListPrice":{"type":"number","description":"SKU list price."},"PriceWithoutDiscount":{"type":"number","description":"SKU precie without discount."},"IsAvailable":{"type":"boolean","description":"If the SKU is available or not."}}}},"AvailableSalesChannels":{"type":["string","null"],"description":"Trade policy that the SKU in contained."}}}},"LastModified":{"type":"string","description":"Time that the offer was last modified."},"ProductId":{"type":"string","description":"Product ID."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves existing offers of a specific product. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `productId` | path | (Required) Product unique number identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + ```json + [ + { + "SkuId": "5", + "EanId": "272727", + "RefId": "BIGHEROBML", + "Name": "Llf", + "NameComplete": "Cacilds Llf", + "IsActive": true, + "MainImage": { + "ImageId": "172754", + "ImageLabel": null, + "ImageTag": "\"\"", + "ImagePath": "~/arquivos/ids/172754-#width#-#height#/Diablo.jpg", + "IsMain": true, + "IsZoomSize": false, + "ImageText": null, + "LastModified": "2021-03-24T15:37:24.877" + }, + "Offers": [ + { + "SellerId": "1", + "SellerSkuId": "5", + "OffersPerSalesChannel": [ + { + "AvailableQuantity": 0, + "SaleChannel": 1, + "Price": 200, + "ListPrice": 200, + "PriceWithoutDiscount": 200, + "IsAvailable": false + }, + { + "AvailableQuantity": 0, + "SaleChannel": 2, + "Price": 200, + "ListPrice": 200, + "PriceWithoutDiscount": 200, + "IsAvailable": false + } + ], + "AvailableSalesChannels": null + } + ], + "LastModified": "2021-07-06T19:13:45.831483", + "ProductId": "3" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Search API/Offers/folder.yml b/BrunoCollections/VTEX - Search API/Offers/folder.yml new file mode 100644 index 0000000000..e73fe30693 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Offers/folder.yml @@ -0,0 +1,4 @@ +info: + name: Offers + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Search API/Search/Search for products with filter, order and pagination.yml b/BrunoCollections/VTEX - Search API/Search/Search for products with filter, order and pagination.yml new file mode 100644 index 0000000000..f6b69b2310 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Search/Search for products with filter, order and pagination.yml @@ -0,0 +1,166 @@ +info: + name: Search for products with filter, order and pagination + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/search" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: _from + value: "1" + type: query + disabled: true + - name: _to + value: "50" + type: query + disabled: true + - name: ft + value: television + type: query + disabled: true + - name: fq + value: C:/1000041/1000049/ + type: query + disabled: true + - name: O + value: OrderByNameASC + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/search - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Cluster highlight ID and name."},"productClusters":{"type":"object","description":"Product clusters' IDs and names."},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names."},"categories":{"type":"array","description":"Array of the product's categories URLs."},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs."},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference Code."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Used only in cases when you need to convert the unit of measure for sale. In common cases, use 'un'."},"unitMultiplier":{"type":"number","description":"numerical unit that multiplies the selected quantity of the product when it is inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal Type."},"isKit":{"type":"boolean","description":"If the SKU is part of a kit."},"kitItems":{"type":"array","description":"Array with information of SKUs components from a Kit.","items":{"type":"object","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU component in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU image.","items":{"type":"object","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":"string","description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"If the seller is default or not."},"commertialOffer":{"type":"object","description":"AKA Commertial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount hightlight."},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs."},"Teasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question."},"ItemMetadataAttachment":{"type":"array","description":"Item metadata attachment."},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"If the product is available or not."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples.","items":{"type":"object","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"installment options.","items":{"type":"object","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Value."},"installments":{"type":"array","description":"Installments.","items":{"type":"object","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments.","items":{"type":"object","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems.","items":{"type":"object","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens."}}}}}}}},"Videos":{"type":"array","description":"Videos."},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the store's products. This information can be filtered and ordered by a number of options. It also can be paginated, filtered and ordered. + + ## Filters + + - **Filter by full text** - `ft={searchWord}` + E.g.: `ft=television` + + - **Filter by category** - `fq=C:/{a}/{b}` + `{a}` and `{b}` are Category IDs + E.g.: `fq=C:/1000041/1000049/` + + - **Filter by brand** - `fq=B:/{a}/{b}` + `{a}` and `{b}` are Brand IDs + E.g.: `fq=B:/189385/189387/` + + - **Filter by specification** - `fq=specificationFilter_{a}:{b}` + `{a}` is the specification ID + `{b}` is the specification value + E.g.: To filter products where the color is Blue, find the specification ID for color. Suppose it is 123, then the query will be: `fq=specificationFilter_123:Blue` + + - **Filter by price range** - `fq=P:[{a} TO {b}]` + `{a}` is the minimum price "from" + `{b}` is the highest price "to" + E.g.: `fq=P:[0 TO 20]` will search products between 0.00 and 20.00. + + - **Filter by collection** - `fq=productClusterIds:{{productClusterId}}` + `productClusterId` is the same as `collectionId` + For more information about collections, read [Creating a product collection](https://help.vtex.com/en/tutorial/creating-a-product-collection). + + - **Filter by product ID** - `fq=productId:{{productId}}` + + - **Filter by SKU ID** - `fq=skuId:{{skuId}}` + + - **Filter by referenceId** - `fq=alternateIds_RefId:{{referenceId}}` + + - **Filter by EAN13** - `fq=alternateIds_Ean:{{ean13}}` + + - **Filter by availability at a specific sales channel** - `fq=isAvailablePerSalesChannel_{{sc}}:{{bool}}` + `{{sc}}` is the desired sales channel + `{{bool}}` is true ou false, 1 or 0. + E.g.: seaching available products for the sales channel 4 would be `fq=isAvailablePerSalesChannel_4:1` + + - **Filter by available at a specific seller** - `fq=sellerId:{{sellerId}}` + The search does not include White Label Sellers. + + ## Pagination + + - **Initial item number** - `_from={{first}}` + - **Final item number** - `_to={{last}}` + + >⚠️ This endpoint returns a maximum of 50 items per response, so the difference between `_from` and `_to` should not exceed this number. The result order is descending, from the highest product ID to the lowest. + + ## Sorting + + - **Price** + `O=OrderByPriceDESC` + `O=OrderByPriceASC` + + - **Top Selling Products** + `O=OrderByTopSaleDESC` + + - **Best Reviews** + `O=OrderByReviewRateDESC` + + - **Name** + `O=OrderByNameASC` + `O=OrderByNameDESC` + + - **Release Date** + `O=OrderByReleaseDateDESC` + + - **Best Discounts** + `O=OrderByBestDiscountDESC` + + - **Score** + `O=OrderByScoreDESC` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_from` | query | Starting page of the pagination range. This number must be below or equal to 2500 for the query to work. Note that the difference between the initial and final pages cannot exceed 50 pages. Therefore, each page will display a maximum of 50 items. | + | `_to` | query | Final page of the pagination range. Note that the difference between the initial and final pages cannot exceed 50 pages. Therefore, each page will display a maximum of 50 items. | + | `ft` | query | Filter by full text. The form is`ft={searchWord}`. | + | `fq` | query | General filter. It can be by category (`fq=C:{a}/{b}`), by specification (`fq=specificationFilter_{a}:{b}`), by price range (`fq=P:[{a} TO {b}]`), by collection (`fq=productClusterIds:{{productClusterId}}`), by product ID (`fq=productId:{{productId}}`), by SKU ID (`fq=skuId:{{skuId}}`), by Reference ID (`fq=alternateIds_RefId:{{referenceId}}`), by EAN13 (`fq=alternateIds_Ean:{{ean13}}`), by availability at a specific sales channel (`fq=isAvailablePerSalesChannel_{{sc}}:{{bool}}`), by available at a specific seller (`fq=sellerId:{{sellerId}}`). | + | `O` | query | Sorting method. It can be by Price (`O=OrderByPriceDESC` or `O=OrderByPriceASC`), by Top Selling Products (`O=OrderByTopSaleDESC`), by Best Reviews (`O=OrderByReviewRateDESC`), by Name (`O=OrderByNameASC` or `O=OrderByNameDESC`), by Release Date (`O=OrderByReleaseDateDESC`), by Best Discounts (`O=OrderByBestDiscountDESC`), by Score (`O=OrderByScoreDESC`). | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/Search/Search for products.yml b/BrunoCollections/VTEX - Search API/Search/Search for products.yml new file mode 100644 index 0000000000..edaf2e69ac --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Search/Search for products.yml @@ -0,0 +1,77 @@ +info: + name: Search for products + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/search/:search" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: search + value: jacket + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/search/:search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/search/:search - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/search/:search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/search/:search - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Cluster highlight ID and name."},"productClusters":{"type":"object","description":"Product clusters' IDs and names."},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names."},"categories":{"type":"array","description":"Array of the product's categories URLs."},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs."},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference Code."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Used only in cases when you need to convert the unit of measure for sale. In common cases, use 'un'."},"unitMultiplier":{"type":"number","description":"numerical unit that multiplies the selected quantity of the product when it is inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal Type."},"isKit":{"type":"boolean","description":"If the SKU is part of a kit."},"kitItems":{"type":"array","description":"Array with information of SKUs components from a Kit.","items":{"type":"object","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU component in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU image.","items":{"type":"object","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":"string","description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"If the seller is default or not."},"commertialOffer":{"type":"object","description":"AKA Commertial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount hightlight."},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs."},"Teasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question."},"ItemMetadataAttachment":{"type":"array","description":"Item metadata attachment."},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"If the product is available or not."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples.","items":{"type":"object","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"installment options.","items":{"type":"object","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Value."},"installments":{"type":"array","description":"Installments.","items":{"type":"object","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments.","items":{"type":"object","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems.","items":{"type":"object","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens."}}}}}}}},"Videos":{"type":"array","description":"Videos."},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the products related to the term searched. + This is the main search used by the store. The user can type anything to be searched. + + For example, if they search for a "decanter", this is the URL: `https://{{accountName}}.{{environment}}.com.br/api/catalog_system/pub/products/search/decanter`. + + Note that maybe the response can be HTTP 200 or 206, 206 means that it's a partial content response. + + If it is a 206 take a look at the Headers, will be an entry called resources. E.g.: resources → 0-9/19. This means that the response is showing items from 0 to 9, 10 items, but there were 19 items found. See more information at the paging route example. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `search` | path | (Required) Term used to search products | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `OK` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/Search/Search product by product URL.yml b/BrunoCollections/VTEX - Search API/Search/Search product by product URL.yml new file mode 100644 index 0000000000..516aac4389 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Search/Search product by product URL.yml @@ -0,0 +1,70 @@ +info: + name: Search product by product URL + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/catalog_system/pub/products/search/:product-text-link/p" + headers: + - name: Accept + value: application/json + - name: Content-Type + value: application/json + params: + - name: product-text-link + value: blue-shirt + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/catalog_system/pub/products/search/:product-text-link/p - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/catalog_system/pub/products/search/:product-text-link/p - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/catalog_system/pub/products/search/:product-text-link/p - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/catalog_system/pub/products/search/:product-text-link/p - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","required":["productId","productName","brand","brandId","brandImageUrl","linkText","productReference","productReferenceCode","categoryId","productTitle","metaTagDescription","releaseDate","clusterHighlights","productClusters","searchableClusters","categories","categoriesIds","link","Percentuals","Percentual","Total","Teste de Api","Ale","Teste da Api2","Alcool","allSpecifications","allSpecificationsGroups","description","items"],"properties":{"productId":{"type":"string","description":"Product unique identifier."},"productName":{"type":"string","description":"Product name."},"brand":{"type":"string","description":"Brand name."},"brandId":{"type":"integer","description":"Product brand ID."},"brandImageUrl":{"type":"string","description":"Product's brand image URL."},"linkText":{"type":"string","description":"Product URL."},"productReference":{"type":"string","description":"Product reference."},"productReferenceCode":{"type":["integer","null"],"description":"Product reference ID."},"categoryId":{"type":"string","description":"Product category ID."},"productTitle":{"type":"string","description":"Text that is in the browser tab and corresponds to the title of the product page. This field is important for SEO."},"metaTagDescription":{"type":"string","description":"Brief description of the category. It's recommended that you don't exceed 150 characters so that the search engines can display it correctly in the results page."},"releaseDate":{"type":"string","description":"Product release date."},"clusterHighlights":{"type":"object","description":"Cluster highlight ID and name."},"productClusters":{"type":"object","description":"Product clusters' IDs and names."},"searchableClusters":{"type":"object","description":"Searchable clusters IDs and names."},"categories":{"type":"array","description":"Array of the product's categories URLs."},"categoriesIds":{"type":"array","description":"Array of the product's categories IDs."},"link":{"type":"string","description":"Product URL."},"allSpecifications":{"type":"array","description":"Array of the product's specifications.","items":{"type":"string","description":"Product specification."}},"allSpecificationsGroups":{"type":"array","description":"Array of the product's specifications groups.","items":{"type":"string","description":"Product specification group."}},"description":{"type":["string","null"],"description":"Description of the main information related to the product. A simple and easy to understand summary for the customer."},"items":{"type":"array","description":"Array containing the product SKU general information.","items":{"type":"object","required":["itemId","name","nameComplete","complementName","ean","referenceId","measurementUnit","unitMultiplier","modalType","isKit","kitItems","images","sellers","Videos","estimatedDateArrival"],"properties":{"itemId":{"type":"string","description":"SKU ID."},"name":{"type":"string","description":"SKU name."},"nameComplete":{"type":"string","description":"SKU complete name."},"complementName":{"type":"string","description":"SKU complement name."},"ean":{"type":"string","description":"SKU unique identification code (barcode), accepts up to 13 numerical characters."},"referenceId":{"type":"array","description":"Reference code ID.","items":{"type":"object","required":["Key","Value"],"properties":{"Key":{"type":"string","description":"Reference Code."},"Value":{"type":"string","description":"Unique reference code used internally for organizational purposes."}}}},"measurementUnit":{"type":"string","description":"Used only in cases when you need to convert the unit of measure for sale. In common cases, use 'un'."},"unitMultiplier":{"type":"number","description":"numerical unit that multiplies the selected quantity of the product when it is inserted in the cart."},"modalType":{"type":["string","null"],"description":"Modal Type."},"isKit":{"type":"boolean","description":"If the SKU is part of a kit."},"kitItems":{"type":"array","description":"Array with information of SKUs components from a Kit.","items":{"type":"object","required":["itemId","amount"],"properties":{"itemId":{"type":"string","description":"SKU kit component ID."},"amount":{"type":"integer","description":"Amount of the SKU component in the kit."}}}},"images":{"type":"array","description":"Array of information about the SKU image.","items":{"type":"object","required":["imageId","imageLabel","imageTag","imageUrl","imageText","imageLastModified"],"properties":{"imageId":{"type":"string","description":"Image ID."},"imageLabel":{"type":"string","description":"Image label."},"imageTag":{"type":"string","description":"Image tag."},"imageUrl":{"type":"string","description":"Image URL."},"imageText":{"type":["string","null"],"description":"Image text."},"imageLastModified":{"type":"string","description":"Date and time of the last update of the image."}}}},"sellers":{"type":"array","description":"Array of SKU sellers.","items":{"type":"object","required":["sellerId","sellerName","addToCartLink","sellerDefault","commertialOffer"],"properties":{"sellerId":{"type":"string","description":"SKU seller ID."},"sellerName":{"type":"string","description":"SKU seller name."},"addToCartLink":{"type":"string","description":"URL to add the product to the cart."},"sellerDefault":{"type":"boolean","description":"If the seller is default or not."},"commertialOffer":{"type":"object","description":"AKA Commertial Condition.","required":["DeliverySlaSamplesPerRegion","Installments","DiscountHighLight","GiftSkuIds","Teasers","BuyTogether","ItemMetadataAttachment","Price","ListPrice","PriceWithoutDiscount","RewardValue","PriceValidUntil","AvailableQuantity","IsAvailable","Tax","SaleChannel","DeliverySlaSamples","GetInfoErrorMessage","CacheVersionUsedToCallCheckout","PaymentOptions"],"properties":{"DeliverySlaSamplesPerRegion":{"type":"object","description":"Delivery SLA samples per region.","properties":{"0":{"type":"object","description":"Delivery SLA ID.","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}}},"Installments":{"type":"array","description":"Installments options.","items":{"type":"object","required":["Value","InterestRate","TotalValuePlusInterestRate","NumberOfInstallments","PaymentSystemName","PaymentSystemGroupName","Name"],"properties":{"Value":{"type":"number","description":"Value of the installment."},"InterestRate":{"type":"number","description":"Interest rate of the installment."},"TotalValuePlusInterestRate":{"type":"number","description":"Total value plus interest rate of the installment."},"NumberOfInstallments":{"type":"integer","description":"Number of the installment."},"PaymentSystemName":{"type":"string","description":"Payment system name of the installment."},"PaymentSystemGroupName":{"type":"string","description":"Payment system group name of the installment."},"Name":{"type":"string","description":"Name of the installment."}}}},"DiscountHighLight":{"type":"array","description":"Discount hightlight."},"GiftSkuIds":{"type":"array","description":"Array of SKU gifts IDs."},"Teasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"k__BackingField":{"type":"object","description":"Conditions.","properties":{"k__BackingField":{"type":"integer","description":"Minimum quantity."},"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}},"k__BackingField":{"type":"object","description":"Effects.","properties":{"k__BackingField":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"k__BackingField":{"type":"string","description":"Name."},"k__BackingField":{"type":"string","description":"Value."}}}}}}}}},"PromotionTeasers":{"type":"array","description":"List with promotions teasers.","items":{"type":"object","properties":{"Name":{"type":"string","description":"Name."},"GeneralValues":{"type":"object","description":"General values. Each property follows the format: `{field}:{value}.","properties":{"{field}":{"type":"string"}}},"Conditions":{"type":"object","description":"Conditions.","properties":{"MinimumQuantity":{"type":"integer","description":"Minimum quantity."},"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}},"Effects":{"type":"object","description":"Effects.","properties":{"Parameters":{"type":"array","description":"Parameters.","items":{"type":"object","description":"Parameter.","properties":{"Name":{"type":"string","description":"Name."},"Value":{"type":"string","description":"Value."}}}}}}}}},"BuyTogether":{"type":"array","description":"Array of other products that can be bought together with the product in question."},"ItemMetadataAttachment":{"type":"array","description":"Item metadata attachment."},"Price":{"type":"number","description":"Price of the product."},"ListPrice":{"type":"number","description":"List price of the product."},"PriceWithoutDiscount":{"type":"number","description":"Price of the product without discount."},"RewardValue":{"type":"number","description":"Reward value of the product."},"PriceValidUntil":{"type":"string","description":"Price of the product valid until a certain date."},"AvailableQuantity":{"type":"integer","description":"Use the `IsAvailable` field instead."},"IsAvailable":{"type":"boolean","description":"If the product is available or not."},"Tax":{"type":"number","description":"Tax of the product."},"SaleChannel":{"type":"integer","description":"Trade policy which the product is contained."},"DeliverySlaSamples":{"type":"array","description":"Delivery SLA samples.","items":{"type":"object","required":["DeliverySlaPerTypes","Region"],"properties":{"DeliverySlaPerTypes":{"type":"array","description":"Delivery SLA per types."},"Region":{"type":["string","null"],"description":"Region."}}}},"GetInfoErrorMessage":{"type":["string","null"],"description":"Get info error message."},"CacheVersionUsedToCallCheckout":{"type":"string","description":"Cache version used to call checkout."},"PaymentOptions":{"type":"object","description":"Payment options.","required":["installmentOptions","paymentSystems","payments","giftCards","giftCardMessages","availableAccounts","availableTokens"],"properties":{"installmentOptions":{"type":"array","description":"installment options.","items":{"type":"object","required":["paymentSystem","bin","paymentName","paymentGroupName","value","installments"],"properties":{"paymentSystem":{"type":"string","description":"Payment system."},"bin":{"type":["string","null"],"description":"Bin."},"paymentName":{"type":"string","description":"Payment name."},"paymentGroupName":{"type":"string","description":"Payment group name."},"value":{"type":"integer","description":"Value."},"installments":{"type":"array","description":"Installments.","items":{"type":"object","required":["count","hasInterestRate","interestRate","value","total","sellerMerchantInstallments"],"properties":{"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."},"sellerMerchantInstallments":{"type":"array","description":"Seller merchant installments.","items":{"type":"object","required":["id","count","hasInterestRate","interestRate","value","total"],"properties":{"id":{"type":"string","description":"ID."},"count":{"type":"integer","description":"Count."},"hasInterestRate":{"type":"boolean","description":"Has interest rate."},"interestRate":{"type":"integer","description":"Interest rate."},"value":{"type":"integer","description":"Value."},"total":{"type":"integer","description":"Total."}}}}}}}}}},"paymentSystems":{"type":"array","description":"Payment systems.","items":{"type":"object","required":["id","name","groupName","validator","stringId","template","requiresDocument","isCustom","description","requiresAuthentication","dueDate","availablePayments"],"properties":{"id":{"type":"integer","description":"ID."},"name":{"type":"string","description":"Name."},"groupName":{"type":"string","description":"Group name."},"validator":{"type":["string","null"],"description":"Validator."},"stringId":{"type":"string","description":"String ID."},"template":{"type":"string","description":"Template."},"requiresDocument":{"type":"boolean","description":"If requires document or not."},"isCustom":{"type":"boolean","description":"If is custom or not."},"description":{"type":["string","null"],"description":"Description."},"requiresAuthentication":{"type":"boolean","description":"If requires authentication."},"dueDate":{"type":"string","description":"Due date."},"availablePayments":{"type":["string","null"],"description":"Available payments."}}}},"payments":{"type":"array","description":"Payments."},"giftCards":{"type":"array","description":"GiftCards."},"giftCardMessages":{"type":"array","description":"GiftCardMessages."},"availableAccounts":{"type":"array","description":"Available accounts."},"availableTokens":{"type":"array","description":"Available tokens."}}}}}}}},"Videos":{"type":"array","description":"Videos."},"estimatedDateArrival":{"type":["string","null"],"description":"Estimated date arrival."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves general information about the product of the URL you searched for. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `product-text-link` | path | (Required) Product URL | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + | `Content-Type` | header | (Required) Describes the type of the content being sent. | + + ## Example response (`200`) + + _Omitted here: 12 KB. See `example` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Search API/Search/folder.yml b/BrunoCollections/VTEX - Search API/Search/folder.yml new file mode 100644 index 0000000000..d80211c505 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/Search/folder.yml @@ -0,0 +1,4 @@ +info: + name: Search + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Search API/environments/VTEX.yml b/BrunoCollections/VTEX - Search API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Search API/opencollection.yml b/BrunoCollections/VTEX - Search API/opencollection.yml new file mode 100644 index 0000000000..961ce6d7e3 --- /dev/null +++ b/BrunoCollections/VTEX - Search API/opencollection.yml @@ -0,0 +1,26 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Search API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ This reference documents the Legacy Search API. For how that search system works (result prioritization, indexing, ranking, and field weights), see [How does VTEX search work?](https://help.vtex.com/docs/tutorials/how-does-vtex-search-work). + + This API lets you search and sort products in the Catalog using Fulltext, Category and Brand search terms. + + Retrieve product data to create custom searches and product shelves. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Session Manager API/Segment/Get segment.yml b/BrunoCollections/VTEX - Session Manager API/Segment/Get segment.yml new file mode 100644 index 0000000000..9762af3ea9 --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Segment/Get segment.yml @@ -0,0 +1,85 @@ +info: + name: Get segment + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/segments" + headers: + - name: Accept + value: application/json + auth: + type: apikey + key: vtex_session + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/segments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/segments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/segments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/segments - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing information about the segment.","properties":{"campaigns":{"type":["string","null"],"description":"Campaigns associated with the session."},"channel":{"type":"string","description":"[Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID."},"priceTables":{"type":["string","null"],"description":"Price tables associated with the session."},"regionId":{"type":"string","description":"ID of the session's region."},"utm_campaign":{"type":["string","null"],"description":"UTM campaign code."},"utm_source":{"type":["string","null"],"description":"UTM source code."},"utmi_campaign":{"type":["string","null"],"description":"UTMI campaign code."},"currencyCode":{"type":"string","description":"Currency code."},"currencySymbol":{"type":"string","description":"Currency symbol."},"countryCode":{"type":"string","description":"Country code."},"cultureInfo":{"type":"string","description":"Locale that provides culture-specific information, such as the language, sublanguage, country/region, calendar, and conventions associated with a particular culture. Read [this documentation](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=net-7.0#culture-names-and-identifiers) for more details."},"channelPrivacy":{"type":"string","description":"Defines whether or not the channel is private."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the segment, which contains additional data related to the session's context. + + + You can add certain public fields as the query string and the system will attempt to fulfill it. Values such as `cultureInfo` and `utm` are overwriteable, just keep in mind such changes will not be reflected in the client's session. + + + If you wish to change the value on the session (and thus be reflected on the segment without special query strings), then use the [Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions) endpoint. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Example response (`200`) + + ```json + { + "campaigns": null, + "channel": "1", + "priceTables": null, + "regionId": "v2.1BB18CE648B5111D0933734ED83EC783", + "utm_campaign": null, + "utm_source": null, + "utmi_campaign": null, + "currencyCode": "BRL", + "currencySymbol": "R$", + "countryCode": "BRA", + "cultureInfo": "en-US", + "channelPrivacy": "public" + } + ``` diff --git a/BrunoCollections/VTEX - Session Manager API/Segment/folder.yml b/BrunoCollections/VTEX - Session Manager API/Segment/folder.yml new file mode 100644 index 0000000000..528b4bf0b0 --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Segment/folder.yml @@ -0,0 +1,4 @@ +info: + name: Segment + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Session Manager API/Session/Create new session.yml b/BrunoCollections/VTEX - Session Manager API/Session/Create new session.yml new file mode 100644 index 0000000000..7c6a248bb1 --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Session/Create new session.yml @@ -0,0 +1,85 @@ +info: + name: Create new session + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/sessions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "public": { + "variable1": { + "value": "value1" + }, + "variable2": { + "value": "value2" + } + } + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/sessions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/sessions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/sessions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/sessions - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing session token and segment token.","properties":{"sessionToken":{"type":"string","description":"Token that identifies the user's individual session."},"segmentToken":{"type":"string","description":"Token that identifies the user's segment, shared with other users with similar navigation parameters."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new session and returns a session token and a segment token. Also stores `vtex_session` and `vtex_segment` cookies, with the same values returned in the response. + + + All parameters in the body that are not within the public namespace will be ignored. Query string items will automatically be added to the public namespace. + + + >⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers in other requests to Session Manager API in order for it to work outside of a browser environment. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Example response (`201`) + + ```json + { + "sessionToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjM5MEI4MTM1RDUzQ0MwMUY0RjA4N0YwMzA2RjhDODMzNzBDMjY4M0UiLCJ0eXAiOiJqd3QifQ.eyJhY2NvdW50LmlkIjoiYThiMjdmYjQtNjUxNi00Y2MwLTgyYjYtYTVmMmIwMTFlNmUyIiwiaWQiOiIyNmQyY2I2Yy0yMTNlLTQ5MzYtOWUyYS0xZDFlMjk5ZWMzM2IiLCJ2ZXJzaW9uIjoyLCJzdWIiOiJzZXNzaW9uIiwiYWNjb3VudCI6InNlc3Npb24iLCJleHAiOjE2OTM1Nzg5NzYsImlhdCI6MTY5Mjg4Nzc3NiwiaXNzIjoidG9rZW4tZW1pdHRlciIsImp0aSI6IjhiYWU2NzdmLWE0NTAtNGI0OC05YTBkLTViMzAwYjNiY2NkOCJ9.Ak1bn2xEA1A5dVN4qR6RI8vnZpSpLXyVxFCthMoVjmWn0HlP5BqMHEMYApDj8TPPhyxT0hGT0vkmvMQa2Mprrw", + "segmentToken": "eyJjYW1wYWlnbnMiOm51bGwsImNoYW5uZWwiOiIxIiwicHJpY2VUYWJsZXMiOm51bGwsInJlZ2lvbklkIjpudWxsLCJ1dG1fY2FtcGFpZ24iOm51bGwsInV0bV9zb3VyY2UiOm51bGwsInV0bWlfY2FtcGFpZ24iOm51bGwsImN1cnJlbmN5Q29kZSI6IkJSTCIsImN1cnJlbmN5U3ltYm9sIjoiUiQiLCJjb3VudHJ5Q29kZSI6IkJSQSIsImN1bHR1cmVJbmZvIjoiZW4tVVMiLCJjaGFubmVsUHJpdmFjeSI6InB1YmxpYyJ9" + } + ``` diff --git a/BrunoCollections/VTEX - Session Manager API/Session/Edit session.yml b/BrunoCollections/VTEX - Session Manager API/Session/Edit session.yml new file mode 100644 index 0000000000..d49b4a992c --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Session/Edit session.yml @@ -0,0 +1,93 @@ +info: + name: Edit session + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/sessions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "public": { + "variable2": { + "value": "value2_patched" + }, + "variable3": { + "value": "value3" + } + } + } + auth: + type: apikey + key: vtex_session + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/sessions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/sessions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/sessions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/sessions - Schema is valid", function () { + const schema = {"type":"object","description":"Object containing session token and segment token.","properties":{"sessionToken":{"type":"string","description":"Token that identifies the user's individual session."},"segmentToken":{"type":"string","description":"Token that identifies the user's segment, shared with other users with similar navigation parameters."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits information from a previously created sesssion. + + + This endpoint works the same way as the [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions) endpoint, but when the request is sent with a `vtex_session` and the `vtex_segment` cookies in the header, it retrieves the session first and then applies the changes instead of generating a new one. + + + Only keys inside the `public` namespace in the request body are considered, and query parameters are automatically added to the public namespace. + + + >⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Example response (`200`) + + ```json + { + "sessionToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjM5MEI4MTM1RDUzQ0MwMUY0RjA4N0YwMzA2RjhDODMzNzBDMjY4M0UiLCJ0eXAiOiJqd3QifQ.eyJhY2NvdW50LmlkIjoiYThiMjdmYjQtNjUxNi00Y2MwLTgyYjYtYTVmMmIwMTFlNmUyIiwiaWQiOiIyNmQyY2I2Yy0yMTNlLTQ5MzYtOWUyYS0xZDFlMjk5ZWMzM2IiLCJ2ZXJzaW9uIjoyLCJzdWIiOiJzZXNzaW9uIiwiYWNjb3VudCI6InNlc3Npb24iLCJleHAiOjE2OTM1Nzg5NzYsImlhdCI6MTY5Mjg4Nzc3NiwiaXNzIjoidG9rZW4tZW1pdHRlciIsImp0aSI6IjhiYWU2NzdmLWE0NTAtNGI0OC05YTBkLTViMzAwYjNiY2NkOCJ9.Ak1bn2xEA1A5dVN4qR6RI8vnZpSpLXyVxFCthMoVjmWn0HlP5BqMHEMYApDj8TPPhyxT0hGT0vkmvMQa2Mprrw", + "segmentToken": "eyJjYW1wYWlnbnMiOm51bGwsImNoYW5uZWwiOiIxIiwicHJpY2VUYWJsZXMiOm51bGwsInJlZ2lvbklkIjpudWxsLCJ1dG1fY2FtcGFpZ24iOm51bGwsInV0bV9zb3VyY2UiOm51bGwsInV0bWlfY2FtcGFpZ24iOm51bGwsImN1cnJlbmN5Q29kZSI6IkJSTCIsImN1cnJlbmN5U3ltYm9sIjoiUiQiLCJjb3VudHJ5Q29kZSI6IkJSQSIsImN1bHR1cmVJbmZvIjoiZW4tVVMiLCJjaGFubmVsUHJpdmFjeSI6InB1YmxpYyJ9" + } + ``` diff --git a/BrunoCollections/VTEX - Session Manager API/Session/Get session.yml b/BrunoCollections/VTEX - Session Manager API/Session/Get session.yml new file mode 100644 index 0000000000..6d0e971fe8 --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Session/Get session.yml @@ -0,0 +1,125 @@ +info: + name: Get session + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/sessions?items=*" + headers: + - name: Accept + value: application/json + params: + - name: items + value: "*" + type: query + auth: + type: apikey + key: vtex_session + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/sessions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/sessions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/sessions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/sessions - Schema is valid", function () { + const schema = {"type":"object","description":"Session information.","properties":{"id":{"type":"string","description":"Session ID."},"namespaces":{"type":"object","description":"Object with namespaces, each containing a set of information about the session.","properties":{"account":{"type":"object","description":"Account information related to the session.","properties":{"id":{"type":"object","description":"VTEX account ID.","properties":{"value":{"type":"string","description":"Value of the VTEX account ID."},"keepAlive":{"type":"boolean","description":"Determines whether or not the connection should be kept alive."}}},"accountName":{"type":"object","description":"VTEX account name.","properties":{"value":{"type":"string","description":"Value of the VTEX account name."}}}}},"store":{"type":"object","description":"Store information related to the session.","properties":{"channel":{"type":"object","description":"[Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID.","properties":{"value":{"type":"string","description":"Value of the [Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID."}}},"countryCode":{"type":"object","description":"Country code.","properties":{"value":{"type":"string","description":"Value of the country code."}}},"cultureInfo":{"type":"object","description":"Locale that provides culture-specific information, such as the language, sublanguage, country/region, calendar, and conventions associated with a particular culture. Read [this documentation](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=net-7.0#culture-names-and-identifiers) for more details.","properties":{"value":{"type":"string","description":"Value of the `cultureInfo` property."}}},"currencyCode":{"type":"object","description":"Currency code.","properties":{"value":{"type":"string","description":"Value of the currency code."}}},"currencySymbol":{"type":"object","description":"Currency symbol.","properties":{"value":{"type":"string","description":"Value of the currency symbol."}}},"channelPrivacy":{"type":"object","description":"Defines whether or not the channel is private.","properties":{"value":{"type":"string","description":"Value containing the channel's privacy option."}}}}},"public":{"type":"object","description":"Public and editable information related to the session.","additionalProperties":{"type":"object","description":"Custom property.","properties":{"value":{"type":"string","description":"Value of the custom property."}}}},"checkout":{"type":"object","description":"Checkout information related to the session.","properties":{"regionId":{"type":"object","description":"ID of the session's region.","properties":{"value":{"type":"string","description":"Value of the Region ID."}}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information from a previously created sesssion. + + + >⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `items` | query | (Required) Items are the keys of the values you wish to get. They follow the format `namespace1.key1,namespace2.key2`. If you wish to recover the data sent on [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it should be `public.{key}`, replacing `{key}` with the name of the custom property you created. Following the example request presented in [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it would be `public.variable1,public.variable2`. If you want to retrieve all keys from Session Manager, you can use the wildcard operator (`*`) as a value for this query parameter. | + + ## Example response (`200`) + + ```json + { + "id": "26d2cb6c-213e-4936-9e2a-1d1e299ec33b", + "namespaces": { + "account": { + "id": { + "value": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "keepAlive": true + }, + "accountName": { + "value": "apiexamples" + } + }, + "store": { + "channel": { + "value": "1" + }, + "countryCode": { + "value": "BRA" + }, + "cultureInfo": { + "value": "en-US" + }, + "currencyCode": { + "value": "BRL" + }, + "currencySymbol": { + "value": "R$" + }, + "channelPrivacy": { + "value": "public" + } + }, + "public": { + "variable1": { + "value": "value1" + }, + "variable2": { + "value": "value2" + } + }, + "checkout": { + "regionId": { + "value": "v2.1BB18CE648B5111D0933734ED83EC783" + } + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Session Manager API/Session/folder.yml b/BrunoCollections/VTEX - Session Manager API/Session/folder.yml new file mode 100644 index 0000000000..be755b84ca --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/Session/folder.yml @@ -0,0 +1,4 @@ +info: + name: Session + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Session Manager API/environments/VTEX.yml b/BrunoCollections/VTEX - Session Manager API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Session Manager API/opencollection.yml b/BrunoCollections/VTEX - Session Manager API/opencollection.yml new file mode 100644 index 0000000000..800f3584be --- /dev/null +++ b/BrunoCollections/VTEX - Session Manager API/opencollection.yml @@ -0,0 +1,17 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Session Manager API + +docs: + content: |- + Session Manager tracks the current browsing sessions of all customers on the VTEX platform. Important session information is automatically captured and stored in a secure and easily accessible location. This includes data such as relevant cookies, query strings, authentication credentials, current profile and pricing information, if applicable. Session Manager API allows developers to retrieve and manage information about sessions. No authentication is required. + + For more information, read the [Session Manager guide](https://developers.vtex.com/docs/guides/session-manager). + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/Download shipping label.yml b/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/Download shipping label.yml new file mode 100644 index 0000000000..b71422f2e8 --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/Download shipping label.yml @@ -0,0 +1,116 @@ +info: + name: Download shipping label + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/shopeeintegration/order/shipping/label?an=store01&shopeeOrderId=240101ABC123" + headers: + - name: Accept + value: application/json + params: + - name: an + value: store01 + type: query + - name: shopeeOrderId + value: 240101ABC123 + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/shopeeintegration/order/shipping/label - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/shopeeintegration/order/shipping/label - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/shopeeintegration/order/shipping/label - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/shopeeintegration/order/shipping/label - Schema is valid", function () { + const schema = {"type":"object","description":"Shipping label download payload returned by the API.","required":["message","details"],"properties":{"message":{"type":"string","description":"Summary message for the operation."},"details":{"type":"object","description":"Label metadata and encoded file returned for the Shopee order.","properties":{"statusMessage":{"type":"string","description":"Status message from the integration or Shopee flow."},"orderStatusInShopee":{"type":"array","description":"Shopee order status values applicable to the label request.","items":{"type":"string","description":"Shopee order status code or label."}},"file":{"type":"object","description":"Label file encoded in Base64 and HTTP content hints.","required":["base64Encoded","type","disposition"],"properties":{"base64Encoded":{"type":"string","description":"File content (for example a ZIP archive) encoded in Base64."},"type":{"type":"string","description":"Suggested media type for the file, often application/force-download."},"disposition":{"type":"string","description":"Suggested Content-Disposition header value for download."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns shipping label data for a Shopee order as JSON. On success the label file is included Base64-encoded (typically a ZIP archive). The credential must be valid for the account indicated by query parameter `an`. + + ## Authentication + + This endpoint requires a valid [user token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens) in the `VtexIdclientAutCookie` header (for example from Admin VTEX login). [API keys](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) are not used for this operation. + + ## Permissions + + The authenticated store user 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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name for the Shopee integration. Must match the account for which the authentication credential is valid. | + | `shopeeOrderId` | query | (Required) Shopee order identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "message": "Label retrieved successfully", + "details": { + "statusMessage": "success", + "orderStatusInShopee": [ + "READY_TO_SHIP" + ], + "file": { + "base64Encoded": "UEsDBBQAAAAIA...", + "type": "application/force-download", + "disposition": "attachment; filename=\"OpenApi_Shipping_label_Zip.Entrega%20Padr%C3%A3o%2A1.zip\"" + } + } + } + ``` diff --git a/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/folder.yml b/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/folder.yml new file mode 100644 index 0000000000..265f02a05b --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/Shopee orders/folder.yml @@ -0,0 +1,4 @@ +info: + name: Shopee orders + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/Cancel marketplace delivery.yml b/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/Cancel marketplace delivery.yml new file mode 100644 index 0000000000..502d3dc0f4 --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/Cancel marketplace delivery.yml @@ -0,0 +1,105 @@ +info: + name: Cancel marketplace delivery + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/shopeeintegration/:accountName/pub/orders/:mktplaceOrderId/cancelDelivery" + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: store01 + type: path + - name: mktplaceOrderId + value: MKT-123456 + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/shopeeintegration/:accountName/pub/orders/:mktplaceOrderId/cancelDelivery - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/shopeeintegration/:accountName/pub/orders/:mktplaceOrderId/cancelDelivery - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/shopeeintegration/:accountName/pub/orders/:mktplaceOrderId/cancelDelivery - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/shopeeintegration/:accountName/pub/orders/:mktplaceOrderId/cancelDelivery - Schema is valid", function () { + const schema = {"type":"object","description":"Generic success response payload.","properties":{"message":{"type":"string","description":"Result message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels delivery for a marketplace order received through VTEX callback. + + ## Authentication + + This endpoint requires the store admin [user token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens) in the `VtexIdclientAutCookie` header (session from Admin VTEX login). API keys (`X-VTEX-API-AppKey` / `X-VTEX-API-AppToken`) are not used for this operation. + + ## Permissions + + The authenticated store user 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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | OMS | OMS access | **View order** | + | Checkout | CheckoutResources | **Orders Full Access** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | OMS - Full access | View order | + | Checkout Admin | View order | + | IntegrationProfile - Fulfillment Oms | View order | + | OMS - Full access | Orders Full Access | + | Checkout Admin | Orders Full Access | + | IntegrationProfile - Fulfillment Oms | Orders Full Access | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) VTEX account name. | + | `mktplaceOrderId` | path | (Required) Marketplace order identifier. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "message": "Delivery cancellation completed successfully." + } + ``` diff --git a/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/folder.yml b/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/folder.yml new file mode 100644 index 0000000000..891993de38 --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/VTEX order callbacks/folder.yml @@ -0,0 +1,4 @@ +info: + name: VTEX order callbacks + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Shopee Integration API/environments/VTEX.yml b/BrunoCollections/VTEX - Shopee Integration API/environments/VTEX.yml new file mode 100644 index 0000000000..84a7a5dd4b --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: "" + - name: environment + value: "" + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Shopee Integration API/opencollection.yml b/BrunoCollections/VTEX - Shopee Integration API/opencollection.yml new file mode 100644 index 0000000000..fa51b2d9f3 --- /dev/null +++ b/BrunoCollections/VTEX - Shopee Integration API/opencollection.yml @@ -0,0 +1,21 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Shopee Integration API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: The VTEX Shopee Integration API provides endpoints for handling Shopee order webhooks, reprocessing order synchronization workflows, querying Shopee order data, and receiving VTEX marketplace order callbacks. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Create shopper document.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Create shopper document.yml new file mode 100644 index 0000000000..d5ad9d3568 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Create shopper document.yml @@ -0,0 +1,99 @@ +info: + name: Create shopper document + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/dataentities/shopper/documents?_schema=v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _schema + value: v1 + type: query + body: + type: json + data: |- + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "cards": [], + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true + } + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/dataentities/shopper/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/dataentities/shopper/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/dataentities/shopper/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/dataentities/shopper/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Response object returned when a document is successfully created.","properties":{"Id":{"type":"string","description":"Unique identifier of the document, often prefixed with the entity name."},"Href":{"type":"string","description":"URL to access the document. May be empty if not applicable."},"DocumentId":{"type":"string","description":"Same as `Id`, used internally to identify the document."}},"required":["Id","DocumentId"]}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint creates a shopper entity document. + + > ℹ️ The shopper schema supports additional properties. Clients can include extra properties (e.g., `phone2`, `marketingOptIn`) in the request body, and they will be persisted alongside the standard fields.## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_schema` | query | (Required) Schema name. The value must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": "shopper-a26301e6-1a1e-11f0-b37f-e46d3d0578c6", + "Href": "", + "DocumentId": "a26301e6-1a1e-11f0-b37f-e46d3d0578c6" + } + ``` diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Get shopper document by user ID.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Get shopper document by user ID.yml new file mode 100644 index 0000000000..9f470c50f1 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Get shopper document by user ID.yml @@ -0,0 +1,105 @@ +info: + name: Get shopper document by user ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/documents/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: 8abea412-4702-46fb-b835-3edb29d8a261 + type: path + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/documents/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/documents/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/shopper/documents/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/documents/:userId - Schema is valid", function () { + const schema = {"type":"object","description":"Shopper document. May include additional properties beyond the standard schema if they were previously stored.","properties":{"userId":{"type":"string","format":"uuid","description":"Unique identifier for the shopper."},"email":{"type":"string","description":"Shopper's email."},"firstName":{"type":"string","description":"Shopper's first name."},"lastName":{"type":"string","description":"Shopper's last name."},"document":{"type":"string","description":"Shopper's document number (e.g., CPF number)."},"documentType":{"type":"string","description":"Type of the document provided (e.g., `cpf`)."},"phone":{"type":"string","description":"Shopper's phone number."},"unitId":{"type":"string","description":"Unique ID of the Organization Unit."},"cards":{"type":"array","description":"List of cards associated with the shopper.","items":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"string","description":"Unique identifier of the saved card."},"paymentSystem":{"type":"string","description":"Code representing the payment system (e.g., `2` for Visa)."},"paymentSystemName":{"type":"string","description":"Name of the payment system (e.g., `Visa`)."},"cardNumber":{"type":"string","description":"Masked credit card number."},"bin":{"type":"string","description":"Bank Identification Number – the first digits of the card."},"expirationDate":{"type":"string","description":"Expiry date of the card in `MM/YYYY` format."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"cardLabel":{"type":"string","description":"Label or nickname for the card."},"isCardToken":{"type":"boolean","description":"Indicates whether the card data is tokenized."},"availableAddresses":{"type":"array","description":"Array of address IDs the card is associated with.","items":{"type":"string","description":"Address identifier."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a shopper entity document by User ID. + + > ℹ️ The response may include additional properties beyond the standard schema if they were previously stored (e.g., `phone2`, `marketingOptIn`).## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) Unique identifier for the shopper. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true, + "cards": [ + { + "cardId": "D05881AD4F424A6C93D8536C9F7F992E", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************3232", + "bin": "22343333", + "availableAddresses": [ + "12345" + ], + "expirationDate": "02/2029", + "useCvvForAuthorization": true, + "isCardToken": false + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Search shopper document by user ID.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Search shopper document by user ID.yml new file mode 100644 index 0000000000..a37b2deb22 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/Search shopper document by user ID.yml @@ -0,0 +1,113 @@ +info: + name: Search shopper document by user ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/search" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: _where + value: userId=8abea412-4702-46fb-b835-3edb29d8a261 + type: query + disabled: true + - name: _schema + value: v1 + type: query + disabled: true + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/search - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/search - Content-Type is application/vnd.vtex.create-budget+json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/vnd.vtex.create-budget+json"); + }); + + test("[GET]::/api/dataentities/shopper/search - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/search - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Shopper document. May include additional properties beyond the standard schema if they were previously stored.","properties":{"userId":{"type":"string","format":"uuid","description":"Unique identifier for the shopper."},"email":{"type":"string","description":"Shopper's email."},"firstName":{"type":"string","description":"Shopper's first name."},"lastName":{"type":"string","description":"Shopper's last name."},"document":{"type":"string","description":"Shopper's document number (e.g., CPF number)."},"documentType":{"type":"string","description":"Type of the document provided (e.g., `cpf`)."},"phone":{"type":"string","description":"Shopper's phone number."},"unitId":{"type":"string","description":"Unique ID of the Organization Unit."},"cards":{"type":"array","description":"List of cards associated with the shopper.","items":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"string","description":"Unique identifier of the saved card."},"paymentSystem":{"type":"string","description":"Code representing the payment system (e.g., `2` for Visa)."},"paymentSystemName":{"type":"string","description":"Name of the payment system (e.g., `Visa`)."},"cardNumber":{"type":"string","description":"Masked credit card number."},"bin":{"type":"string","description":"Bank Identification Number – the first digits of the card."},"expirationDate":{"type":"string","description":"Expiry date of the card in `MM/YYYY` format."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"cardLabel":{"type":"string","description":"Label or nickname for the card."},"isCardToken":{"type":"boolean","description":"Indicates whether the card data is tokenized."},"availableAddresses":{"type":"array","description":"Array of address IDs the card is associated with.","items":{"type":"string","description":"Address identifier."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint searches a shopper entity document by User ID. + + > ℹ️ The response may include additional properties beyond the standard schema if they were previously stored (e.g., `phone2`, `marketingOptIn`).## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `_where` | query | Unique identifier for the shopper. Use the `userId={{userId}}` value. | + | `_schema` | query | Schema name. The value must be `v1`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "userId": "8abea412-4702-46fb-b835-3edb29d8a261", + "email": "john@vtex.com", + "firstName": "John", + "lastName": "Doe", + "document": "514.427.690-33", + "documentType": "cpf", + "phone": "11917118990", + "phone2": "11987654321", + "marketingOptIn": true, + "cards": [ + { + "cardId": "D05881AD4F424A6C93D8536C9F7F992E", + "paymentSystem": "2", + "paymentSystemName": "Visa", + "cardNumber": "************3232", + "bin": "22343333", + "availableAddresses": [ + "12345" + ], + "expirationDate": "02/2029", + "useCvvForAuthorization": true, + "isCardToken": false + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper documents/folder.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/folder.yml new file mode 100644 index 0000000000..0a8e0dbe0a --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper documents/folder.yml @@ -0,0 +1,8 @@ +info: + name: Shopper documents + type: folder + seq: 2 + +docs: + content: Operations related to shopper documents. + type: text/markdown diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper schema/Get shopper schema.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper schema/Get shopper schema.yml new file mode 100644 index 0000000000..8fd5a64d30 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper schema/Get shopper schema.yml @@ -0,0 +1,166 @@ +info: + name: Get shopper schema + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/dataentities/shopper/schemas/v1" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/dataentities/shopper/schemas/v1 - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Schema name."},"schema":{"type":"object","description":"Shopper schema definition containing properties, required fields, and indexed fields.","properties":{"title":{"type":"string","description":"Schema title."},"type":{"type":"string","description":"Schema type."},"properties":{"type":"object","description":"Object containing schema properties.","properties":{"userId":{"type":"string","format":"uuid","description":"Unique shopper identifier."},"email":{"type":"string","description":"Shopper's email."},"firstName":{"type":"string","description":"Shopper's first name."},"lastName":{"type":"string","description":"Shopper's last name."},"document":{"type":"string","description":"Shopper's document number (e.g., CPF)."},"documentType":{"type":"string","description":"Type of document (e.g., `cpf`)."},"phone":{"type":"string","description":"Shopper's phone number."},"unitId":{"type":"string","description":"Unique ID of the Organization Unit."},"cards":{"type":"array","description":"Array of saved credit cards.","items":{"type":"object","description":"Credit card information.","properties":{"cardId":{"type":"string","description":"Unique identifier of the saved card."},"paymentSystem":{"type":"string","description":"Code representing the payment system (e.g., `2` for Visa)."},"paymentSystemName":{"type":"string","description":"Name of the payment system (e.g., `Visa`)."},"cardNumber":{"type":"string","description":"Masked credit card number.","pattern":"^[\\*]{12}[0-9]{4}$"},"bin":{"type":"string","description":"Bank Identification Number – the first digits of the card."},"expirationDate":{"type":"string","description":"Expiry date of the card in `MM/YYYY` format."},"useCvvForAuthorization":{"type":"boolean","description":"Indicates if CVV is required for authorization."},"cardLabel":{"type":"string","description":"Label or nickname for the card."},"isCardToken":{"type":"boolean","description":"Indicates whether the card data is tokenized."},"availableAddresses":{"type":"array","description":"Array of address IDs the card is associated with.","items":{"type":"string","description":"Address identifier."}}}}}}},"additionalProperties":{"type":"boolean","description":"When `true`, allows clients to send and persist custom fields beyond the defined schema. This enables storing extra fields like `phone2`, `marketingOptIn`, or any shopper-specific data."},"required":{"type":"array","items":{"type":"string","description":"Name of a required property field."},"description":"Required properties fields."},"v-indexed":{"type":"array","items":{"type":"string","description":"Name of an indexed property field."},"description":"Indexed properties fields."}},"required":["title","type","properties"]}},"required":["name","schema"]}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a shopper entity [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) with shopper personal data. + + > ℹ️ The shopper schema supports `additionalProperties: true`, allowing clients to send and persist additional properties beyond the defined schema properties (e.g., `phone2`, `marketingOptIn`, or any business-specific fields). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "name": "v1", + "schema": { + "title": "shopper", + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "document": { + "type": "string" + }, + "documentType": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "cards": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cardId": { + "type": "string" + }, + "paymentSystem": { + "type": "string" + }, + "paymentSystemName": { + "type": "string" + }, + "cardNumber": { + "type": "string", + "pattern": "^[\\*]{12}[0-9]{4}$" + }, + "bin": { + "type": "string" + }, + "expirationDate": { + "type": "string" + }, + "useCvvForAuthorization": { + "type": "boolean" + }, + "cardLabel": { + "type": "string" + }, + "isCardToken": { + "type": "boolean" + }, + "availableAddresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": true, + "required": [ + "userId", + "firstName", + "lastName" + ], + "v-indexed": [ + "userId", + "unitId", + "firstName", + "lastName", + "document", + "phone" + ] + } + } + ] + ``` diff --git a/BrunoCollections/VTEX - Shopper Data API/Shopper schema/folder.yml b/BrunoCollections/VTEX - Shopper Data API/Shopper schema/folder.yml new file mode 100644 index 0000000000..b1e075aac8 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/Shopper schema/folder.yml @@ -0,0 +1,8 @@ +info: + name: Shopper schema + type: folder + seq: 1 + +docs: + content: Operations related to shopper schema. + type: text/markdown diff --git a/BrunoCollections/VTEX - Shopper Data API/environments/VTEX.yml b/BrunoCollections/VTEX - Shopper Data API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Shopper Data API/opencollection.yml b/BrunoCollections/VTEX - Shopper Data API/opencollection.yml new file mode 100644 index 0000000000..28e04adaa1 --- /dev/null +++ b/BrunoCollections/VTEX - Shopper Data API/opencollection.yml @@ -0,0 +1,29 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Shopper Data API + +docs: + content: |- + The Shopper Data API allows you to create, update, and retrieve shopper personal information stored in a Master Data entity. + + The shopper schema supports `additionalProperties: true`, allowing clients to send and persist additional properties beyond the defined schema properties (e.g., `phone2`, `marketingOptIn`, or any business-specific fields). + + Learn more about [Master Data schema lifecycle](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle). + + ### Shopper Data + + - `GET` [Get shopper schema](https://developers.vtex.com/docs/api-reference/shopper-data-api#get-/api/dataentities/shopper/schemas/v1) + + - `POST` [Create shopper document](https://developers.vtex.com/docs/api-reference/shopper-data-api#post-/api/dataentities/shopper/documents) + + - `GET` [Get shopper document by User ID](https://developers.vtex.com/docs/api-reference/shopper-data-api#get-/api/dataentities/shopper/documents/-userId-) + + - `GET` [Search shopper document by User ID](https://developers.vtex.com/docs/api-reference/shopper-data-api#get-/api/dataentities/shopper/search) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign one storefront role.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign one storefront role.yml new file mode 100644 index 0000000000..cb52b89818 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign one storefront role.yml @@ -0,0 +1,92 @@ +info: + name: Assign one storefront role + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/roles/assign" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "roleId": 123, + "userId": "00000000-0000-0000-0000-000000000000" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/roles/assign - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Schema is valid", function () { + const schema = {"type":"boolean","description":"Boolean indicating if the storefront role was successfully assigned."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Assigns a specific storefront role to an existing user. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign storefront roles.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign storefront roles.yml new file mode 100644 index 0000000000..73da02dacd --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Assign storefront roles.yml @@ -0,0 +1,112 @@ +info: + name: Assign storefront roles + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/user/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roleIds": [ + 1, + 4, + 5 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/user/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"User GUID."},"roles":{"type":"array","description":"List of roles assigned to the user.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fully updates the user's role list based on the `roleIds` provided. This endpoint replaces all existing roles with the specified ones. If the user does not exist, this endpoint creates the user and assigns the indicated roles. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 4, + "name": "Buyer" + }, + { + "id": 5, + "name": "Personal Cards User" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Check storefront user resource access.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Check storefront user resource access.yml new file mode 100644 index 0000000000..4fbca58771 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Check storefront user resource access.yml @@ -0,0 +1,94 @@ +info: + name: Check storefront user resource access + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f332 + type: path + - name: resourceKey + value: PlaceOrders + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Schema is valid", function () { + const schema = {"type":"boolean","description":"Boolean indicating if the user has access to the resource."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Verifies if a specific storefront user has access to a particular storefront resource. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to check. | + | `resourceKey` | path | (Required) Storefront resource key. Check the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide for the full list of resources. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user details.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user details.yml new file mode 100644 index 0000000000..99f56e261a --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user details.yml @@ -0,0 +1,90 @@ +info: + name: Fetch storefront user details + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f33 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Schema is valid", function () { + const schema = {"type":"object","properties":{"email":{"type":"string","description":"User email address."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves storefront user details by ID. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to retrieve. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "email": "lekas53942@hazhab.com" + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user roles by email.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user roles by email.yml new file mode 100644 index 0000000000..f07d5865fe --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Fetch storefront user roles by email.yml @@ -0,0 +1,96 @@ +info: + name: Fetch storefront user roles by email + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:email/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: lekas53942@hazhab.com + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"User GUID."},"email":{"type":"string","description":"User email address."},"roles":{"type":"array","items":{"type":"string","description":"Storefront role name."},"description":"List of storefront role names assigned to the user. Check the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide for the full list of roles."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all storefront roles assigned to a specific user by email. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `email` | path | (Required) Email address of the user to retrieve roles for. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "UserId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "Email": "lekas53942@hazhab.com", + "Roles": [ + "Organizational Unit Admin" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Get storefront user roles.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Get storefront user roles.yml new file mode 100644 index 0000000000..1e3ff7cdb3 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Get storefront user roles.yml @@ -0,0 +1,100 @@ +info: + name: Get storefront user roles + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId/roles" + headers: + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f332 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"User GUID."},"identifier":{"type":"string","description":"User identifier (typically email address)."},"roles":{"type":"array","description":"List of roles assigned to the user.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the list of storefront roles assigned to a specific user. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to retrieve roles for. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "identifier": "user@example.com", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 2, + "name": "Order Approver" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Remove storefront user.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Remove storefront user.yml new file mode 100644 index 0000000000..457da1896b --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Remove storefront user.yml @@ -0,0 +1,90 @@ +info: + name: Remove storefront user + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/remove/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f33 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Schema is valid", function () { + const schema = {"type":"boolean"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a storefront user from the system, including all their storefront role assignments. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to remove. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Revoke storefront roles.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Revoke storefront roles.yml new file mode 100644 index 0000000000..56e093b918 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/Revoke storefront roles.yml @@ -0,0 +1,106 @@ +info: + name: Revoke storefront roles + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/user/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roleIds": [ + 3 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"User GUID."},"roles":{"type":"array","description":"List of roles assigned to the user after revocation.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes the specified storefront roles from a user. The endpoint ignores role IDs that do not exist or are not assigned to the user. Returns the resulting role list after removal. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 2, + "name": "Order Approver" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/folder.yml b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/folder.yml new file mode 100644 index 0000000000..5375ce4b8c --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/Storefront Permissions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Storefront Permissions + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Storefront Permissions API/environments/VTEX.yml b/BrunoCollections/VTEX - Storefront Permissions API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Storefront Permissions API/opencollection.yml b/BrunoCollections/VTEX - Storefront Permissions API/opencollection.yml new file mode 100644 index 0000000000..fa2bff4354 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Permissions API/opencollection.yml @@ -0,0 +1,49 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Storefront Permissions API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Storefront Permissions API allows you to manage user roles and resource access within the VTEX License Manager for storefront users. You can assign storefront roles to existing users, or create new users with assigned roles in a single request. The API also allows you to revoke storefront roles, check user access to resources, remove users, and fetch user roles and details. + + > ⚠️ This feature is in closed beta, meaning only specific customers can access it now. If you want to implement it in the future, please contact [our Support](https://support.vtex.com/hc/en-us/). + + >⚠️ All endpoints require the Storefront Permissions feature to be enabled for your account. Requests to accounts without this feature enabled will receive a 403 Forbidden response. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Permissions](https://developers.vtex.com/docs/guides/storefront-permissions) guide. + + ## Index + + ### Storefront Permissions + + - `POST` [Assign one storefront role](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#post-/api/license-manager/storefront/roles/assign): Assigns a specific storefront role to an existing user. + - `POST` [Assign storefront roles](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#post-/api/license-manager/storefront/user/roles): Fully updates the user's role list based on the provided role IDs. Creates the user if they do not exist. + - `DELETE` [Revoke storefront roles](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#delete-/api/license-manager/storefront/user/roles): Removes the specified storefront roles from a user. + - `GET` [Check storefront user resource access](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#get-/api/license-manager/storefront/users/{userId}/resources/{resourceKey}/granted): Verifies if a storefront user has access to a resource. + - `DELETE` [Remove storefront user](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#delete-/api/license-manager/storefront/remove/users/{userId}): Removes a user from the Storefront system. + - `GET` [Get storefront user roles](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#get-/api/license-manager/storefront/users/{userId}/roles): Retrieves the list of storefront roles assigned to a specific user. + - `GET` [Fetch storefront user roles by email](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#get-/api/license-manager/storefront/users/{email}/roles): Retrieves all storefront roles assigned to a user by email. + - `GET` [Fetch storefront user details](https://developers.vtex.com/docs/api-reference/storefront-permissions-api#get-/api/license-manager/storefront/users/{userId}): Retrieves storefront user details by ID. + + ## Common parameters + + | Parameter name | Description | Type | + | - | - | - | + | `X-VTEX-API-AppKey` | Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. | + | `X-VTEX-API-AppToken` | Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Create custom storefront resource.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Create custom storefront resource.yml new file mode 100644 index 0000000000..d1a597483a --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Create custom storefront resource.yml @@ -0,0 +1,101 @@ +info: + name: Create custom storefront resource + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/resource?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "Key": "report_viewer", + "Name": "Report Viewer", + "Description": "Allows access to reporting" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/resource - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/resource - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/resource - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/resource - Schema is valid", function () { + const schema = {"type":"object","description":"Newly created custom resource.","properties":{"Id":{"type":"integer","description":"Resource identifier."},"Key":{"type":"string","description":"Stable permission key."},"Name":{"type":"string","description":"Human-readable label."},"Description":{"type":"string","description":"Resource description."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Registers a new account-scoped permission resource. Each account may hold at most 10 custom resources. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": 42, + "Key": "report_viewer", + "Name": "Report Viewer", + "Description": "Allows access to reporting" + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Delete custom storefront resource.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Delete custom storefront resource.yml new file mode 100644 index 0000000000..e50c53b741 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/Delete custom storefront resource.yml @@ -0,0 +1,66 @@ +info: + name: Delete custom storefront resource + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/resource/:id?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: id + value: "42" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/license-manager/storefront/resource/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/resource/:id - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a account-level custom resource. Native VTEX resources cannot be deleted through this endpoint. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) Numeric ID of the custom resource to delete. | + | `an` | query | (Required) VTEX account name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/List storefront resources.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/List storefront resources.yml new file mode 100644 index 0000000000..c1bf4c440d --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/List storefront resources.yml @@ -0,0 +1,100 @@ +info: + name: List storefront resources + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/resource?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/resource - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/resource - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/resource - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/resource - Schema is valid", function () { + const schema = {"type":"array","description":"List of all resources visible to the account.","items":{"type":"object","description":"Resource information.","properties":{"Id":{"type":"integer","description":"Resource identifier. Use this value when building custom roles."},"Key":{"type":"string","description":"Stable permission key checked at runtime."},"Name":{"type":["string","null"],"description":"Human-readable label. May be `null` for native resources."},"Description":{"type":["string","null"],"description":"Optional description."},"IsCustom":{"type":"boolean","description":"Set to `true` when the resource belongs to the account or `false` for native VTEX resources."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns every storefront resource visible to the account, including native VTEX resources and the account's own custom resources. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Key": "ViewUsers", + "Name": "View Users", + "Description": null, + "IsCustom": false + }, + { + "Id": 42, + "Key": "report_viewer", + "Name": "Report Viewer", + "Description": "Allows access to reporting", + "IsCustom": true + } + ] + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/folder.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/folder.yml new file mode 100644 index 0000000000..81125e9488 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Resources/folder.yml @@ -0,0 +1,4 @@ +info: + name: Custom Storefront Resources + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Create storefront role.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Create storefront role.yml new file mode 100644 index 0000000000..adedd86c76 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Create storefront role.yml @@ -0,0 +1,113 @@ +info: + name: Create storefront role + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/role?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + body: + type: json + data: |- + { + "Name": "Report Viewer", + "Resources": [ + 1, + 7 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/role - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/role - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/role - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/role - Schema is valid", function () { + const schema = {"type":"object","description":"Newly created role.","properties":{"Id":{"type":"integer","description":"Role identifier."},"Name":{"type":"string","description":"Role name."},"Resources":{"type":"array","description":"Resources assigned to the role.","items":{"type":"object","description":"Resource information.","properties":{"Id":{"type":"integer","description":"Resource identifier."},"Key":{"type":"string","description":"Stable permission key."},"IsCustom":{"type":"boolean","description":"Set to `true` when custom or `false` for native."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new account-scoped custom role with the specified name and resource assignments. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "Id": 42, + "Name": "Report Viewer", + "Resources": [ + { + "Id": 1, + "Key": "ManageOrganizationAndContract", + "IsCustom": false + }, + { + "Id": 7, + "Key": "MyResource", + "IsCustom": true + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Delete storefront role.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Delete storefront role.yml new file mode 100644 index 0000000000..2cca486129 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Delete storefront role.yml @@ -0,0 +1,66 @@ +info: + name: Delete storefront role + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/role/:roleId?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: roleId + value: "42" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/license-manager/storefront/role/:roleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/role/:roleId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Permanently removes a custom role from the account. The role must be unassigned from all users before it can be deleted. Native VTEX roles cannot be deleted. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `roleId` | path | (Required) Numeric identifier of the role to delete. | + | `an` | query | (Required) VTEX account name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Edit storefront role resources.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Edit storefront role resources.yml new file mode 100644 index 0000000000..e2dfce5c8f --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Edit storefront role resources.yml @@ -0,0 +1,116 @@ +info: + name: Edit storefront role resources + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/api/license-manager/storefront/role/:roleId?an=apiexamples" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: roleId + value: "42" + type: path + body: + type: json + data: |- + { + "Resources": [ + 1, + 9 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/api/license-manager/storefront/role/:roleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/api/license-manager/storefront/role/:roleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/api/license-manager/storefront/role/:roleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/api/license-manager/storefront/role/:roleId - Schema is valid", function () { + const schema = {"type":"object","description":"Updated role.","properties":{"Id":{"type":"integer","description":"Role identifier."},"Name":{"type":"string","description":"Role name."},"Resources":{"type":"array","description":"Updated list of resources assigned to the role.","items":{"type":"object","description":"Resource information.","properties":{"Id":{"type":"integer","description":"Resource identifier."},"Key":{"type":"string","description":"Stable permission key."},"IsCustom":{"type":"boolean","description":"Set to `true` when custom or `false` for native."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Replaces the full resource list of an existing custom role. Send all resources you want the role to have after the update. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `roleId` | path | (Required) Numeric identifier of the role to update. | + | `an` | query | (Required) VTEX account name. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 42, + "Name": "Report Viewer", + "Resources": [ + { + "Id": 1, + "Key": "ManageOrganizationAndContract", + "IsCustom": false + }, + { + "Id": 9, + "Key": "AnotherResource", + "IsCustom": true + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Fetch storefront role by ID.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Fetch storefront role by ID.yml new file mode 100644 index 0000000000..3e4f76fca8 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/Fetch storefront role by ID.yml @@ -0,0 +1,100 @@ +info: + name: Fetch storefront role by ID + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/role/:roleId?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + - name: roleId + value: "42" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/role/:roleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/role/:roleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/role/:roleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/role/:roleId - Schema is valid", function () { + const schema = {"type":"object","description":"Role information.","properties":{"Id":{"type":"integer","description":"Role identifier."},"Name":{"type":"string","description":"Role name."},"IsCustom":{"type":"boolean","description":"Set to `true` for account-defined roles or `false` for native VTEX roles."},"Resources":{"type":"array","description":"Resources assigned to the role.","items":{"type":"object","description":"Resource information.","properties":{"Id":{"type":"integer","description":"Resource identifier."},"Key":{"type":"string","description":"Stable permission key."},"IsCustom":{"type":"boolean","description":"Set to `true` when custom or `false` for native."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a single role by its identifier. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `roleId` | path | (Required) Numeric identifier of the role to retrieve. | + | `an` | query | (Required) VTEX account name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "Id": 42, + "Name": "Report Viewer", + "IsCustom": true, + "Resources": [ + { + "Id": 1, + "Key": "ManageOrganizationAndContract", + "IsCustom": false + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/List storefront roles.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/List storefront roles.yml new file mode 100644 index 0000000000..204db92a6f --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/List storefront roles.yml @@ -0,0 +1,115 @@ +info: + name: List storefront roles + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/role?an=apiexamples" + headers: + - name: Accept + value: application/json + params: + - name: an + value: apiexamples + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/role - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/role - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/role - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/role - Schema is valid", function () { + const schema = {"type":"array","description":"List of all roles visible to the account.","items":{"type":"object","description":"Role information.","properties":{"Id":{"type":"integer","description":"Role identifier."},"Name":{"type":"string","description":"Role name."},"IsCustom":{"type":"boolean","description":"Set to `true` for account-defined roles or `false` for native VTEX roles."},"Resources":{"type":"array","description":"Resources assigned to the role.","items":{"type":"object","description":"Resource information.","properties":{"Id":{"type":"integer","description":"Resource identifier."},"Key":{"type":"string","description":"Stable permission key."},"IsCustom":{"type":"boolean","description":"Set to `true` when custom or `false` for native."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns all storefront roles visible to the account, including native VTEX roles and the account's own custom roles. An empty array is a valid response. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | (Required) VTEX account name. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "Id": 1, + "Name": "Organizational Unit Admin", + "IsCustom": false, + "Resources": [ + { + "Id": 1, + "Key": "ManageOrganizationAndContract", + "IsCustom": false + } + ] + }, + { + "Id": 42, + "Name": "Report Viewer", + "IsCustom": true, + "Resources": [ + { + "Id": 1, + "Key": "ManageOrganizationAndContract", + "IsCustom": false + }, + { + "Id": 7, + "Key": "MyResource", + "IsCustom": true + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/folder.yml b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/folder.yml new file mode 100644 index 0000000000..636bc9a682 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Custom Storefront Roles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Custom Storefront Roles + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign one storefront role.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign one storefront role.yml new file mode 100644 index 0000000000..ebf80c5141 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign one storefront role.yml @@ -0,0 +1,92 @@ +info: + name: Assign one storefront role + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/roles/assign" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "roleId": 123, + "userId": "00000000-0000-0000-0000-000000000000" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/roles/assign - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/roles/assign - Schema is valid", function () { + const schema = {"type":"boolean","description":"Boolean indicating if the storefront role was successfully assigned."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Assigns a specific storefront role to an existing user. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign storefront roles or create user with storefront roles.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign storefront roles or create user with storefront roles.yml new file mode 100644 index 0000000000..604756a2d8 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Assign storefront roles or create user with storefront roles.yml @@ -0,0 +1,112 @@ +info: + name: Assign storefront roles or create user with storefront roles + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/license-manager/storefront/user/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roleIds": [ + 1, + 4, + 5 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/license-manager/storefront/user/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/license-manager/storefront/user/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"User GUID."},"roles":{"type":"array","description":"List of roles assigned to the user.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fully updates the user's role list based on the `roleIds` provided. This endpoint replaces all existing roles with the specified ones. If the user does not exist, this endpoint creates the user and assigns the indicated roles. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 4, + "name": "Buyer" + }, + { + "id": 5, + "name": "Personal Cards User" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Check storefront user resource access.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Check storefront user resource access.yml new file mode 100644 index 0000000000..6f0a13a167 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Check storefront user resource access.yml @@ -0,0 +1,94 @@ +info: + name: Check storefront user resource access + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f332 + type: path + - name: resourceKey + value: PlaceOrders + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/resources/:resourceKey/granted - Schema is valid", function () { + const schema = {"type":"boolean","description":"Boolean indicating if the user has access to the resource."}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Verifies if a specific storefront user has access to a particular storefront resource. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to check. | + | `resourceKey` | path | (Required) Storefront resource key. Check the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide for the full list of resources. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user details.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user details.yml new file mode 100644 index 0000000000..95c18c806a --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user details.yml @@ -0,0 +1,90 @@ +info: + name: Fetch storefront user details + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f33 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId - Schema is valid", function () { + const schema = {"type":"object","properties":{"email":{"type":"string","description":"User email address."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves storefront user details by ID. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to retrieve. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "email": "lekas53942@hazhab.com" + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by ID.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by ID.yml new file mode 100644 index 0000000000..937bd31878 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by ID.yml @@ -0,0 +1,100 @@ +info: + name: Fetch storefront user roles by ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:userId/roles" + headers: + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f332 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:userId/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"User GUID."},"identifier":{"type":"string","description":"User identifier (typically email address)."},"roles":{"type":"array","description":"List of roles assigned to the user.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all storefront roles assigned to a specific user by user ID. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to retrieve roles for. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "identifier": "user@example.com", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 2, + "name": "Order Approver" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by email.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by email.yml new file mode 100644 index 0000000000..3e6c3e4a88 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Fetch storefront user roles by email.yml @@ -0,0 +1,96 @@ +info: + name: Fetch storefront user roles by email + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/api/license-manager/storefront/users/:email/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: lekas53942@hazhab.com + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/license-manager/storefront/users/:email/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"User GUID."},"email":{"type":"string","description":"User email address."},"roles":{"type":"array","items":{"type":"string","description":"Storefront role name."},"description":"List of storefront role names assigned to the user. Check the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide for the full list of roles."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all storefront roles assigned to a specific user by email. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **View Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `email` | path | (Required) Email address of the user to retrieve roles for. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "UserId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "Email": "lekas53942@hazhab.com", + "Roles": [ + "Organizational Unit Admin" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Remove storefront user.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Remove storefront user.yml new file mode 100644 index 0000000000..ea9d7a30a0 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Remove storefront user.yml @@ -0,0 +1,90 @@ +info: + name: Remove storefront user + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/remove/users/:userId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: userId + value: f0a15a42-f7fc-4b09-a9ab-fabc76d9f33 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/license-manager/storefront/remove/users/:userId - Schema is valid", function () { + const schema = {"type":"boolean"}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes a storefront user from the system, including all their storefront role assignments. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `userId` | path | (Required) GUID of the user to remove. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + true + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Revoke storefront role from user.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Revoke storefront role from user.yml new file mode 100644 index 0000000000..25d54ced9d --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/Revoke storefront role from user.yml @@ -0,0 +1,106 @@ +info: + name: Revoke storefront role from user + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/license-manager/storefront/user/roles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roleIds": [ + 3 + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[DELETE]::/api/license-manager/storefront/user/roles - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"User GUID."},"roles":{"type":"array","description":"List of roles assigned to the user after revocation.","items":{"type":"object","description":"Role information.","properties":{"id":{"type":"integer","description":"Role ID."},"name":{"type":"string","description":"Role name."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes the specified storefront roles from a user. The endpoint ignores role IDs that do not exist or are not assigned to the user. Returns the resulting role list after removal. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | Services access control | **Edit Storefront User Permissions** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "roles": [ + { + "id": 1, + "name": "Organizational Unit Admin" + }, + { + "id": 2, + "name": "Order Approver" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/folder.yml b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/folder.yml new file mode 100644 index 0000000000..b21a05d6c6 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/Storefront Roles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Storefront Roles + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Storefront Roles API/environments/VTEX.yml b/BrunoCollections/VTEX - Storefront Roles API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Storefront Roles API/opencollection.yml b/BrunoCollections/VTEX - Storefront Roles API/opencollection.yml new file mode 100644 index 0000000000..444818d2a7 --- /dev/null +++ b/BrunoCollections/VTEX - Storefront Roles API/opencollection.yml @@ -0,0 +1,36 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Storefront Roles API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + The Storefront Roles API allows you to manage user roles and resource access within the VTEX License Manager for storefront users. You can assign storefront roles to existing users, or create new users with assigned roles in a single request. The API also allows you to revoke storefront roles, check user access to resources, remove users, and fetch user roles and details. + + > ⚠️ This feature is available only for stores using B2B Buyer Portal, currently available for select accounts. + + >⚠️ All endpoints require the Storefront Roles feature to be enabled for your account. Requests to accounts without this feature enabled will receive a 403 Forbidden response. + + >ℹ️ Learn more about the available storefront roles and resources at the [Storefront Roles](https://developers.vtex.com/docs/guides/storefront-roles) guide. + + ## Common parameters + + | Parameter name | Description | Type | + | - | - | - | + | `X-VTEX-API-AppKey` | Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. | + | `X-VTEX-API-AppToken` | Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Get report status by ID.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Get report status by ID.yml new file mode 100644 index 0000000000..f8654c2418 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Get report status by ID.yml @@ -0,0 +1,45 @@ +info: + name: Get report status by ID + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/report/reportStatus/:reportId" + params: + - name: reportId + value: cillum + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/reportStatus/:reportId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the Subscription's report status, filtering by its reportId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reportId` | path | (Required) Report ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Request report by update.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Request report by update.yml new file mode 100644 index 0000000000..938330c90b --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Request report by update.yml @@ -0,0 +1,53 @@ +info: + name: Request report by update + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/report/subscriptionsUpdated?requesterEmail=user@vtex.com.br&beginDate=20190101&endDate=20190701" + params: + - name: requesterEmail + value: user@vtex.com.br + type: query + - name: beginDate + value: "20190101" + type: query + - name: endDate + value: "20190701" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/subscriptionsUpdated - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a report regarding Subscriptions updated in the date interval chosen. The report will be sent by email, to the address inserted in the API's path. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `requesterEmail` | query | (Required) Email that the report will be sent to | + | `beginDate` | query | (Required) begin date of report interval, use format yyyyMMdd | + | `endDate` | query | (Required) end date of report interval, use format yyyyMMdd | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by Status.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by Status.yml new file mode 100644 index 0000000000..9537b85c15 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by Status.yml @@ -0,0 +1,49 @@ +info: + name: Retrieve Subscription report by Status + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/report/subscriptionsByStatus?requesterEmail=user@vtex.com.br&status=1" + params: + - name: requesterEmail + value: user@vtex.com.br + type: query + - name: status + value: "1" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/subscriptionsByStatus - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Subscriptions' reports, filtering by status. The report will be sent by email, to the address inserted in the API's path. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `requesterEmail` | query | (Required) Email that the report will be sent to | + | `status` | query | (Required) Binary OR of the following status: 1 - ACTIVE; 2 - PAUSED; 4 - CANCELED; 8 - EXPIRED | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by date.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by date.yml new file mode 100644 index 0000000000..d574fb53b0 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by date.yml @@ -0,0 +1,53 @@ +info: + name: Retrieve Subscription report by date + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/report/subscriptionsByDate?requesterEmail=user@vtex.com.br&beginDate=20190101&endDate=20190701" + params: + - name: requesterEmail + value: user@vtex.com.br + type: query + - name: beginDate + value: "20190101" + type: query + - name: endDate + value: "20190701" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/subscriptionsByDate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a report with the subscriptions created at the date interval requested + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `requesterEmail` | query | (Required) Email that the report will be sent to | + | `beginDate` | query | (Required) begin date of report interval, use format yyyyMMdd | + | `endDate` | query | (Required) end date of report interval, use format yyyyMMdd | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by order date.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by order date.yml new file mode 100644 index 0000000000..5524570376 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by order date.yml @@ -0,0 +1,53 @@ +info: + name: Retrieve Subscription report by order date + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/report/subscriptionsOrderByDate?requesterEmail=user@vtex.com.br&beginDate=20190101&endDate=20190701" + params: + - name: requesterEmail + value: user@vtex.com.br + type: query + - name: beginDate + value: "20190101" + type: query + - name: endDate + value: "20190701" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/subscriptionsOrderByDate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a report regarding the Subscriptions created during the date interval of orders. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `requesterEmail` | query | (Required) Email that the report will be sent to | + | `beginDate` | query | (Required) begin date of report interval, use format yyyyMMdd | + | `endDate` | query | (Required) end date of report interval, use format yyyyMMdd | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by schedule.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by schedule.yml new file mode 100644 index 0000000000..c559974785 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/Retrieve Subscription report by schedule.yml @@ -0,0 +1,53 @@ +info: + name: Retrieve Subscription report by schedule + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/report/subscriptionsScheduled?requesterEmail=user@vtex.com.br&beginDate=20190101&endDate=20190701" + params: + - name: requesterEmail + value: user@vtex.com.br + type: query + - name: beginDate + value: "20190101" + type: query + - name: endDate + value: "20190701" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/report/subscriptionsScheduled - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a report regarding the Subscriptions scheduled to execute at the date interval requested + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `requesterEmail` | query | (Required) Email that the report will be sent to | + | `beginDate` | query | (Required) begin date of report interval, use format yyyyMMdd | + | `endDate` | query | (Required) end date of report interval, use format yyyyMMdd | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Report/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/folder.yml new file mode 100644 index 0000000000..e523f8e327 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Report/folder.yml @@ -0,0 +1,4 @@ +info: + name: Report + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Edit Subscriptions settings.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Edit Subscriptions settings.yml new file mode 100644 index 0000000000..5f65a3b44e --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Edit Subscriptions settings.yml @@ -0,0 +1,108 @@ +info: + name: Edit Subscriptions settings + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "slaOption": "NONE", + "defaultSla": null, + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": false, + "isMultipleInstallmentsEnabledOnUpdate": false, + "orderCustomDataAppId": null, + "postponeExpiration": false, + "manualPriceAllowed": false, + "useItemPriceFromOriginalOrder": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/settings - Schema is valid", function () { + const schema = {"title":"","description":"Subscriptions settings","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"title":"slaOption","description":"Delivery method.","type":"string","default":"","example":"NONE"},"defaultSla":{"title":"defaultSla","description":"Default delivery method.","type":["string","null"],"default":null,"example":null},"isUsingV3":{"title":"isUsingV3","description":"Indicates whether or not Subscriptions V3 is enabled.","type":"boolean","default":false,"example":true},"onMigrationProcess":{"title":"onMigrationProcess","description":"Indicates whether or not the account is in the migration process to Subscriptions V3.","type":"boolean","default":false,"example":false},"executionHourInUtc":{"title":"executionHourInUtc","description":"Indicates the time future subscription orders will be generated.","type":"integer","default":0,"example":9},"workflowVersion":{"title":"workflowVersion","description":"Workflow version.","type":"string","default":"","example":"1.1"},"deliveryChannels":{"title":"deliveryChannels","description":"Array containing delivery channels.","type":"array","default":[],"items":{"title":"","description":"Type of delivery channel. The values that are possible are: `pickup-in-point` for pickup point and `delivery` for regular delivery.","type":"string","default":"","example":"delivery"},"example":"delivery"},"randomIdGeneration":{"title":"randomIdGeneration","description":"Defines whether or not the subscription order IDs will be randomly generated.","type":"boolean","default":false,"example":false},"isMultipleInstallmentsEnabledOnCreation":{"title":"isMultipleInstallmentsEnabledOnCreation","description":"Defines whether or not multiple installments are enabled when a subscription is created.","type":"boolean","default":false,"example":false},"isMultipleInstallmentsEnabledOnUpdate":{"title":"isMultipleInstallmentsEnabledOnUpdate","description":"Defines whether or not multiple installments are enabled when a subscription is updated.","type":"boolean","default":false,"example":false},"orderCustomDataAppId":{"title":"orderCustomDataAppId","description":"When filled, this field passes along the `customData` infomration in the order to the future recurrent subscription orders.","type":"string","default":null,"example":null},"postponeExpiration":{"title":"postponeExpiration","description":"Defines whether or not the expiration of subscriptions can be postponed.","type":"boolean","default":false,"example":false},"manualPriceAllowed":{"title":"manualPriceAllowed","description":"When set to `true`, this property enables manual price configuration in subscription items. This is valid for all existing subscriptions, provided that there is a manual price configured and that `isUsingV3` is `true`.","type":"boolean","default":false,"example":false},"useItemPriceFromOriginalOrder":{"title":"useItemPriceFromOriginalOrder","description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions, created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` property is set to `true` and that `isUsingV3` is `true`.","type":"boolean","default":false,"example":false}},"example":{"slaOption":"NONE","defaultSla":null,"isUsingV3":true,"onMigrationProcess":false,"executionHourInUtc":9,"workflowVersion":"1.1","deliveryChannels":["delivery"],"randomIdGeneration":false,"isMultipleInstallmentsEnabledOnCreation":false,"isMultipleInstallmentsEnabledOnUpdate":false,"orderCustomDataAppId":null,"postponeExpiration":false,"manualPriceAllowed":false,"useItemPriceFromOriginalOrder":false}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits Subscriptions settings in your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + + ## Example response (`200`) + + ```json + { + "slaOption": "NONE", + "defaultSla": null, + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": false, + "isMultipleInstallmentsEnabledOnUpdate": false, + "orderCustomDataAppId": null, + "postponeExpiration": false, + "manualPriceAllowed": false, + "useItemPriceFromOriginalOrder": false + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Get Subscriptions Settings.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Get Subscriptions Settings.yml new file mode 100644 index 0000000000..f012a8403d --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/Get Subscriptions Settings.yml @@ -0,0 +1,89 @@ +info: + name: Get Subscriptions Settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/settings" + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/settings - Schema is valid", function () { + const schema = {"title":"","description":"Subscriptions settings","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"title":"slaOption","description":"Delivery method.","type":"string","default":"","example":"NONE"},"defaultSla":{"title":"defaultSla","description":"Default delivery method.","type":["string","null"],"default":null,"example":null},"isUsingV3":{"title":"isUsingV3","description":"Indicates whether or not Subscriptions V3 is enabled.","type":"boolean","default":false,"example":true},"onMigrationProcess":{"title":"onMigrationProcess","description":"Indicates whether or not the account is in the migration process to Subscriptions V3.","type":"boolean","default":false,"example":false},"executionHourInUtc":{"title":"executionHourInUtc","description":"Indicates the time future subscription orders will be generated.","type":"integer","default":0,"example":9},"workflowVersion":{"title":"workflowVersion","description":"Workflow version.","type":"string","default":"","example":"1.1"},"deliveryChannels":{"title":"deliveryChannels","description":"Array containing delivery channels.","type":"array","default":[],"items":{"title":"","description":"Type of delivery channel. The values that are possible are: `pickup-in-point` for pickup point and `delivery` for regular delivery.","type":"string","default":"","example":"delivery"},"example":"delivery"},"randomIdGeneration":{"title":"randomIdGeneration","description":"Defines whether or not the subscription order IDs will be randomly generated.","type":"boolean","default":false,"example":false},"isMultipleInstallmentsEnabledOnCreation":{"title":"isMultipleInstallmentsEnabledOnCreation","description":"Defines whether or not multiple installments are enabled when a subscription is created.","type":"boolean","default":false,"example":false},"isMultipleInstallmentsEnabledOnUpdate":{"title":"isMultipleInstallmentsEnabledOnUpdate","description":"Defines whether or not multiple installments are enabled when a subscription is updated.","type":"boolean","default":false,"example":false},"orderCustomDataAppId":{"title":"orderCustomDataAppId","description":"When filled, this field passes along the `customData` infomration in the order to the future recurrent subscription orders.","type":"string","default":null,"example":null},"postponeExpiration":{"title":"postponeExpiration","description":"Defines whether or not the expiration of subscriptions can be postponed.","type":"boolean","default":false,"example":false},"manualPriceAllowed":{"title":"manualPriceAllowed","description":"When set to `true`, this property enables manual price configuration in subscription items. This is valid for all existing subscriptions, provided that there is a manual price configured and that `isUsingV3` is `true`.","type":"boolean","default":false,"example":false},"useItemPriceFromOriginalOrder":{"title":"useItemPriceFromOriginalOrder","description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions, created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` property is set to `true` and that `isUsingV3` is `true`.","type":"boolean","default":false,"example":false}},"example":{"slaOption":"NONE","defaultSla":null,"isUsingV3":true,"onMigrationProcess":false,"executionHourInUtc":9,"workflowVersion":"1.1","deliveryChannels":["delivery"],"randomIdGeneration":false,"isMultipleInstallmentsEnabledOnCreation":false,"isMultipleInstallmentsEnabledOnUpdate":false,"orderCustomDataAppId":null,"postponeExpiration":false,"manualPriceAllowed":false,"useItemPriceFromOriginalOrder":false}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists the current Subscriptions settings in your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + + ## Example response (`200`) + + ```json + { + "slaOption": "NONE", + "defaultSla": null, + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": false, + "isMultipleInstallmentsEnabledOnUpdate": false, + "orderCustomDataAppId": null, + "postponeExpiration": false, + "manualPriceAllowed": false, + "useItemPriceFromOriginalOrder": false + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/folder.yml new file mode 100644 index 0000000000..31562537dd --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Settings/folder.yml @@ -0,0 +1,4 @@ +info: + name: Settings + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Add Subscription item by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Add Subscription item by groupId.yml new file mode 100644 index 0000000000..5b29e892d7 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Add Subscription item by groupId.yml @@ -0,0 +1,65 @@ +info: + name: Add Subscription item by groupId + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/subscriptions-group/:groupId/additem" + headers: + - name: Content-Type + value: application/json + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "sku": { + "id": "string", + "name": "string", + "productName": "string", + "imageUrl": "string", + "detailUrl": "string", + "nameComplete": "string" + }, + "quantity": 0, + "priceAtSubscriptionDate": 0, + "sellingPrice": 0, + "endpoint": "string" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/subscriptions-group/:groupId/additem - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds an SKU to a given Subscription, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Cancel Subscription by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Cancel Subscription by groupId.yml new file mode 100644 index 0000000000..8373be4f65 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Cancel Subscription by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Cancel Subscription by groupId + type: http + seq: 6 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions-group/:groupId/cancel" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions-group/:groupId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels Subscription by `groupId` + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Conversation Message by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Conversation Message by groupId.yml new file mode 100644 index 0000000000..c4327d042f --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Conversation Message by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Get Conversation Message by groupId + type: http + seq: 13 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/conversation-message" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/conversation-message - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the conversation of a given Subscription group, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Next purchase.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Next purchase.yml new file mode 100644 index 0000000000..b108988ab4 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Next purchase.yml @@ -0,0 +1,45 @@ +info: + name: Get Next purchase + type: http + seq: 16 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/nextPurchase/:dateStr" + params: + - name: dateStr + value: cillum + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/nextPurchase/:dateStr - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists details of a given subscription group's next purchase, filtering by dateStr. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `dateStr` | path | (Required) Reference date that retrieves all next purchases, starting from the dateStr inserted. Must be in the format of {{yyyyMMdd}} | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Simulation by subscription-group.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Simulation by subscription-group.yml new file mode 100644 index 0000000000..e5a622dfc5 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Simulation by subscription-group.yml @@ -0,0 +1,45 @@ +info: + name: Get Simulation by subscription-group + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/simulate/:groupId" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/simulate/:groupId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Subscription simulations, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Subscription by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Subscription by groupId.yml new file mode 100644 index 0000000000..8a28af7c15 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get Subscription by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Get Subscription by groupId + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists Subscription details, filtering by `groupId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get addresses by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get addresses by groupId.yml new file mode 100644 index 0000000000..730aba26d0 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get addresses by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Get addresses by groupId + type: http + seq: 8 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/addresses" + params: + - name: groupId + value: "" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists addresses linked to a given Subscription group, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get frequency options by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get frequency options by groupId.yml new file mode 100644 index 0000000000..736f7d6342 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get frequency options by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Get frequency options by groupId + type: http + seq: 11 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/frequency-options" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/frequency-options - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists frequency options of a given Subscription group, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get payment System by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get payment System by groupId.yml new file mode 100644 index 0000000000..81b3e029cf --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get payment System by groupId.yml @@ -0,0 +1,45 @@ +info: + name: Get payment System by groupId + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/payment-systems" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/payment-systems - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves payment system's information of a given Subscription group, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get subscription group list.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get subscription group list.yml new file mode 100644 index 0000000000..d4a5ece06a --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Get subscription group list.yml @@ -0,0 +1,41 @@ +info: + name: Get subscription group list + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/list" + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of Subscription groups in your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Insert Addresses by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Insert Addresses by groupId.yml new file mode 100644 index 0000000000..535bc944f7 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Insert Addresses by groupId.yml @@ -0,0 +1,79 @@ +info: + name: Insert Addresses by groupId + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/subscriptions-group/:groupId/addresses" + headers: + - name: Content-Type + value: application/json + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "addressId": "string", + "street": "string", + "number": "string", + "complement": "string", + "neighborhood": "string", + "city": "string", + "state": "string", + "country": "string", + "postalCode": "string", + "reference": "string", + "formattedAddress": "string", + "additionalComponents": [ + { + "longName": "string", + "shortName": "string", + "types": [ + "string" + ] + } + ], + "geoCoordinate": [ + 0 + ], + "receiverName": "string", + "addressType": "string", + "addressName": "string" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/subscriptions-group/:groupId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Insert address information of a given Subscription group, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List 'Will create' by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List 'Will create' by groupId.yml new file mode 100644 index 0000000000..d90cbbf88f --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List 'Will create' by groupId.yml @@ -0,0 +1,45 @@ +info: + name: List 'Will create' by groupId + type: http + seq: 14 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/will-create" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/will-create - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves Subscription groups listed as 'will create', filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List All subscription groups.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List All subscription groups.yml new file mode 100644 index 0000000000..317989e053 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List All subscription groups.yml @@ -0,0 +1,41 @@ +info: + name: List All subscription groups + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group" + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all subscription groups in your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List Subscription group's Configuration.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List Subscription group's Configuration.yml new file mode 100644 index 0000000000..309b6ce223 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/List Subscription group's Configuration.yml @@ -0,0 +1,45 @@ +info: + name: List Subscription group's Configuration + type: http + seq: 15 + +http: + method: GET + url: "{{baseUrl}}/subscriptions-group/:groupId/config" + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions-group/:groupId/config - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details about a given subscription group's configuration, filtering by groupId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Retry subscription by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Retry subscription by groupId.yml new file mode 100644 index 0000000000..113c1ca23b --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Retry subscription by groupId.yml @@ -0,0 +1,49 @@ +info: + name: Retry subscription by groupId + type: http + seq: 12 + +http: + method: POST + url: "{{baseUrl}}/subscriptions-group/:groupid/instances/:instanceId/retry" + params: + - name: groupid + value: "1" + type: path + - name: instanceId + value: cillum + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/subscriptions-group/:groupid/instances/:instanceId/retry - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Permits the retry of a Subscription group, via API, filtering by groupId and instanceId. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupid` | path | (Required) Group ID. | + | `instanceId` | path | (Required) Instance ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Update Subscription by groupId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Update Subscription by groupId.yml new file mode 100644 index 0000000000..dcacc05fcb --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/Update Subscription by groupId.yml @@ -0,0 +1,149 @@ +info: + name: Update Subscription by groupId + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions-group/:groupId" + headers: + - name: Content-Type + value: application/json + params: + - name: groupId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "item": [ + { + "sku": { + "id": "string", + "name": "string", + "productName": "string", + "imageUrl": "string", + "detailUrl": "string", + "nameComplete": "string" + }, + "quantity": 0, + "endpoint": "string", + "priceAtSubscriptionDate": 0, + "sellingPrice": 0, + "SubscriptionId": "string", + "cycleCount": 0, + "status": "ACTIVE", + "createdAt": "2019-06-20T18:27:41.23Z", + "lastUpdate": "2019-06-20T18:27:41.23Z", + "originalOrderId": "string", + "originalItemIndex": 0, + "metadata": [ + { + "name": "string", + "properties": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + } + } + ], + "isSkipped": true + } + ], + "plan": { + "frequency": { + "periodicity": "string", + "interval": 0 + }, + "validity": { + "begin": "2019-06-20T18:27:41.23Z", + "end": "2019-06-20T18:27:41.23Z" + }, + "type": "string" + }, + "purchaseSettings": { + "purchaseDay": "string", + "paymentMethod": { + "paymentSystem": "string", + "paymentAccountId": "string" + }, + "seller": "string", + "salesChannel": "string", + "selectedSla": "string", + "currencyCode": "string" + }, + "shippingAddress": { + "addressId": "string", + "street": "string", + "number": "string", + "complement": "string", + "neighborhood": "string", + "city": "string", + "state": "string", + "country": "string", + "postalCode": "string", + "reference": "string", + "formattedAddress": "string", + "additionalComponents": [ + { + "longName": "string", + "shortName": "string", + "types": [ + "string" + ] + } + ], + "geoCoordinate": [ + 0 + ], + "receiverName": "string", + "addressType": "string", + "addressName": "string" + }, + "status": "string", + "isSkipped": true, + "metadata": [ + { + "name": "string", + "properties": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions-group/:groupId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a Subscription by `groupId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `groupId` | path | (Required) Group ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/folder.yml new file mode 100644 index 0000000000..6cf9dfb8af --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscription Group/folder.yml @@ -0,0 +1,4 @@ +info: + name: Subscription Group + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Cancel Subscriptions by SubscriptionId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Cancel Subscriptions by SubscriptionId.yml new file mode 100644 index 0000000000..53b53913fe --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Cancel Subscriptions by SubscriptionId.yml @@ -0,0 +1,45 @@ +info: + name: Cancel Subscriptions by SubscriptionId + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions/:subscriptionId/cancel" + params: + - name: subscriptionId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions/:subscriptionId/cancel - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Cancels all Subscriptions of a subscription group. This operation does not have a rollback. Once canceled, it cannot be reactivated. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) Subscription ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get Subscription List.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get Subscription List.yml new file mode 100644 index 0000000000..be5f488a63 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get Subscription List.yml @@ -0,0 +1,41 @@ +info: + name: Get Subscription List + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/list" + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/list - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of Subscriptions linked to your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get frequency options by subscriptionId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get frequency options by subscriptionId.yml new file mode 100644 index 0000000000..97bda98a70 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Get frequency options by subscriptionId.yml @@ -0,0 +1,45 @@ +info: + name: Get frequency options by subscriptionId + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/:subscriptionId/frequency-options" + params: + - name: subscriptionId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/:subscriptionId/frequency-options - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists frequency options for the Subscription, filtering by `subscriptionId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) Subscription ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Insert Addresses for Subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Insert Addresses for Subscription.yml new file mode 100644 index 0000000000..672a7e9704 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Insert Addresses for Subscription.yml @@ -0,0 +1,71 @@ +info: + name: Insert Addresses for Subscription + type: http + seq: 6 + +http: + method: POST + url: "{{baseUrl}}/subscriptions/:subscriptionId/addresses" + headers: + - name: Content-Type + value: application/json + params: + - name: subscriptionId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + [ + { + "addressId": "1234567890", + "street": "Avenida do Estado", + "number": "1", + "complement": null, + "neighborhood": "Barra da Tijuca", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "postalCode": "22204-004", + "reference": null, + "formattedAddress": null, + "additionalComponents": null, + "geoCoordinate": null, + "receiverName": "Fulano", + "addressType": "residential", + "addressName": "xt5353818181nhshs" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/subscriptions/:subscriptionId/addresses - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Inserts address's information to complement the Subscription details. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) Subscription ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve customer's subscriptions.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve customer's subscriptions.yml new file mode 100644 index 0000000000..da0d3aa058 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve customer's subscriptions.yml @@ -0,0 +1,45 @@ +info: + name: Retrieve customer's subscriptions + type: http + seq: 5 + +http: + method: GET + url: "{{baseUrl}}/subscriptions?customerId=user@vtex.com.br" + params: + - name: customerId + value: user@vtex.com.br + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves details of a given customer's subscriptions, searching by that customer's `customerId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | + | `customerId` | query | (Required) Customer ID. | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve subscription by ID.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve subscription by ID.yml new file mode 100644 index 0000000000..4a5277dc52 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Retrieve subscription by ID.yml @@ -0,0 +1,45 @@ +info: + name: Retrieve subscription by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/subscriptions/:subscriptionId" + params: + - name: subscriptionId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[GET]::/subscriptions/:subscriptionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists Subscription's details, searching by `subscriptionId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) Subscription ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Update Subscriptions by SubscriptionId.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Update Subscriptions by SubscriptionId.yml new file mode 100644 index 0000000000..9ea2a36c89 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/Update Subscriptions by SubscriptionId.yml @@ -0,0 +1,129 @@ +info: + name: Update Subscriptions by SubscriptionId + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/subscriptions/:subscriptionId" + headers: + - name: Content-Type + value: application/json + params: + - name: subscriptionId + value: "1" + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + body: + type: json + data: |- + { + "item": { + "sku": { + "id": "string", + "name": "string", + "productName": "string", + "imageUrl": "string", + "detailUrl": "string", + "nameComplete": "string" + }, + "quantity": 0, + "priceAtSubscriptionDate": 0, + "sellingPrice": 0, + "endpoint": "string" + }, + "plan": { + "frequency": { + "periodicity": "string", + "interval": 0 + }, + "validity": { + "begin": "2019-07-04T14:40:30.819Z", + "end": "2019-07-04T14:40:30.819Z" + }, + "type": "string" + }, + "purchaseSettings": { + "purchaseDay": "string", + "paymentMethod": { + "paymentSystem": "string", + "paymentAccountId": "string" + }, + "seller": "string", + "salesChannel": "string", + "selectedSla": "string", + "currencyCode": "string" + }, + "shippingAddress": { + "addressId": "string", + "street": "string", + "number": "string", + "complement": "string", + "neighborhood": "string", + "city": "string", + "state": "string", + "country": "string", + "postalCode": "string", + "reference": "string", + "formattedAddress": "string", + "additionalComponents": [ + { + "longName": "string", + "shortName": "string", + "types": [ + "string" + ] + } + ], + "geoCoordinate": [ + 0 + ], + "receiverName": "string", + "addressType": "string", + "addressName": "string" + }, + "status": "string", + "isSkipped": true, + "metadata": [ + { + "name": "string", + "properties": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + } + } + ] + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/subscriptions/:subscriptionId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Update, add or alter information of a given Subscription, filtering by `subscriptionId`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) Subscription ID. | + | `accountName` | path | Name of the VTEX account. Used as part of the URL | + | `environment` | path | Environment to use. Used as part of the URL. (This can only be one of vtexcommercestable) | diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/folder.yml new file mode 100644 index 0000000000..f60fb154fc --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/Subscriptions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Subscriptions + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/environments/VTEX.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/environments/VTEX.yml new file mode 100644 index 0000000000..b3b412d612 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api/rns + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Subscriptions API (v2)/opencollection.yml b/BrunoCollections/VTEX - Subscriptions API (v2)/opencollection.yml new file mode 100644 index 0000000000..7196544e60 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v2)/opencollection.yml @@ -0,0 +1,28 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Subscriptions API (v2) + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + VTEX Subscriptions REST API Documentation + + This documentation describes the available REST APIs for VTEX Subscription System. + + With Subscriptions you can set up regularly scheduled deliveries. + + All requests need authorization (VTEX Id authentication token or VTEX Appkey and Apptoken headers) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Get cycle details.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Get cycle details.yml new file mode 100644 index 0000000000..2f844885a2 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Get cycle details.yml @@ -0,0 +1,133 @@ +info: + name: Get cycle details + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/cycles/:cycleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cycleId + value: 2b9de8a5-b29b-4e18-8400-400dc0a2330d + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about the subscription cycle.","properties":{"id":{"type":"string","description":"Cycle ID. When the `cycleCount` value is `1`, the `id` value will be the same as the `subscriptionId` value."},"subscriptionId":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"workflowId":{"type":"string","description":"Code that identifies the subscription in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"status":{"type":"string","description":"Subscription cycle execution status. The possible values are:\r\n- `TRIGGERED`: Execution has been triggered. \r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.","enum":["TRIGGERED","IN_PROCESS","FAILURE","SUCCESS","EXPIRED","ORDER_ERROR","PAYMENT_ERROR","SKIPED","SUCCESS_WITH_NO_ORDER","SUCCESS_WITH_PARTIAL_ORDER","RE_TRIGGERED","SCHEDULE_UPDATED"]},"customerEmail":{"type":"string","description":"Customer email."},"customerId":{"type":"string","description":"Customer ID."},"date":{"type":"string","format":"date-time","description":"Current date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":"string","format":"date-time","description":"Subscription cycle last update date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"isInRetry":{"type":"boolean","description":"Defines if the cycle execution is in retry (`true`), or not (`false`)."},"message":{"type":["string","null"],"description":"Cycle execution message."},"friendlyMessage":{"type":["string","null"],"description":"Cycle execution friendly message."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"orderInfo":{"type":"object","description":"Subscription order information.","properties":{"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"paymentURL":{"type":["string","null"],"description":"Order payment URL."},"value":{"type":"integer","format":"int64","description":"Order value in cents."}}},"context":{"type":"object","description":"Subscription cycle context.","properties":{"items":{"type":["array","null"],"description":"Information about subscription cycle items.","items":{"type":"object","description":"Subscription item information.","properties":{"subscriptionItemId":{"type":["string","null"],"description":"Subscription item ID."},"skuId":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":["integer","null"],"description":"Quantity of item units."},"status":{"type":["string","null"],"description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":["boolean","null"],"description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"cycleCount":{"type":["integer","null"],"description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."}}}},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."},"paymentSystemGroup":{"type":["string","null"],"description":"Payment system group."},"paymentAccountId":{"type":["string","null"],"description":"Information about the customer profile and their documents, such as a credit card number. You can also retrieve that information using the [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles) endpoint."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"addressType":{"type":["string","null"],"description":"Shipping address type."},"catalogAttachment":{"type":["string","null"],"description":"Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content, when applicable."}}},"simulationItems":{"type":["array","null"],"description":"Subscription simulation items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve a specific cycle by its ID. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `cycleId` | path | (Required) ID from the desired cycle. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730", + "subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d", + "workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a", + "status": "SUCCESS", + "customerEmail": "customer@email.com", + "customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju", + "date": "2024-07-30T09:04:59.7325176Z", + "lastUpdate": "2024-07-31T09:06:05.6879323Z", + "cycleCount": 3, + "isInRetry": false, + "message": null, + "friendlyMessage": null, + "plan": { + "id": "store.subscription.tshirt-collection", + "frequency": { + "periodicity": "WEEKLY", + "interval": 3 + }, + "validity": { + "begin": "2024-04-11T11:04:24.0454821Z", + "end": null + }, + "purchaseDay": "Sunday" + }, + "orderInfo": { + "orderId": "V-8753228-01", + "orderGroup": "V-8753228", + "paymentUrl": null, + "value": 21600 + }, + "context": { + "items": [ + { + "subscriptionItem": "69C872657263439D899265717E733A84", + "skuId": "1154", + "quantity": 1, + "status": "ACTIVE", + "isSkipped": false, + "cycleCount": 1 + } + ], + "paymentSystem": "47", + "paymentSystemName": "Cash", + "paymentSystemGroup": "cash", + "paymentAccountId": null, + "addressId": "Address", + "addressType": "residential", + "catalogAttachment": "vtex.subscription.tshirt-collection" + }, + "simulationItems": [ + { + "id": "1145", + "quantity": 1, + "unitPrice": 21600, + "status": "OK", + "price": null, + "sellingPrice": 21600, + "manualPrice": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/List cycles.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/List cycles.yml new file mode 100644 index 0000000000..1836088a74 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/List cycles.yml @@ -0,0 +1,166 @@ +info: + name: List cycles + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/cycles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: beginDate + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: endDate + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: subscriptionId + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: customerEmail + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: status + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: size + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/cycles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/cycles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/cycles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/cycles - Schema is valid", function () { + const schema = {"type":"array","description":"List of subscriptions of the VTEX account, limited to 15 results.","items":{"type":"object","description":"Object with information about the subscription cycle.","properties":{"id":{"type":"string","description":"Cycle ID. When the `cycleCount` value is `1`, the `id` value will be the same as the `subscriptionId` value."},"subscriptionId":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"workflowId":{"type":"string","description":"Code that identifies the subscription in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"status":{"type":"string","description":"Subscription cycle execution status. The possible values are:\r\n- `TRIGGERED`: Execution has been triggered. \r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.","enum":["TRIGGERED","IN_PROCESS","FAILURE","SUCCESS","EXPIRED","ORDER_ERROR","PAYMENT_ERROR","SKIPED","SUCCESS_WITH_NO_ORDER","SUCCESS_WITH_PARTIAL_ORDER","RE_TRIGGERED","SCHEDULE_UPDATED"]},"customerEmail":{"type":"string","description":"Customer email."},"customerId":{"type":"string","description":"Customer ID."},"date":{"type":"string","format":"date-time","description":"Current date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":"string","format":"date-time","description":"Subscription cycle last update date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"isInRetry":{"type":"boolean","description":"Defines if the cycle execution is in retry (`true`), or not (`false`)."},"message":{"type":["string","null"],"description":"Cycle execution message."},"friendlyMessage":{"type":["string","null"],"description":"Cycle execution friendly message."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"orderInfo":{"type":"object","description":"Subscription order information.","properties":{"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"paymentURL":{"type":["string","null"],"description":"Order payment URL."},"value":{"type":"integer","format":"int64","description":"Order value in cents."}}},"context":{"type":"object","description":"Subscription cycle context.","properties":{"items":{"type":["array","null"],"description":"Information about subscription cycle items.","items":{"type":"object","description":"Subscription item information.","properties":{"subscriptionItemId":{"type":["string","null"],"description":"Subscription item ID."},"skuId":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":["integer","null"],"description":"Quantity of item units."},"status":{"type":["string","null"],"description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":["boolean","null"],"description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"cycleCount":{"type":["integer","null"],"description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."}}}},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."},"paymentSystemGroup":{"type":["string","null"],"description":"Payment system group."},"paymentAccountId":{"type":["string","null"],"description":"Information about the customer profile and their documents, such as a credit card number. You can also retrieve that information using the [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles) endpoint."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"addressType":{"type":["string","null"],"description":"Shipping address type."},"catalogAttachment":{"type":["string","null"],"description":"Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content, when applicable."}}},"simulationItems":{"type":["array","null"],"description":"Subscription simulation items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + List cycles filtering by some arguments. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `beginDate` | query | Lower limit for the date of creation of the cycle | + | `endDate` | query | Upper limit for the date of creation of the cycle | + | `subscriptionId` | query | Id from the subscription that generated the cycle | + | `customerEmail` | query | Customer that owns the subscription. Defaults to the current logged user | + | `status` | query | Current cycle status | + | `page` | query | Page used for pagination | + | `size` | query | Page size used for pagination | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730", + "subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d", + "workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a", + "status": "SUCCESS", + "customerEmail": "customer@email.com", + "customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju", + "date": "2024-07-30T09:04:59.7325176Z", + "lastUpdate": "2024-07-31T09:06:05.6879323Z", + "cycleCount": 3, + "isInRetry": false, + "message": null, + "friendlyMessage": null, + "plan": { + "id": "store.subscription.tshirt-collection", + "frequency": { + "periodicity": "WEEKLY", + "interval": 3 + }, + "validity": { + "begin": "2024-04-11T11:04:24.0454821Z", + "end": null + }, + "purchaseDay": "Sunday" + }, + "orderInfo": { + "orderId": "V-8753228-01", + "orderGroup": "V-8753228", + "paymentUrl": null, + "value": 21600 + }, + "context": { + "items": [ + { + "subscriptionItem": "69C872657263439D899265717E733A84", + "skuId": "1154", + "quantity": 1, + "status": "ACTIVE", + "isSkipped": false, + "cycleCount": 1 + } + ], + "paymentSystem": "47", + "paymentSystemName": "Cash", + "paymentSystemGroup": "cash", + "paymentAccountId": null, + "addressId": "Address", + "addressType": "residential", + "catalogAttachment": "vtex.subscription.tshirt-collection" + }, + "simulationItems": [ + { + "id": "1145", + "quantity": 1, + "unitPrice": 21600, + "status": "OK", + "price": null, + "sellingPrice": 21600, + "manualPrice": null + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Retry cycle.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Retry cycle.yml new file mode 100644 index 0000000000..a66c28f3a0 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/Retry cycle.yml @@ -0,0 +1,44 @@ +info: + name: Retry cycle + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/cycles/:cycleId/retry" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cycleId + value: occaecat Lorem officia ut ullamco + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/rns/pub/cycles/:cycleId/retry - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Every subscription order has an execution count called cycle, which determines the position of an order counting from when the shopper subscribed. This endpoint reruns a cycle that is currently in error state. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `cycleId` | path | (Required) ID from the subscription cycle that will be retried. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/folder.yml new file mode 100644 index 0000000000..a52b0463ff --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Cycles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Cycles + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/Get plan details.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/Get plan details.yml new file mode 100644 index 0000000000..37a018431b --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/Get plan details.yml @@ -0,0 +1,95 @@ +info: + name: Get plan details + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/plans/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: catfood.subscription + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/plans/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/plans/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/plans/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/plans/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription [plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","properties":{"id":{"type":"string","description":"Subscription plan ID."},"frequencies":{"type":"array","description":"Array of the plan frequencies.","items":{"type":"object","description":"Information about the plan periodicity and interval.","properties":{"periodicity":{"type":["string","null"],"description":"Repurchase frequency requested by the customer, defines the subscriptions recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}}},"isActive":{"type":"boolean","description":"Defines if the plan is active (`true`) or not (`false`)."},"importInProgress":{"type":"boolean","description":"Defines if a SKU importing process is in progress (`true`) or not (`false`)."},"attachmentId":{"type":"integer","description":"Plan attachment ID."},"isValid":{"type":"boolean","description":"Defines if the plan is valid (`true`) or not (`false`)."},"validationMessages":{"type":["array","null"],"description":"List of validation messages.","items":{"type":"string","description":"Validation message."}},"validity":{"type":["object","null"],"description":"Information about the period during which the subscription plan will be valid.","properties":{"begin":{"type":"string","format":"date-time","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"format":"date-time","description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDays":{"type":"array","description":"Time reference in which subscription orders will be created.","items":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a specific plan by its ID. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) ID from the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "catfood.subscription", + "frequencies": [ + { + "periodicity": "DAILY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 40, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "1", + "2", + "3", + "4", + "5", + "6", + "0" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/List plans.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/List plans.yml new file mode 100644 index 0000000000..ce317ca35a --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/List plans.yml @@ -0,0 +1,125 @@ +info: + name: List plans + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/plans" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: periodicity + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: interval + value: occaecat Lorem officia ut ullamco + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: size + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/plans - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/plans - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/plans - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/plans - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Subscription [plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","properties":{"id":{"type":"string","description":"Subscription plan ID."},"frequencies":{"type":"array","description":"Array of the plan frequencies.","items":{"type":"object","description":"Information about the plan periodicity and interval.","properties":{"periodicity":{"type":["string","null"],"description":"Repurchase frequency requested by the customer, defines the subscriptions recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}}},"isActive":{"type":"boolean","description":"Defines if the plan is active (`true`) or not (`false`)."},"importInProgress":{"type":"boolean","description":"Defines if a SKU importing process is in progress (`true`) or not (`false`)."},"attachmentId":{"type":"integer","description":"Plan attachment ID."},"isValid":{"type":"boolean","description":"Defines if the plan is valid (`true`) or not (`false`)."},"validationMessages":{"type":["array","null"],"description":"List of validation messages.","items":{"type":"string","description":"Validation message."}},"validity":{"type":["object","null"],"description":"Information about the period during which the subscription plan will be valid.","properties":{"begin":{"type":"string","format":"date-time","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"format":"date-time","description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDays":{"type":"array","description":"Time reference in which subscription orders will be created.","items":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + List plans filtering by some arguments. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `periodicity` | query | Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available periodicity. | + | `interval` | query | Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available interval. | + | `page` | query | Page used for pagination. | + | `size` | query | Desired number of [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "catfood.subscription", + "frequencies": [ + { + "periodicity": "DAILY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 40, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "7" + ] + }, + { + "id": "subscription.tshirt", + "frequencies": [ + { + "periodicity": "MONTHLY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 39, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "3" + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/folder.yml new file mode 100644 index 0000000000..be9eac39d1 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Plans/folder.yml @@ -0,0 +1,4 @@ +info: + name: Plans + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Generate report.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Generate report.yml new file mode 100644 index 0000000000..d82382ef61 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Generate report.yml @@ -0,0 +1,131 @@ +info: + name: Generate report + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pvt/reports/:reportName/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: receiver@email.com + type: query + disabled: true + - name: status + value: SUCCESS + type: query + disabled: true + - name: beginDate + value: 2024-07-01 + type: query + disabled: true + - name: endDate + value: 2024-08-01 + type: query + disabled: true + - name: reportName + value: subscriptionsWithStatus + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription report information.","properties":{"id":{"type":"string","description":"Report document ID."},"finished":{"type":"boolean","description":"Defines if the report is finished (`true`) or not (`false`)."},"recordsProcessed":{"type":"integer","description":"Number of records processed at the moment."},"recordsSum":{"type":["integer","null"],"description":"Total number of records to be processed."},"startDate":{"type":["string","null"],"description":"Report starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdateTime":{"type":["string","null"],"description":"Report last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"completedDate":{"type":["string","null"],"description":"Report completion date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"errorCount":{"type":["integer","null"],"description":"Error counting numbers, when applicable."},"percentageProcessed":{"type":"number","description":"Report processing percentage."},"enqueueDate":{"type":["string","null"],"description":"Request enqueue date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"email":{"type":"string","description":"Email of the user that receives the report."},"canceled":{"type":"boolean","description":"Defines if the report is canceled (`true`) or not (`false`)."},"outputType":{"type":["string","null"],"description":"Report file extension."},"zipped":{"type":"boolean","description":"Defines if the report file is zipped (`true`) or not (`false`)."},"linkToDownload":{"type":["string","null"],"description":"Link do download the report."},"lastErrorMessage":{"type":["string","null"],"description":"Error last message, when applicable."},"statusMessage":{"type":"string","description":"Report status message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Create a report in the format of a `csv` file and send it via email to a given user. + + >ℹ️ In the response body of the current endpoint, you get the document ID required for the [Get report document details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports/-reportName-/documents/-documentId-) endpoint. + + You can generate the following types of report: + + - `subscriptionsWithStatus`: Get subscriptions based on subscription cycle execution status. + - **Query param required:** `status`. + + - `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates. + - **Query params required:** `beginDate` and `endDate`. + + - `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates. + - **Query params required:** `beginDate` and `endDate`. + + - `subscriptionsCreatedBetweenDate`: Get subscriptions created between dates. + - **Query params required:** `beginDate` and `endDate`. + + - `executionsBetweenDate`: Get executions between dates. + - **Query params required:** `beginDate` and `endDate`. + + >ℹ️ You can also use the [List report templates](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports) endpoint to discover the types of reports you can generate. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reportName` | path | (Required) Name of the type of report you wish to generate. The following values are accepted: - `subscriptionsWithStatus` - `subscriptionsScheduledBetweenDate` - `subscriptionsUpdatedBetweenDate` - `subscriptionsCreatedBetweenDate` - `executionsBetweenDate` | + | `email` | query | The report will be sent to the email in this field. When no email is provided, the report is sent to the email of the user making the request. | + | `status` | query | Subscription cycle execution status. This field is required only for the `subscriptionsWithStatus` report type, and the possible values are: - `TRIGGERED`: Execution has been triggered. - `IN_PROCESS`: Execution is being processed by the system. - `FAILURE`: An internal error occurred during the subscription execution. - `SUCCESS`: Successful cycle processing. - `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended. - `ORDER_ERROR`: Cycle was not executed due to an error in order placement. - `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment. - `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle. - `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items. - `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order. - `RE_TRIGGERED`: Execution retry was triggered manually. - `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated. | + | `beginDate` | query | Beginning date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type. | + | `endDate` | query | Ending date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "7849df9f-00d4-11ef-8452-1254acca1d85", + "finished": false, + "recordsProcessed": 0, + "recordsSum": null, + "startDate": null, + "lastUpdateTime": null, + "completedDate": null, + "errorCount": null, + "percentageProcessed": 0, + "enqueueDate": "2024-04-22T18:16:50.7487312Z", + "email": "receiver@email.com", + "canceled": false, + "outputType": "CSV", + "zipped": false, + "linkToDownload": null, + "lastErrorMessage": null, + "statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 is being processed (0.00% completed). The file will be sent to receiver@email.com." + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Get report document details.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Get report document details.yml new file mode 100644 index 0000000000..402b3c73bd --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/Get report document details.yml @@ -0,0 +1,96 @@ +info: + name: Get report document details + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/reports/:reportName/documents/:documentId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reportName + value: subscriptionsWithStatus + type: path + - name: documentId + value: 2804f3ab-5a51-11ef-b37f-f89ffae09a60 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription report information.","properties":{"id":{"type":"string","description":"Report document ID."},"finished":{"type":"boolean","description":"Defines if the report is finished (`true`) or not (`false`)."},"recordsProcessed":{"type":"integer","description":"Number of records processed at the moment."},"recordsSum":{"type":["integer","null"],"description":"Total number of records to be processed."},"startDate":{"type":["string","null"],"description":"Report starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdateTime":{"type":["string","null"],"description":"Report last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"completedDate":{"type":["string","null"],"description":"Report completion date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"errorCount":{"type":["integer","null"],"description":"Error counting numbers, when applicable."},"percentageProcessed":{"type":"number","description":"Report processing percentage."},"enqueueDate":{"type":["string","null"],"description":"Request enqueue date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"email":{"type":"string","description":"Email of the user that receives the report."},"canceled":{"type":"boolean","description":"Defines if the report is canceled (`true`) or not (`false`)."},"outputType":{"type":["string","null"],"description":"Report file extension."},"zipped":{"type":"boolean","description":"Defines if the report file is zipped (`true`) or not (`false`)."},"linkToDownload":{"type":["string","null"],"description":"Link do download the report."},"lastErrorMessage":{"type":["string","null"],"description":"Error last message, when applicable."},"statusMessage":{"type":"string","description":"Report status message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve information about a report document, searching by document ID. In the status code `200 OK` response, you get a link to download the report. + + >❗ Before using this endpoint, you must create a report with the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint and get the document ID. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reportName` | path | (Required) Name of the report type, which must be previously created for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint. The possible values are: - `subscriptionsWithStatus` - `subscriptionsScheduledBetweenDate` - `subscriptionsUpdatedBetweenDate` - `subscriptionsCreatedBetweenDate` - `executionsBetweenDate` | + | `documentId` | path | (Required) Report document ID. You get this value after you create a report template for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "7849df9f-00d4-11ef-8452-1254acca1d85", + "finished": true, + "recordsProcessed": 63, + "recordsSum": 63, + "startDate": "2024-03-22T18:16:50.7487312Z", + "lastUpdateTime": "2024-04-22T18:16:50.7487312Z", + "completedDate": "2024-04-22T18:16:50.7487312Z", + "errorCount": null, + "percentageProcessed": 100, + "enqueueDate": "2024-04-22T18:16:50.7487312Z", + "email": "receiver@email.com", + "canceled": false, + "outputType": "CSV", + "zipped": false, + "linkToDownload": "https://s3.amazonaws.com/OMSReport/v3/_finished/accountname/7849df9f-00d4-11ef-8452-1254acca1d85//files/47363271-b655-11ed-83ab-12dbed7de2a7.csv?AWSAccessKeyId=ASIAQYXXCHIYPSJDRNHB&Expires=1724945014&x-amz-security-token=IQoJb3JpZ2luX2VjEMj%2Feq6V1w8z3NGlnfhvSp70Q80qvQUIwP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgwwNTMxMzE0OTE4ODgiDCM0JATV%2FwXQvXyovCqRBW%2F14aC5J3plQR%2BzKbpddyDnoAstfgJo1MfR0yel3uRzixrSRFE033V4%2B8cN7ez5Lr0ymGifnB14ONZ35RtM4PgQvuV0fs8If6cw8%3D%3D&Signature=7yZbA%2BGaYdPUkdxFXqy9W8GGHuo%3D", + "lastErrorMessage": null, + "statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 was completed at 15:23 and sent to receiver@email.com." + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/List report templates.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/List report templates.yml new file mode 100644 index 0000000000..2c6a8919cf --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/List report templates.yml @@ -0,0 +1,159 @@ +info: + name: List report templates + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/reports" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/reports - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/reports - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/reports - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/reports - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Report template details.","properties":{"account":{"type":"string","description":"VTEX store account name."},"name":{"type":"string","description":"Template type, more information in the `description` field.","enum":["subscriptionsWithStatus","subscriptionsScheduledBetweenDate","subscriptionsUpdatedBetweenDate","subscriptionsCreatedBetweenDate","executionsBetweenDate"]},"description":{"type":"string","description":"Template description, which varies according to the template type:\r\n- `subscriptionsWithStatus`: Get subscriptions based on status.\r\n- `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates.\r\n- `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates.\r\n- `subscriptionsCreatedBetweenDates`: Get subscriptions created between date.\r\n- `executionsBetweenDate`: Get executions between dates."},"reason":{"type":["string","null"],"description":"Reason why the template was created."},"behalfOf":{"type":["string","null"],"description":"On behalf of which user the template was created."},"params":{"type":"array","description":"Information about the template params.","items":{"type":"object","description":"Param details.","properties":{"type":{"type":"string","description":"Template param type, which can be `string` for the `subscriptionsWithStatus` template type, or `date` for the other cases.","enum":["string","date"]},"format":{"type":"string","description":"Template param format, such as `yyyy-MM-dd` for `beginDate` or `endDate`. Not applicable to the `subscriptionsWithStatus` type."},"name":{"type":"string","description":"Template param name, which can relate to the template status (`status`) or dates (`beginDate`, `endDate`).","enum":["status","beginDate","endDate"]}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + List all report templates available. + + >ℹ️ After choosing the desired template, use the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint to create the report for your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "account": "fashionstore", + "name": "subscriptionsWithStatus", + "description": "Get subscriptions based on status", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "string", + "name": "status" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsScheduledBetweenDate", + "description": "Get active subscriptions scheduled between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsUpdatedBetweenDate", + "description": "Get subscriptions updated between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsCreatedBetweenDate", + "description": "Get subscriptions created between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "executionsBetweenDate", + "description": "Get executions between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/folder.yml new file mode 100644 index 0000000000..0440dedf44 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Reports/folder.yml @@ -0,0 +1,4 @@ +info: + name: Reports + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Edit subscriptions settings.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Edit subscriptions settings.yml new file mode 100644 index 0000000000..fa934ce12e --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Edit subscriptions settings.yml @@ -0,0 +1,111 @@ +info: + name: Edit subscriptions settings + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/rns/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "delivery" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true, + "attachmentPreferences": { + "enableAttachments": false, + "splitSameSkuWithDifferentAttachments": false + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/settings - Schema is valid", function () { + const schema = {"description":"VTEX account subscriptions settings.","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"description":"Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.","type":"string","enum":["NONE","CHEAPEST","CUSTOMER_CHOICE","STORE_CHOICE"]},"defaultSla":{"description":"This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.","type":["string","null"]},"isUsingV3":{"description":"Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).","type":"boolean"},"onMigrationProcess":{"description":"Indicates if the store is in the process of migrating to Subscriptions V3 (`true`) or not (`false`).","type":"boolean"},"executionHourInUtc":{"description":"Indicates the time future subscription orders will be generated.","type":"integer"},"workflowVersion":{"description":"Workflow version.","type":"string"},"deliveryChannels":{"description":"Array containing delivery channels.","type":"array","items":{"description":"Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.","type":"string","enum":["delivery","pickupInPoint"]}},"randomIdGeneration":{"description":"Defines if subscription order IDs are randomly generated (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnCreation":{"description":"Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnUpdate":{"description":"Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).","type":"boolean"},"attachmentPreferences":{"type":"object","description":"Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","properties":{"enableAttachments":{"type":"boolean","description":"Defines if the store keeps attachments from original orders and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`."},"splitSameSkuWithDifferentAttachments":{"type":"boolean","description":"Defines if the same SKUs that contain different attachments in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`."}}},"orderCustomDataAppId":{"description":"When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.","type":["string","null"]},"postponeExpiration":{"description":"Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).","type":"boolean"},"manualPriceAllowed":{"description":"Defines if the [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration is enabled for subscriptions items (`true`), or not (`false`). This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.","type":"boolean"},"useItemPriceFromOriginalOrder":{"description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits the subscriptions settings of your store. This configurations apply to all subscriptions. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Get subscriptions settings.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Get subscriptions settings.yml new file mode 100644 index 0000000000..5bf06a80ce --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/Get subscriptions settings.yml @@ -0,0 +1,89 @@ +info: + name: Get subscriptions settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/settings - Schema is valid", function () { + const schema = {"description":"VTEX account subscriptions settings.","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"description":"Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.","type":"string","enum":["NONE","CHEAPEST","CUSTOMER_CHOICE","STORE_CHOICE"]},"defaultSla":{"description":"This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.","type":["string","null"]},"isUsingV3":{"description":"Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).","type":"boolean"},"onMigrationProcess":{"description":"Indicates if the store is in the process of migrating to Subscriptions V3 (`true`) or not (`false`).","type":"boolean"},"executionHourInUtc":{"description":"Indicates the time future subscription orders will be generated.","type":"integer"},"workflowVersion":{"description":"Workflow version.","type":"string"},"deliveryChannels":{"description":"Array containing delivery channels.","type":"array","items":{"description":"Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.","type":"string","enum":["delivery","pickupInPoint"]}},"randomIdGeneration":{"description":"Defines if subscription order IDs are randomly generated (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnCreation":{"description":"Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnUpdate":{"description":"Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).","type":"boolean"},"attachmentPreferences":{"type":"object","description":"Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","properties":{"enableAttachments":{"type":"boolean","description":"Defines if the store keeps attachments from original orders and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`."},"splitSameSkuWithDifferentAttachments":{"type":"boolean","description":"Defines if the same SKUs that contain different attachments in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`."}}},"orderCustomDataAppId":{"description":"When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.","type":["string","null"]},"postponeExpiration":{"description":"Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).","type":"boolean"},"manualPriceAllowed":{"description":"Defines if the [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration is enabled for subscriptions items (`true`), or not (`false`). This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.","type":"boolean"},"useItemPriceFromOriginalOrder":{"description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the subscriptions settings of your store. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "attachmentPreferences": { + "enableAttachments": false, + "splitSameSkuWithDifferentAttachments": false + }, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/folder.yml new file mode 100644 index 0000000000..f425567a7c --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Settings/folder.yml @@ -0,0 +1,4 @@ +info: + name: Settings + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Add item to subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Add item to subscription.yml new file mode 100644 index 0000000000..e2eab69259 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Add item to subscription.yml @@ -0,0 +1,144 @@ +info: + name: Add item to subscription + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + body: + type: json + data: |- + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400.3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a new item to a given subscription. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "vtex.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for a subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for a subscription.yml new file mode 100644 index 0000000000..9221626bbb --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for a subscription.yml @@ -0,0 +1,192 @@ +info: + name: Calculate the current prices for a subscription + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/simulate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription order simulation response.","properties":{"simulation":{"type":"object","description":"Object with subscription order simulation details.","properties":{"items":{"type":"array","description":"Simulation items information.","items":{"type":"object","description":"Simulation information about a given item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"seller":{"type":["string","null"],"description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"quantity":{"type":"integer","description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Item name."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}}}}},"logisticsInfo":{"type":"array","description":"Simulation logistics information.","items":{"type":"object","description":"Logistics details.","properties":{"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts at `0`, followed by `1`, `2`, and so on."},"quantity":{"type":"integer","description":"Quantity of units."},"selectedSla":{"type":["string","null"],"description":"Selected Service Level Agreement (SLA)."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Shipping type (shipping method) selected by the customer, like delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA in days. One business day corresponds to `1bd`, for example."},"shippingEstimate":{"type":["string","null"],"description":"Shipping estimate time in days. Three business days correspond to `3bd`, for example."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"pickupId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when shipping type is pickup."},"price":{"type":["integer","null"],"description":"Shipping cost."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) period."},"slas":{"type":"array","description":"Service Level Agreement (SLA) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) considered for the simulation.","items":{"type":"object","description":"Subscription order SLA details.","properties":{"id":{"type":["string","null"],"description":"ID of the shipping type (shipping method) of the shipping policy."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"deliveryChannel":{"type":["string","null"],"description":"Defines if the delivery channel is `delivery` or `pickup-in-point`.","enum":["delivery","pickup-in-point"]},"price":{"type":"integer","description":"Item shipping price in cents. This value does not account for the order total shipping price."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping estimate time in days. For instance, three business days is represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. One business day is represented as `1bd`, for example."},"deliveryWindows":{"type":["array","null"],"description":"[Delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about a given delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}},"availableDeliveryWindows":{"type":["array","null"],"description":"Available [delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about an available delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Available delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Available delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}}}}}}}},"paymentData":{"type":["object","null"],"description":"Simulation payment information.","properties":{"payments":{"type":["array","null"],"description":"Payment information.","items":{"type":["object","null"],"description":"Payment details.","properties":{"id":{"type":["string","null"],"description":"Payment ID unique identifier in VTEX."},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"group":{"type":["string","null"],"description":"Payment system group."},"bin":{"type":["string","null"],"description":"Abbreviation for _Bank Identification Number_, which is a code that identifies the institution responsible for issuing the credit card."},"accountId":{"type":["string","null"],"description":"Store account ID."},"parentAccountId":{"type":["string","null"],"description":"Retrieves the main account ID if the payment was made in a subaccount."},"referenceValue":{"type":["integer","null"],"format":"int64","description":"Payment reference value in cents."},"value":{"type":["integer","null"],"format":"int64","description":"Payment value in cents."},"installments":{"type":["integer","null"],"description":"Number of installments."},"url":{"type":["string","null"],"description":"Payment URL."},"cardNumber":{"type":["string","null"],"description":"Card number information."},"fields":{"type":["array","null"],"description":"Payment parameters names and values.","items":{"type":"object","description":"Information about a given payment parameter.","properties":{"name":{"type":["string","null"],"description":"Payment parameter name."},"value":{"type":["string","null"],"description":"Payment parameter value."}}}},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."}}}},"transactions":{"type":["array","null"],"description":"Financial transactions information. This array returns empty in the simulation.","items":{"type":["object","null"],"description":"Financial transactions details.","properties":{"isActive":{"type":["boolean","null"],"description":"Defines if the subscription order payment is active (`true`) or inactive (`false`)."}}}}}},"country":{"type":["string","null"],"description":"Subscription order simulation three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"postalCode":{"type":["string","null"],"description":"Subscription order simulation postal code."},"messages":{"type":["array","null"],"description":"Simulation messages information.","items":{"type":["object","null"],"description":"Simulation message details.","properties":{"code":{"type":["string","null"],"description":"Message code."},"status":{"type":["string","null"],"description":"Message status."},"text":{"type":["string","null"],"description":"Message text."}}}},"selectableGifts":{"type":["array","null"],"description":"Information about subscription selectable gifts. For example, when the customer gains a gift from the store based on a promotion.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":["string","null"],"description":"Selectable gift ID."},"availableQuantity":{"type":["integer","null"],"description":"Available quantity of selectable gifts."},"availableGifts":{"type":["array","null"],"description":"Details about available gifts.","items":{"type":["object","null"],"description":"Information about a given available gift.","properties":{"id":{"type":["string","null"],"description":"Gift ID."},"seller":{"type":["string","null"],"description":"Seller name."},"quantity":{"type":["integer","null"],"description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"unitMultiplier":{"type":["number","null"],"description":"Unit multiplier."},"attachments":{"type":["array","null"],"description":"Available gift attachments information, when applicable.","items":{"type":["object","null"],"description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Gift attachment name."},"content":{"type":["object","null"],"description":"Custom field for the gift attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Gift name."},"isGift":{"type":["boolean","null"],"description":"Defines it the item is from a gift list (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}},"isSelected":{"type":["boolean","null"],"description":"Defines if the item can be selected (`true`), or not (`false`)."}}}}}}},"totals":{"type":"array","description":"Information about simulation total counts.","items":{"type":"object","description":"Details about a given total count.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total count name."},"valueAsInt":{"type":"integer","format":"int64","description":"Total count value in cents."}}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}},"shippingEstimate":{"type":"object","description":"Subscription order shipping estimate information.","properties":{"name":{"type":"string","description":"ID of the shipping type (shipping method) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"estimate":{"type":"string","description":"Total shipping estimate time in days. Three business days is represented as `3bd`, for example."},"estimateDeliveryDate":{"type":"string","description":"Estimate delivery date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"matched":{"type":"boolean","description":"Defines if the shipping estimate is matched (`true`), or not (`false`)."}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}},"totals":{"type":"array","description":"Information about total counts.","items":{"type":"object","description":"Total cost per shipping or items.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"value":{"type":"number","description":"Total count value."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Simulates an order made by the specific subscription on checkout and retrieves the current price for items and shipping. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "simulation": { + "items": [ + { + "id": "9", + "seller": "1", + "quantity": 1, + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null, + "unitMultiplier": 1, + "measurementUnit": "un", + "attachments": null, + "name": null, + "isGift": false, + "priceTags": [] + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "quantity": 1, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "lockTTL": "1bd", + "shippingEstimate": null, + "addressId": "5028945524109", + "pickupId": null, + "price": 0, + "deliveryWindow": null, + "slas": [ + { + "id": "Normal", + "pickupPointId": null, + "deliveryChannel": "delivery", + "price": 500, + "shippingEstimate": "3bd", + "lockTTL": "1bd", + "deliveryWindows": [], + "availableDeliveryWindows": [] + } + ] + } + ], + "paymentData": { + "payments": [ + { + "id": null, + "paymentSystem": "6", + "group": null, + "bin": null, + "accountId": null, + "parentAccountId": null, + "referenceValue": 13460, + "value": 13460, + "installments": 1, + "url": null, + "cardNumber": null, + "fields": null, + "paymentSystemName": null + } + ], + "transactions": [] + }, + "country": null, + "postalCode": null, + "messages": [], + "selectableGifts": [], + "totals": [ + { + "id": "Items", + "name": "Items total", + "value": 12960 + }, + { + "id": "Shipping", + "name": "Shipping total", + "value": 500 + } + ], + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": null, + "sellingPrice": 12960, + "manualPrice": null + } + ] + }, + "shippingEstimate": { + "name": "Normal", + "estimate": "3bd", + "estimatedDeliveryDate": "2024-08-26T00:00:00Z", + "nextPurchaseDate": "2024-09-26T00:00:00Z", + "matched": true + }, + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null + } + ], + "totals": [ + { + "id": "Items", + "value": 12960 + }, + { + "id": "Shipping", + "value": 500 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for the provided subscription template.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for the provided subscription template.yml new file mode 100644 index 0000000000..ef9be74340 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Calculate the current prices for the provided subscription template.yml @@ -0,0 +1,238 @@ +info: + name: Calculate the current prices for the provided subscription template + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/simulate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "items": [ + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400 + }, + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400 + } + ], + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "340357032569595", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "title": "fashionBasic", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "catalogAttachment": "vtex.subscription.tshirt-collection" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription order simulation response.","properties":{"simulation":{"type":"object","description":"Object with subscription order simulation details.","properties":{"items":{"type":"array","description":"Simulation items information.","items":{"type":"object","description":"Simulation information about a given item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"seller":{"type":["string","null"],"description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"quantity":{"type":"integer","description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Item name."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}}}}},"logisticsInfo":{"type":"array","description":"Simulation logistics information.","items":{"type":"object","description":"Logistics details.","properties":{"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts at `0`, followed by `1`, `2`, and so on."},"quantity":{"type":"integer","description":"Quantity of units."},"selectedSla":{"type":["string","null"],"description":"Selected Service Level Agreement (SLA)."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Shipping type (shipping method) selected by the customer, like delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA in days. One business day corresponds to `1bd`, for example."},"shippingEstimate":{"type":["string","null"],"description":"Shipping estimate time in days. Three business days correspond to `3bd`, for example."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"pickupId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when shipping type is pickup."},"price":{"type":["integer","null"],"description":"Shipping cost."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) period."},"slas":{"type":"array","description":"Service Level Agreement (SLA) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) considered for the simulation.","items":{"type":"object","description":"Subscription order SLA details.","properties":{"id":{"type":["string","null"],"description":"ID of the shipping type (shipping method) of the shipping policy."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"deliveryChannel":{"type":["string","null"],"description":"Defines if the delivery channel is `delivery` or `pickup-in-point`.","enum":["delivery","pickup-in-point"]},"price":{"type":"integer","description":"Item shipping price in cents. This value does not account for the order total shipping price."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping estimate time in days. For instance, three business days is represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. One business day is represented as `1bd`, for example."},"deliveryWindows":{"type":["array","null"],"description":"[Delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about a given delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}},"availableDeliveryWindows":{"type":["array","null"],"description":"Available [delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about an available delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Available delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Available delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}}}}}}}},"paymentData":{"type":["object","null"],"description":"Simulation payment information.","properties":{"payments":{"type":["array","null"],"description":"Payment information.","items":{"type":["object","null"],"description":"Payment details.","properties":{"id":{"type":["string","null"],"description":"Payment ID unique identifier in VTEX."},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"group":{"type":["string","null"],"description":"Payment system group."},"bin":{"type":["string","null"],"description":"Abbreviation for _Bank Identification Number_, which is a code that identifies the institution responsible for issuing the credit card."},"accountId":{"type":["string","null"],"description":"Store account ID."},"parentAccountId":{"type":["string","null"],"description":"Retrieves the main account ID if the payment was made in a subaccount."},"referenceValue":{"type":["integer","null"],"format":"int64","description":"Payment reference value in cents."},"value":{"type":["integer","null"],"format":"int64","description":"Payment value in cents."},"installments":{"type":["integer","null"],"description":"Number of installments."},"url":{"type":["string","null"],"description":"Payment URL."},"cardNumber":{"type":["string","null"],"description":"Card number information."},"fields":{"type":["array","null"],"description":"Payment parameters names and values.","items":{"type":"object","description":"Information about a given payment parameter.","properties":{"name":{"type":["string","null"],"description":"Payment parameter name."},"value":{"type":["string","null"],"description":"Payment parameter value."}}}},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."}}}},"transactions":{"type":["array","null"],"description":"Financial transactions information. This array returns empty in the simulation.","items":{"type":["object","null"],"description":"Financial transactions details.","properties":{"isActive":{"type":["boolean","null"],"description":"Defines if the subscription order payment is active (`true`) or inactive (`false`)."}}}}}},"country":{"type":["string","null"],"description":"Subscription order simulation three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"postalCode":{"type":["string","null"],"description":"Subscription order simulation postal code."},"messages":{"type":["array","null"],"description":"Simulation messages information.","items":{"type":["object","null"],"description":"Simulation message details.","properties":{"code":{"type":["string","null"],"description":"Message code."},"status":{"type":["string","null"],"description":"Message status."},"text":{"type":["string","null"],"description":"Message text."}}}},"selectableGifts":{"type":["array","null"],"description":"Information about subscription selectable gifts. For example, when the customer gains a gift from the store based on a promotion.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":["string","null"],"description":"Selectable gift ID."},"availableQuantity":{"type":["integer","null"],"description":"Available quantity of selectable gifts."},"availableGifts":{"type":["array","null"],"description":"Details about available gifts.","items":{"type":["object","null"],"description":"Information about a given available gift.","properties":{"id":{"type":["string","null"],"description":"Gift ID."},"seller":{"type":["string","null"],"description":"Seller name."},"quantity":{"type":["integer","null"],"description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"unitMultiplier":{"type":["number","null"],"description":"Unit multiplier."},"attachments":{"type":["array","null"],"description":"Available gift attachments information, when applicable.","items":{"type":["object","null"],"description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Gift attachment name."},"content":{"type":["object","null"],"description":"Custom field for the gift attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Gift name."},"isGift":{"type":["boolean","null"],"description":"Defines it the item is from a gift list (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}},"isSelected":{"type":["boolean","null"],"description":"Defines if the item can be selected (`true`), or not (`false`)."}}}}}}},"totals":{"type":"array","description":"Information about simulation total counts.","items":{"type":"object","description":"Details about a given total count.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total count name."},"valueAsInt":{"type":"integer","format":"int64","description":"Total count value in cents."}}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}},"shippingEstimate":{"type":"object","description":"Subscription order shipping estimate information.","properties":{"name":{"type":"string","description":"ID of the shipping type (shipping method) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"estimate":{"type":"string","description":"Total shipping estimate time in days. Three business days is represented as `3bd`, for example."},"estimateDeliveryDate":{"type":"string","description":"Estimate delivery date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"matched":{"type":"boolean","description":"Defines if the shipping estimate is matched (`true`), or not (`false`)."}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}},"totals":{"type":"array","description":"Information about total counts.","items":{"type":"object","description":"Total cost per shipping or items.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"value":{"type":"number","description":"Total count value."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Simulates an order made by subscriptions on checkout and retrieves the current price for items and shipping. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "simulation": { + "items": [ + { + "id": "9", + "seller": "1", + "quantity": 1, + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null, + "unitMultiplier": 1, + "measurementUnit": "un", + "attachments": null, + "name": null, + "isGift": false, + "priceTags": [] + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "quantity": 1, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "lockTTL": "1bd", + "shippingEstimate": null, + "addressId": "5028945524109", + "pickupId": null, + "price": 0, + "deliveryWindow": null, + "slas": [ + { + "id": "Normal", + "pickupPointId": null, + "deliveryChannel": "delivery", + "price": 500, + "shippingEstimate": "3bd", + "lockTTL": "1bd", + "deliveryWindows": [], + "availableDeliveryWindows": [] + } + ] + } + ], + "paymentData": { + "payments": [ + { + "id": null, + "paymentSystem": "6", + "group": null, + "bin": null, + "accountId": null, + "parentAccountId": null, + "referenceValue": 13460, + "value": 13460, + "installments": 1, + "url": null, + "cardNumber": null, + "fields": null, + "paymentSystemName": null + } + ], + "transactions": [] + }, + "country": null, + "postalCode": null, + "messages": [], + "selectableGifts": [], + "totals": [ + { + "id": "Items", + "name": "Items total", + "value": 12960 + }, + { + "id": "Shipping", + "name": "Shipping total", + "value": 500 + } + ], + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": null, + "sellingPrice": 12960, + "manualPrice": null + } + ] + }, + "shippingEstimate": { + "name": "Normal", + "estimate": "3bd", + "estimatedDeliveryDate": "2024-08-26T00:00:00Z", + "nextPurchaseDate": "2024-09-26T00:00:00Z", + "matched": true + }, + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null + } + ], + "totals": [ + { + "id": "Items", + "value": 12960 + }, + { + "id": "Shipping", + "value": 500 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Create subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Create subscription.yml new file mode 100644 index 0000000000..46252b10db --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Create subscription.yml @@ -0,0 +1,173 @@ +info: + name: Create subscription + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "items": [ + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400 + }, + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400 + } + ], + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "340357032569595", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "title": "fashionBasic", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "catalogAttachment": "vtex.subscription.tshirt-collection" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new subscription. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "8B91E3077495AB982117AD0BA4A5829D", + "customerId": "c00a9529-806b-4ef3-a5f7-ed7846a66d3d", + "customerEmail": "customer@email.com", + "title": null, + "status": "PAUSED", + "isSkipped": false, + "nextPurchaseDate": "2024-09-21T15:53:27.0665798Z", + "lastPurchaseDate": "2024-08-21T15:53:27.0665798Z", + "plan": { + "id": "store.subscription.basic", + "frequency": { + "periodicity": "DAILY", + "interval": 1 + }, + "validity": { + "begin": "2024-09-21T15:53:27.0665798Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "6", + "installments": 1, + "paymentSystemName": "Bank Slips", + "paymentSystemGroup": "bankInvoice" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 0, + "createdAt": "2024-08-21T15:53:27.0665798Z", + "lastUpdate": "0001-01-01T00:00:00", + "items": [ + { + "id": "0F821B992DD848028E3A82C40DBCD834", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "cycleCount": 0, + "manualPrice": 736, + "attachments": null + } + ], + "lastCycleId": null, + "customData": {} + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Edit item from subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Edit item from subscription.yml new file mode 100644 index 0000000000..4b6717360d --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Edit item from subscription.yml @@ -0,0 +1,149 @@ +info: + name: Edit item from subscription + type: http + seq: 6 + +http: + method: PATCH + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + - name: itemId + value: 0A6C01CA4582458A9CF8F61A9F6E1A68 + type: path + body: + type: json + data: |- + { + "status": "ACTIVE", + "isSkipped": false, + "quantity": 5, + "manualPrice": 400.3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits an item from a given subscription. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `itemId` | path | (Required) ID of the subscription item being edited. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get conversation messages.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get conversation messages.yml new file mode 100644 index 0000000000..033f68c2c3 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get conversation messages.yml @@ -0,0 +1,102 @@ +info: + name: Get conversation messages + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions/:subscriptionId/conversation-message" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subscriptionId + value: 123456789abc + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Each message exchanged with the customer related to the subscription.","properties":{"id":{"type":"string","description":"Message ID."},"from":{"type":"object","description":"Information regarding the message sender.","properties":{"conversationRelatedTo":{"type":"string","description":"ID of the subscription related to the message."},"conversationSubject":{"type":"string","description":"Subject of the conversation."},"emailAlias":{"type":"string","description":"Email alias."},"aliasMaskType":{"type":"string","description":"Alias [mask type](https://help.vtex.com/en/tutorial/how-communication-with-the-client-is-made-during-the-order-flow--tutorials_195)."},"email":{"type":"string","description":"Sender email address."},"name":{"type":"string","description":"Sender name."},"role":{"type":["string","null"],"description":"Sender [role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc)."}}},"to":{"type":"array","description":"Information regarding the message receiver.","items":{"type":"object","description":"Message receiver details.","properties":{"conversationRelatedTo":{"type":"string","description":"ID of the subscription related to the message."},"conversationSubject":{"type":"string","description":"Subject of the conversation."},"emailAlias":{"type":"string","description":"Email alias."},"aliasMaskType":{"type":"string","description":"Alias [mask type](https://help.vtex.com/en/tutorial/how-communication-with-the-client-is-made-during-the-order-flow--tutorials_195)."},"email":{"type":"string","description":"Customer email address."},"name":{"type":"string","description":"Customer name."},"role":{"type":"string","description":"Role identification."}}}},"subject":{"type":"string","description":"Message subject."},"firstWords":{"type":"string","description":"First words of the message text."},"body":{"type":"string","description":"HTML content of the message's body."},"hasAttachment":{"type":"boolean","description":"Indicates if the message has [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) (`true`) or not (`false`)."},"attachmentNames":{"type":["array","null"],"description":"Attachment names.","items":{"type":["string","null"],"description":"Attachment name."}},"date":{"type":"string","description":"Message date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieve all conversation messages sent to a customer regarding a subscription. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2024-07-25t22-01-08_80e67e10318d4a73a66dbfdb3d471cfb", + "from": { + "conversationRelatedTo": "875a3b36d02e17058ed46e5b0c50353c", + "conversationSubject": "rns", + "emailAlias": "a506b3df1b584381b2838447a44d0579@ct.vtex.com.br", + "aliasMaskType": "0", + "email": "noreply@vtexcommerce.com.br", + "name": "no reply", + "role": null + }, + "to": [ + { + "conversationRelatedTo": "875a3b36d02e17058ed46e5b0c50353c", + "conversationSubject": "rns", + "emailAlias": "dda23454991e4cfea71ca7beb4ec0aad@ct.vtex.com.br", + "aliasMaskType": "0", + "email": "sophia.smith@email.com", + "name": "Sophia Smith", + "role": "Customer" + } + ], + "subject": "Your subscription was confirmed", + "firstWords": "Hello, your subscription was successfully created! We will email you a confirmation after each order payment is approved.", + "body": " test
Próxima compra
25/12/2021
Entrega estimada
13/01/2022
************2503
!important; \" align=\"left\">

Atenciosamente,
Equipe CeA.

", + "hasAttachment": false, + "attachmentNames": [], + "date": "2024-07-25T22:01:25Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get subscription details by ID.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get subscription details by ID.yml new file mode 100644 index 0000000000..c8fa891492 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Get subscription details by ID.yml @@ -0,0 +1,136 @@ +info: + name: Get subscription details by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: F35A8B497EA9E5A6D8F3778CBBA4C9E3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a subscription, searching by subscription ID. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/List subscriptions.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/List subscriptions.yml new file mode 100644 index 0000000000..81dab68bf7 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/List subscriptions.yml @@ -0,0 +1,181 @@ +info: + name: List subscriptions + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: customerEmail + value: customer@email.com + type: query + disabled: true + - name: status + value: ACTIVE + type: query + disabled: true + - name: addressId + value: "5028945524109" + type: query + disabled: true + - name: paymentId + value: 807E03E56A844BE2B1727B752E19C828 + type: query + disabled: true + - name: planId + value: store.subscription.basic + type: query + disabled: true + - name: nextPurchaseDate + value: 2024-10-30 + type: query + disabled: true + - name: originalOrderId + value: 1421091661214-01 + type: query + disabled: true + - name: page + value: "3" + type: query + disabled: true + - name: size + value: "10" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists subscriptions from your store. If you wish, you can use query parameters. By default, this request returns the query parameter `page` value `1`, and `size` value `15`. + + >⚠️ The status code response `200 OK` is limited to 15 results. You can get different values by combining pagination query parameters. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `customerEmail` | query | Email of a customer that subscrived to your store. | + | `status` | query | Subscription status. The acceptable values are: - ACTIVE - PAUSED - CANCELED - EXPIRED - MISSING | + | `addressId` | query | Subscription shipping address ID. | + | `paymentId` | query | [Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) ID. It corresponds to the `paymentAccountId` field. | + | `planId` | query | [Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) ID. | + | `nextPurchaseDate` | query | Subscription next purchase date in the format `YYYY-MM-DD`. | + | `originalOrderId` | query | Order ID of when the customer subscribed. | + | `page` | query | Number of the starting page of the response. When no value is sent, it starts in page `1`. | + | `size` | query | Determines the number of subscriptions in the response. The maximum is equal to the default value, which is `15`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Remove item from subscription.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Remove item from subscription.yml new file mode 100644 index 0000000000..e81209e476 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Remove item from subscription.yml @@ -0,0 +1,53 @@ +info: + name: Remove item from subscription + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + - name: itemId + value: 0A6C01CA4582458A9CF8F61A9F6E1A68 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/rns/pub/subscriptions/:id/items/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/rns/pub/subscriptions/:id/items/:itemId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes an item from a given subscription. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `itemId` | path | (Required) Subscription item ID of the SKU being removed from the subscription. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Update subscription by ID.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Update subscription by ID.yml new file mode 100644 index 0000000000..3608426d98 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/Update subscription by ID.yml @@ -0,0 +1,166 @@ +info: + name: Update subscription by ID + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 1E7886FC8E45FF38C527897D749584F4 + type: path + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "title": "catFood", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "isSkipped": false, + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "340357032569595", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a subscription, searching by subscription ID. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8B91E3077495AB982117AD0BA4A5829D", + "customerId": "c00a9529-806b-4ef3-a5f7-ed7846a66d3d", + "customerEmail": "customer@email.com", + "title": null, + "status": "PAUSED", + "isSkipped": false, + "nextPurchaseDate": "2024-09-21T15:53:27.0665798Z", + "lastPurchaseDate": "2024-08-21T15:53:27.0665798Z", + "plan": { + "id": "store.subscription.basic", + "frequency": { + "periodicity": "DAILY", + "interval": 1 + }, + "validity": { + "begin": "2024-09-21T15:53:27.0665798Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "6", + "installments": 1, + "paymentSystemName": "Bank Slips", + "paymentSystemGroup": "bankInvoice" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 0, + "createdAt": "2024-08-21T15:53:27.0665798Z", + "lastUpdate": "0001-01-01T00:00:00", + "items": [ + { + "id": "0F821B992DD848028E3A82C40DBCD834", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "cycleCount": 0, + "manualPrice": 736, + "attachments": null + } + ], + "lastCycleId": null, + "customData": {} + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/folder.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/folder.yml new file mode 100644 index 0000000000..e371f87443 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/Subscriptions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Subscriptions + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/environments/VTEX.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Subscriptions API (v3)/opencollection.yml b/BrunoCollections/VTEX - Subscriptions API (v3)/opencollection.yml new file mode 100644 index 0000000000..f3d7385e9c --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API (v3)/opencollection.yml @@ -0,0 +1,69 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Subscriptions API (v3) + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [Subscriptions](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) is the VTEX solution for customers to make recurrent purchases at your store on a regular schedule. When customers subscribe, they define what products they want to acquire regularly and at what frequency they want these automatic orders to be created. For more information, see [Subscriptions onboarding guide](https://developers.vtex.com/docs/guides/subscriptions). + + ## Index + + ### Cycles + + - `GET` [Get cycle details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pub/cycles/-cycleId-) + - `GET` [List cycles](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pub/cycles) + - `POST` [Retry cycle](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pub/cycles/-cycleId-/retry) + + ### Plans + + - `GET` [List plans](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/plans) + - `GET` [Get plan details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/plans/-id-) + + ### Reports + + - `GET` [List report templates](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports) + - `GET` [Get report document details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports/-reportName-/documents/-documentId-) + - `POST` [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) + + ### Subscriptions + + - `GET` [Get subscription details by ID](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pub/subscriptions/-id-) + - `PATCH` [Update subscription by ID](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#patch-/api/rns/pub/subscriptions/-id-) + - `GET` [List subscriptions](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pub/subscriptions) + - `POST` [Create subscription](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pub/subscriptions) + - `DELETE` [Remove item from subscription](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#delete-/api/rns/pub/subscriptions/-id-/items/-itemId-) + - `PATCH` [Edit item on subscription](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#patch-/api/rns/pub/subscriptions/-id-/items/-itemId-) + - `POST` [Add item to subscription](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pub/subscriptions/-id-/items) + - `POST` [Calculate the current prices for a subscription](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pub/subscriptions/-id-/simulate) + - `POST` [Calculate the current prices for the provided subscription template](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pub/subscriptions/simulate) + - `GET` [Get conversation messages](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pub/subscriptions/-subscriptionId-/conversation-message) + + ### Settings + + - `GET` [Get subscription settings](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/settings) + - `POST` [Edit subscriptions settings](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/settings) + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Get cycle details.yml b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Get cycle details.yml new file mode 100644 index 0000000000..b4f97ba20a --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Get cycle details.yml @@ -0,0 +1,146 @@ +info: + name: Get cycle details + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/cycles/:cycleId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cycleId + value: 2b9de8a5-b29b-4e18-8400-400dc0a2330d + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/cycles/:cycleId - Schema is valid", function () { + const schema = {"type":"object","description":"Object with information about the subscription cycle.","properties":{"id":{"type":"string","description":"Cycle ID. When the `cycleCount` value is `1`, the `id` value will be the same as the `subscriptionId` value."},"subscriptionId":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"workflowId":{"type":"string","description":"Code that identifies the subscription in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"status":{"type":"string","description":"Subscription cycle execution status. The possible values are:\r\n- `TRIGGERED`: Execution has been triggered. \r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.","enum":["TRIGGERED","IN_PROCESS","FAILURE","SUCCESS","EXPIRED","ORDER_ERROR","PAYMENT_ERROR","SKIPED","SUCCESS_WITH_NO_ORDER","SUCCESS_WITH_PARTIAL_ORDER","RE_TRIGGERED","SCHEDULE_UPDATED"]},"customerEmail":{"type":"string","description":"Customer email."},"customerId":{"type":"string","description":"Customer ID."},"date":{"type":"string","format":"date-time","description":"Current date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":"string","format":"date-time","description":"Subscription cycle last update date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"isInRetry":{"type":"boolean","description":"Defines if the cycle execution is in retry (`true`), or not (`false`)."},"message":{"type":["string","null"],"description":"Cycle execution message."},"friendlyMessage":{"type":["string","null"],"description":"Cycle execution friendly message."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"orderInfo":{"type":"object","description":"Subscription order information.","properties":{"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"paymentURL":{"type":["string","null"],"description":"Order payment URL."},"value":{"type":"integer","format":"int64","description":"Order value in cents."}}},"context":{"type":"object","description":"Subscription cycle context.","properties":{"items":{"type":["array","null"],"description":"Information about subscription cycle items.","items":{"type":"object","description":"Subscription item information.","properties":{"subscriptionItemId":{"type":["string","null"],"description":"Subscription item ID."},"skuId":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":["integer","null"],"description":"Quantity of item units."},"status":{"type":["string","null"],"description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":["boolean","null"],"description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"cycleCount":{"type":["integer","null"],"description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."}}}},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."},"paymentSystemGroup":{"type":["string","null"],"description":"Payment system group."},"paymentAccountId":{"type":["string","null"],"description":"Information about the customer profile and their documents, such as a credit card number. You can also retrieve that information using the [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles) endpoint."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"addressType":{"type":["string","null"],"description":"Shipping address type."},"catalogAttachment":{"type":["string","null"],"description":"Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content, when applicable."}}},"simulationItems":{"type":["array","null"],"description":"Subscription simulation items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific cycle by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `cycleId` | path | (Required) ID from the desired cycle. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730", + "subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d", + "workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a", + "status": "SUCCESS", + "customerEmail": "customer@email.com", + "customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju", + "date": "2024-07-30T09:04:59.7325176Z", + "lastUpdate": "2024-07-31T09:06:05.6879323Z", + "cycleCount": 3, + "isInRetry": false, + "message": null, + "friendlyMessage": null, + "plan": { + "id": "store.subscription.tshirt-collection", + "frequency": { + "periodicity": "WEEKLY", + "interval": 3 + }, + "validity": { + "begin": "2024-04-11T11:04:24.0454821Z", + "end": null + }, + "purchaseDay": "Sunday" + }, + "orderInfo": { + "orderId": "V-8753228-01", + "orderGroup": "V-8753228", + "paymentUrl": null, + "value": 21600 + }, + "context": { + "items": [ + { + "subscriptionItem": "69C872657263439D899265717E733A84", + "skuId": "1154", + "quantity": 1, + "status": "ACTIVE", + "isSkipped": false, + "cycleCount": 1 + } + ], + "paymentSystem": "47", + "paymentSystemName": "Cash", + "paymentSystemGroup": "cash", + "paymentAccountId": null, + "addressId": "Address", + "addressType": "residential", + "catalogAttachment": "vtex.subscription.tshirt-collection" + }, + "simulationItems": [ + { + "id": "1145", + "quantity": 1, + "unitPrice": 21600, + "status": "OK", + "price": null, + "sellingPrice": 21600, + "manualPrice": null + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Cycles/List cycles.yml b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/List cycles.yml new file mode 100644 index 0000000000..b46e77fb61 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/List cycles.yml @@ -0,0 +1,179 @@ +info: + name: List cycles + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/cycles" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: beginDate + value: elit eu dolor amet + type: query + disabled: true + - name: endDate + value: elit eu dolor amet + type: query + disabled: true + - name: subscriptionId + value: elit eu dolor amet + type: query + disabled: true + - name: customerEmail + value: elit eu dolor amet + type: query + disabled: true + - name: status + value: elit eu dolor amet + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: size + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/cycles - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/cycles - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/cycles - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/cycles - Schema is valid", function () { + const schema = {"type":"array","description":"List of subscriptions of the VTEX account, limited to 15 results.","items":{"type":"object","description":"Object with information about the subscription cycle.","properties":{"id":{"type":"string","description":"Cycle ID. When the `cycleCount` value is `1`, the `id` value will be the same as the `subscriptionId` value."},"subscriptionId":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"workflowId":{"type":"string","description":"Code that identifies the subscription in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)."},"status":{"type":"string","description":"Subscription cycle execution status. The possible values are:\r\n- `TRIGGERED`: Execution has been triggered. \r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.","enum":["TRIGGERED","IN_PROCESS","FAILURE","SUCCESS","EXPIRED","ORDER_ERROR","PAYMENT_ERROR","SKIPED","SUCCESS_WITH_NO_ORDER","SUCCESS_WITH_PARTIAL_ORDER","RE_TRIGGERED","SCHEDULE_UPDATED"]},"customerEmail":{"type":"string","description":"Customer email."},"customerId":{"type":"string","description":"Customer ID."},"date":{"type":"string","format":"date-time","description":"Current date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":"string","format":"date-time","description":"Subscription cycle last update date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"isInRetry":{"type":"boolean","description":"Defines if the cycle execution is in retry (`true`), or not (`false`)."},"message":{"type":["string","null"],"description":"Cycle execution message."},"friendlyMessage":{"type":["string","null"],"description":"Cycle execution friendly message."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"orderInfo":{"type":"object","description":"Subscription order information.","properties":{"orderId":{"type":"string","description":"Order ID."},"orderGroup":{"type":"string","description":"Order group ID."},"paymentURL":{"type":["string","null"],"description":"Order payment URL."},"value":{"type":"integer","format":"int64","description":"Order value in cents."}}},"context":{"type":"object","description":"Subscription cycle context.","properties":{"items":{"type":["array","null"],"description":"Information about subscription cycle items.","items":{"type":"object","description":"Subscription item information.","properties":{"subscriptionItemId":{"type":["string","null"],"description":"Subscription item ID."},"skuId":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":["integer","null"],"description":"Quantity of item units."},"status":{"type":["string","null"],"description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":["boolean","null"],"description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"cycleCount":{"type":["integer","null"],"description":"The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."}}}},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."},"paymentSystemGroup":{"type":["string","null"],"description":"Payment system group."},"paymentAccountId":{"type":["string","null"],"description":"Information about the customer profile and their documents, such as a credit card number. You can also retrieve that information using the [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles) endpoint."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"addressType":{"type":["string","null"],"description":"Shipping address type."},"catalogAttachment":{"type":["string","null"],"description":"Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content, when applicable."}}},"simulationItems":{"type":["array","null"],"description":"Subscription simulation items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists subscription cycles, based on filters defined in the query parameters. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `beginDate` | query | Lower limit for the date of creation of the cycle | + | `endDate` | query | Upper limit for the date of creation of the cycle | + | `subscriptionId` | query | Id from the subscription that generated the cycle | + | `customerEmail` | query | Customer that owns the subscription. Defaults to the current logged user | + | `status` | query | Current cycle status | + | `page` | query | Page used for pagination | + | `size` | query | Page size used for pagination | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730", + "subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d", + "workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a", + "status": "SUCCESS", + "customerEmail": "customer@email.com", + "customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju", + "date": "2024-07-30T09:04:59.7325176Z", + "lastUpdate": "2024-07-31T09:06:05.6879323Z", + "cycleCount": 3, + "isInRetry": false, + "message": null, + "friendlyMessage": null, + "plan": { + "id": "store.subscription.tshirt-collection", + "frequency": { + "periodicity": "WEEKLY", + "interval": 3 + }, + "validity": { + "begin": "2024-04-11T11:04:24.0454821Z", + "end": null + }, + "purchaseDay": "Sunday" + }, + "orderInfo": { + "orderId": "V-8753228-01", + "orderGroup": "V-8753228", + "paymentUrl": null, + "value": 21600 + }, + "context": { + "items": [ + { + "subscriptionItem": "69C872657263439D899265717E733A84", + "skuId": "1154", + "quantity": 1, + "status": "ACTIVE", + "isSkipped": false, + "cycleCount": 1 + } + ], + "paymentSystem": "47", + "paymentSystemName": "Cash", + "paymentSystemGroup": "cash", + "paymentAccountId": null, + "addressId": "Address", + "addressType": "residential", + "catalogAttachment": "vtex.subscription.tshirt-collection" + }, + "simulationItems": [ + { + "id": "1145", + "quantity": 1, + "unitPrice": 21600, + "status": "OK", + "price": null, + "sellingPrice": 21600, + "manualPrice": null + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Retry cycle.yml b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Retry cycle.yml new file mode 100644 index 0000000000..b97da33be8 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/Retry cycle.yml @@ -0,0 +1,57 @@ +info: + name: Retry cycle + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/cycles/:cycleId/retry" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: cycleId + value: elit eu dolor amet + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/rns/pub/cycles/:cycleId/retry - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Every subscription order has an execution count called cycle, which determines the position of an order counting from when the shopper subscribed. This endpoint reruns a cycle that is currently in error state. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `cycleId` | path | (Required) ID from the subscription cycle that will be retried. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Cycles/folder.yml b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/folder.yml new file mode 100644 index 0000000000..a52b0463ff --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Cycles/folder.yml @@ -0,0 +1,4 @@ +info: + name: Cycles + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Plans/Get plan details.yml b/BrunoCollections/VTEX - Subscriptions API v3/Plans/Get plan details.yml new file mode 100644 index 0000000000..5c62c94c27 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Plans/Get plan details.yml @@ -0,0 +1,107 @@ +info: + name: Get plan details + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/plans/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: catfood.subscription + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/plans/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/plans/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/plans/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/plans/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription [plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","properties":{"id":{"type":"string","description":"Subscription plan ID."},"frequencies":{"type":"array","description":"Array of the plan frequencies.","items":{"type":"object","description":"Information about the plan periodicity and interval.","properties":{"periodicity":{"type":["string","null"],"description":"Repurchase frequency requested by the customer, defines the subscriptions recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}}},"isActive":{"type":"boolean","description":"Defines if the plan is active (`true`) or not (`false`)."},"importInProgress":{"type":"boolean","description":"Defines if a SKU importing process is in progress (`true`) or not (`false`)."},"attachmentId":{"type":"integer","description":"Plan attachment ID."},"isValid":{"type":"boolean","description":"Defines if the plan is valid (`true`) or not (`false`)."},"validationMessages":{"type":["array","null"],"description":"List of validation messages.","items":{"type":"string","description":"Validation message."}},"validity":{"type":["object","null"],"description":"Information about the period during which the subscription plan will be valid.","properties":{"begin":{"type":"string","format":"date-time","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"format":"date-time","description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDays":{"type":"array","description":"Time reference in which subscription orders will be created.","items":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific subscription plan by its ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) ID from the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "catfood.subscription", + "frequencies": [ + { + "periodicity": "DAILY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 40, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "1", + "2", + "3", + "4", + "5", + "6", + "0" + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Plans/List plans.yml b/BrunoCollections/VTEX - Subscriptions API v3/Plans/List plans.yml new file mode 100644 index 0000000000..02a9138484 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Plans/List plans.yml @@ -0,0 +1,137 @@ +info: + name: List plans + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/plans" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: periodicity + value: elit eu dolor amet + type: query + disabled: true + - name: interval + value: elit eu dolor amet + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + - name: size + value: "15" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/plans - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/plans - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/plans - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/plans - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Subscription [plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","properties":{"id":{"type":"string","description":"Subscription plan ID."},"frequencies":{"type":"array","description":"Array of the plan frequencies.","items":{"type":"object","description":"Information about the plan periodicity and interval.","properties":{"periodicity":{"type":["string","null"],"description":"Repurchase frequency requested by the customer, defines the subscriptions recurrence period.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}}},"isActive":{"type":"boolean","description":"Defines if the plan is active (`true`) or not (`false`)."},"importInProgress":{"type":"boolean","description":"Defines if a SKU importing process is in progress (`true`) or not (`false`)."},"attachmentId":{"type":"integer","description":"Plan attachment ID."},"isValid":{"type":"boolean","description":"Defines if the plan is valid (`true`) or not (`false`)."},"validationMessages":{"type":["array","null"],"description":"List of validation messages.","items":{"type":"string","description":"Validation message."}},"validity":{"type":["object","null"],"description":"Information about the period during which the subscription plan will be valid.","properties":{"begin":{"type":"string","format":"date-time","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"format":"date-time","description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDays":{"type":"array","description":"Time reference in which subscription orders will be created.","items":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists subscription plans, based on filters defined in the query parameters. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `periodicity` | query | Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available periodicity. | + | `interval` | query | Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available interval. | + | `page` | query | Page used for pagination. | + | `size` | query | Desired number of [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) in the response. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "catfood.subscription", + "frequencies": [ + { + "periodicity": "DAILY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 40, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "7" + ] + }, + { + "id": "subscription.tshirt", + "frequencies": [ + { + "periodicity": "MONTHLY", + "interval": 1 + } + ], + "isActive": true, + "importInProgress": false, + "attachmentId": 39, + "isValid": true, + "validationMessages": [], + "validity": null, + "purchaseDays": [ + "3" + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Plans/folder.yml b/BrunoCollections/VTEX - Subscriptions API v3/Plans/folder.yml new file mode 100644 index 0000000000..be9eac39d1 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Plans/folder.yml @@ -0,0 +1,4 @@ +info: + name: Plans + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Reports/Generate report.yml b/BrunoCollections/VTEX - Subscriptions API v3/Reports/Generate report.yml new file mode 100644 index 0000000000..e48eee4ae9 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Reports/Generate report.yml @@ -0,0 +1,143 @@ +info: + name: Generate report + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pvt/reports/:reportName/documents" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: receiver@email.com + type: query + disabled: true + - name: status + value: SUCCESS + type: query + disabled: true + - name: beginDate + value: 2024-07-01 + type: query + disabled: true + - name: endDate + value: 2024-08-01 + type: query + disabled: true + - name: reportName + value: subscriptionsWithStatus + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pvt/reports/:reportName/documents - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription report information.","properties":{"id":{"type":"string","description":"Report document ID."},"finished":{"type":"boolean","description":"Defines if the report is finished (`true`) or not (`false`)."},"recordsProcessed":{"type":"integer","description":"Number of records processed at the moment."},"recordsSum":{"type":["integer","null"],"description":"Total number of records to be processed."},"startDate":{"type":["string","null"],"description":"Report starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdateTime":{"type":["string","null"],"description":"Report last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"completedDate":{"type":["string","null"],"description":"Report completion date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"errorCount":{"type":["integer","null"],"description":"Error counting numbers, when applicable."},"percentageProcessed":{"type":"number","description":"Report processing percentage."},"enqueueDate":{"type":["string","null"],"description":"Request enqueue date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"email":{"type":"string","description":"Email of the user that receives the report."},"canceled":{"type":"boolean","description":"Defines if the report is canceled (`true`) or not (`false`)."},"outputType":{"type":["string","null"],"description":"Report file extension."},"zipped":{"type":"boolean","description":"Defines if the report file is zipped (`true`) or not (`false`)."},"linkToDownload":{"type":["string","null"],"description":"Link do download the report."},"lastErrorMessage":{"type":["string","null"],"description":"Error last message, when applicable."},"statusMessage":{"type":"string","description":"Report status message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a subscriptions report in the format of a `csv` file and sends it via email to a given user. + + >ℹ️ In the response body of the current endpoint, you get the document ID required for the [Get report document details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports/-reportName-/documents/-documentId-) endpoint. + + You can generate the following types of report: + + - `subscriptionsWithStatus`: Get subscriptions based on subscription cycle execution status. + - **Required query param:** `status`. + + - `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates. + - **Required query params:** `beginDate` and `endDate`. + + - `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates. + - **Required query params:** `beginDate` and `endDate`. + + - `subscriptionsCreatedBetweenDate`: Get subscriptions created between dates. + - **Required query params:** `beginDate` and `endDate`. + + - `executionsBetweenDate`: Get executions between dates. + - **Required query params:** `beginDate` and `endDate`. + + >ℹ️ You can also use the [List report templates](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports) endpoint to discover the types of reports you can generate. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription metrics and reports** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reportName` | path | (Required) Name of the type of report you wish to generate. The following values are accepted: - `subscriptionsWithStatus` - `subscriptionsScheduledBetweenDate` - `subscriptionsUpdatedBetweenDate` - `subscriptionsCreatedBetweenDate` - `executionsBetweenDate` | + | `email` | query | The report will be sent to the email in this field. When no email is provided, the report is sent to the email of the user making the request. | + | `status` | query | Subscription cycle execution status. This field is required only for the `subscriptionsWithStatus` report type, and the possible values are: - `TRIGGERED`: Execution has been triggered. - `IN_PROCESS`: Execution is being processed by the system. - `FAILURE`: An internal error occurred during the subscription execution. - `SUCCESS`: Successful cycle processing. - `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended. - `ORDER_ERROR`: Cycle was not executed due to an error in order placement. - `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment. - `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle. - `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items. - `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order. - `RE_TRIGGERED`: Execution retry was triggered manually. - `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated. | + | `beginDate` | query | Beginning date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type. | + | `endDate` | query | Ending date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "7849df9f-00d4-11ef-8452-1254acca1d85", + "finished": false, + "recordsProcessed": 0, + "recordsSum": null, + "startDate": null, + "lastUpdateTime": null, + "completedDate": null, + "errorCount": null, + "percentageProcessed": 0, + "enqueueDate": "2024-04-22T18:16:50.7487312Z", + "email": "receiver@email.com", + "canceled": false, + "outputType": "CSV", + "zipped": false, + "linkToDownload": null, + "lastErrorMessage": null, + "statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 is being processed (0.00% completed). The file will be sent to receiver@email.com." + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Reports/Get report document details.yml b/BrunoCollections/VTEX - Subscriptions API v3/Reports/Get report document details.yml new file mode 100644 index 0000000000..756fcce2ae --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Reports/Get report document details.yml @@ -0,0 +1,108 @@ +info: + name: Get report document details + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/reports/:reportName/documents/:documentId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reportName + value: subscriptionsWithStatus + type: path + - name: documentId + value: 2804f3ab-5a51-11ef-b37f-f89ffae09a60 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/reports/:reportName/documents/:documentId - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription report information.","properties":{"id":{"type":"string","description":"Report document ID."},"finished":{"type":"boolean","description":"Defines if the report is finished (`true`) or not (`false`)."},"recordsProcessed":{"type":"integer","description":"Number of records processed at the moment."},"recordsSum":{"type":["integer","null"],"description":"Total number of records to be processed."},"startDate":{"type":["string","null"],"description":"Report starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdateTime":{"type":["string","null"],"description":"Report last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"completedDate":{"type":["string","null"],"description":"Report completion date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"errorCount":{"type":["integer","null"],"description":"Error counting numbers, when applicable."},"percentageProcessed":{"type":"number","description":"Report processing percentage."},"enqueueDate":{"type":["string","null"],"description":"Request enqueue date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"email":{"type":"string","description":"Email of the user that receives the report."},"canceled":{"type":"boolean","description":"Defines if the report is canceled (`true`) or not (`false`)."},"outputType":{"type":["string","null"],"description":"Report file extension."},"zipped":{"type":"boolean","description":"Defines if the report file is zipped (`true`) or not (`false`)."},"linkToDownload":{"type":["string","null"],"description":"Link do download the report."},"lastErrorMessage":{"type":["string","null"],"description":"Error last message, when applicable."},"statusMessage":{"type":"string","description":"Report status message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a subscription report document, searching by document ID. In the status code `200 OK` response, you get a link to download the report. + + >❗ Before using this endpoint, you must create a report with the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint and get the document ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription metrics and reports** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `reportName` | path | (Required) Name of the report type, which must be previously created for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint. The possible values are: - `subscriptionsWithStatus` - `subscriptionsScheduledBetweenDate` - `subscriptionsUpdatedBetweenDate` - `subscriptionsCreatedBetweenDate` - `executionsBetweenDate` | + | `documentId` | path | (Required) Report document ID. You get this value after you create a report template for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "7849df9f-00d4-11ef-8452-1254acca1d85", + "finished": true, + "recordsProcessed": 63, + "recordsSum": 63, + "startDate": "2024-03-22T18:16:50.7487312Z", + "lastUpdateTime": "2024-04-22T18:16:50.7487312Z", + "completedDate": "2024-04-22T18:16:50.7487312Z", + "errorCount": null, + "percentageProcessed": 100, + "enqueueDate": "2024-04-22T18:16:50.7487312Z", + "email": "receiver@email.com", + "canceled": false, + "outputType": "CSV", + "zipped": false, + "linkToDownload": "https://s3.amazonaws.com/OMSReport/v3/_finished/accountname/7849df9f-00d4-11ef-8452-1254acca1d85//files/47363271-b655-11ed-83ab-12dbed7de2a7.csv?AWSAccessKeyId=ASIAQYXXCHIYPSJDRNHB&Expires=1724945014&x-amz-security-token=IQoJb3JpZ2luX2VjEMj%2Feq6V1w8z3NGlnfhvSp70Q80qvQUIwP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgwwNTMxMzE0OTE4ODgiDCM0JATV%2FwXQvXyovCqRBW%2F14aC5J3plQR%2BzKbpddyDnoAstfgJo1MfR0yel3uRzixrSRFE033V4%2B8cN7ez5Lr0ymGifnB14ONZ35RtM4PgQvuV0fs8If6cw8%3D%3D&Signature=7yZbA%2BGaYdPUkdxFXqy9W8GGHuo%3D", + "lastErrorMessage": null, + "statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 was completed at 15:23 and sent to receiver@email.com." + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Reports/List report templates.yml b/BrunoCollections/VTEX - Subscriptions API v3/Reports/List report templates.yml new file mode 100644 index 0000000000..a24de9db46 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Reports/List report templates.yml @@ -0,0 +1,174 @@ +info: + name: List report templates + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pvt/reports" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pvt/reports - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pvt/reports - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pvt/reports - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pvt/reports - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Report template details.","properties":{"account":{"type":"string","description":"VTEX store account name."},"name":{"type":"string","description":"Template type, more information in the `description` field.","enum":["subscriptionsWithStatus","subscriptionsScheduledBetweenDate","subscriptionsUpdatedBetweenDate","subscriptionsCreatedBetweenDate","executionsBetweenDate"]},"description":{"type":"string","description":"Template description, which varies according to the template type:\r\n- `subscriptionsWithStatus`: Get subscriptions based on status.\r\n- `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates.\r\n- `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates.\r\n- `subscriptionsCreatedBetweenDates`: Get subscriptions created between date.\r\n- `executionsBetweenDate`: Get executions between dates."},"reason":{"type":["string","null"],"description":"Reason why the template was created."},"behalfOf":{"type":["string","null"],"description":"On behalf of which user the template was created."},"params":{"type":"array","description":"Information about the template params.","items":{"type":"object","description":"Param details.","properties":{"type":{"type":"string","description":"Template param type, which can be `string` for the `subscriptionsWithStatus` template type, or `date` for the other cases.","enum":["string","date"]},"format":{"type":"string","description":"Template param format, such as `yyyy-MM-dd` for `beginDate` or `endDate`. Not applicable to the `subscriptionsWithStatus` type."},"name":{"type":"string","description":"Template param name, which can relate to the template status (`status`) or dates (`beginDate`, `endDate`).","enum":["status","beginDate","endDate"]}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists all subscription report templates available. + + >ℹ️ After choosing the desired template, use the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint to create the report for your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription admin** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + | Subscriptions | ApplicationAccess | **Subscription metrics and reports** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "account": "fashionstore", + "name": "subscriptionsWithStatus", + "description": "Get subscriptions based on status", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "string", + "name": "status" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsScheduledBetweenDate", + "description": "Get active subscriptions scheduled between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsUpdatedBetweenDate", + "description": "Get subscriptions updated between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "subscriptionsCreatedBetweenDate", + "description": "Get subscriptions created between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + }, + { + "account": "fashionstore", + "name": "executionsBetweenDate", + "description": "Get executions between date", + "reason": null, + "behalfOf": null, + "params": [ + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "beginDate" + }, + { + "type": "date", + "format": "yyyy-MM-dd", + "name": "endDate" + } + ] + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Reports/folder.yml b/BrunoCollections/VTEX - Subscriptions API v3/Reports/folder.yml new file mode 100644 index 0000000000..0440dedf44 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Reports/folder.yml @@ -0,0 +1,4 @@ +info: + name: Reports + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Settings/Edit subscriptions settings.yml b/BrunoCollections/VTEX - Subscriptions API v3/Settings/Edit subscriptions settings.yml new file mode 100644 index 0000000000..c851bfe5f4 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Settings/Edit subscriptions settings.yml @@ -0,0 +1,123 @@ +info: + name: Edit subscriptions settings + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/rns/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "delivery" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true, + "attachmentPreferences": { + "enableAttachments": false, + "splitSameSkuWithDifferentAttachments": false + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/settings - Schema is valid", function () { + const schema = {"description":"VTEX account subscriptions settings.","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"description":"Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.","type":"string","enum":["NONE","CHEAPEST","CUSTOMER_CHOICE","STORE_CHOICE"]},"defaultSla":{"description":"This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.","type":["string","null"]},"isUsingV3":{"description":"Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).","type":"boolean"},"onMigrationProcess":{"description":"Indicates if the store is in the process of migrating to Subscriptions V3 (`true`) or not (`false`).","type":"boolean"},"executionHourInUtc":{"description":"Indicates the time future subscription orders will be generated.","type":"integer"},"workflowVersion":{"description":"Workflow version.","type":"string"},"deliveryChannels":{"description":"Array containing delivery channels.","type":"array","items":{"description":"Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.","type":"string","enum":["delivery","pickupInPoint"]}},"randomIdGeneration":{"description":"Defines if subscription order IDs are randomly generated (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnCreation":{"description":"Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnUpdate":{"description":"Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).","type":"boolean"},"attachmentPreferences":{"type":"object","description":"Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","properties":{"enableAttachments":{"type":"boolean","description":"Defines if the store [keeps attachments from original orders](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`."},"splitSameSkuWithDifferentAttachments":{"type":"boolean","description":"Defines if the [same SKUs that contain different attachments](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`."}}},"orderCustomDataAppId":{"description":"When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.","type":["string","null"]},"postponeExpiration":{"description":"Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).","type":"boolean"},"manualPriceAllowed":{"description":"Defines if the [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration is enabled for subscriptions items (`true`), or not (`false`). This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.","type":"boolean"},"useItemPriceFromOriginalOrder":{"description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits the subscriptions settings of your store. This configurations apply to all subscriptions. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Settings/Get subscriptions settings.yml b/BrunoCollections/VTEX - Subscriptions API v3/Settings/Get subscriptions settings.yml new file mode 100644 index 0000000000..6759ab1804 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Settings/Get subscriptions settings.yml @@ -0,0 +1,101 @@ +info: + name: Get subscriptions settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/settings - Schema is valid", function () { + const schema = {"description":"VTEX account subscriptions settings.","type":"object","required":["slaOption","defaultSla","isUsingV3","onMigrationProcess","executionHourInUtc","workflowVersion","deliveryChannels","randomIdGeneration","isMultipleInstallmentsEnabledOnCreation","isMultipleInstallmentsEnabledOnUpdate","orderCustomDataAppId","postponeExpiration","manualPriceAllowed","useItemPriceFromOriginalOrder"],"properties":{"slaOption":{"description":"Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.","type":"string","enum":["NONE","CHEAPEST","CUSTOMER_CHOICE","STORE_CHOICE"]},"defaultSla":{"description":"This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.","type":["string","null"]},"isUsingV3":{"description":"Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).","type":"boolean"},"onMigrationProcess":{"description":"Indicates if the store is in the process of migrating to Subscriptions V3 (`true`) or not (`false`).","type":"boolean"},"executionHourInUtc":{"description":"Indicates the time future subscription orders will be generated.","type":"integer"},"workflowVersion":{"description":"Workflow version.","type":"string"},"deliveryChannels":{"description":"Array containing delivery channels.","type":"array","items":{"description":"Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.","type":"string","enum":["delivery","pickupInPoint"]}},"randomIdGeneration":{"description":"Defines if subscription order IDs are randomly generated (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnCreation":{"description":"Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).","type":"boolean"},"isMultipleInstallmentsEnabledOnUpdate":{"description":"Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).","type":"boolean"},"attachmentPreferences":{"type":"object","description":"Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","properties":{"enableAttachments":{"type":"boolean","description":"Defines if the store [keeps attachments from original orders](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`."},"splitSameSkuWithDifferentAttachments":{"type":"boolean","description":"Defines if the [same SKUs that contain different attachments](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`."}}},"orderCustomDataAppId":{"description":"When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.","type":["string","null"]},"postponeExpiration":{"description":"Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).","type":"boolean"},"manualPriceAllowed":{"description":"Defines if the [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration is enabled for subscriptions items (`true`), or not (`false`). This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.","type":"boolean"},"useItemPriceFromOriginalOrder":{"description":"When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.","type":"boolean"}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the subscriptions settings of your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription admin** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "attachmentPreferences": { + "enableAttachments": false, + "splitSameSkuWithDifferentAttachments": false + }, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Settings/folder.yml b/BrunoCollections/VTEX - Subscriptions API v3/Settings/folder.yml new file mode 100644 index 0000000000..f425567a7c --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Settings/folder.yml @@ -0,0 +1,4 @@ +info: + name: Settings + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Add item to subscription.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Add item to subscription.yml new file mode 100644 index 0000000000..8cbb50cfa6 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Add item to subscription.yml @@ -0,0 +1,157 @@ +info: + name: Add item to subscription + type: http + seq: 7 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + body: + type: json + data: |- + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400.3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/items - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a new item to a given subscription. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "vtex.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for a subscription.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for a subscription.yml new file mode 100644 index 0000000000..05e3e5dff6 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for a subscription.yml @@ -0,0 +1,205 @@ +info: + name: Calculate the current prices for a subscription + type: http + seq: 8 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/simulate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/:id/simulate - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription order simulation response.","properties":{"simulation":{"type":"object","description":"Object with subscription order simulation details.","properties":{"items":{"type":"array","description":"Simulation items information.","items":{"type":"object","description":"Simulation information about a given item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"seller":{"type":["string","null"],"description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"quantity":{"type":"integer","description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Item name."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}}}}},"logisticsInfo":{"type":"array","description":"Simulation logistics information.","items":{"type":"object","description":"Logistics details.","properties":{"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts at `0`, followed by `1`, `2`, and so on."},"quantity":{"type":"integer","description":"Quantity of units."},"selectedSla":{"type":["string","null"],"description":"Selected Service Level Agreement (SLA)."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Shipping type (shipping method) selected by the customer, like delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA in days. One business day corresponds to `1bd`, for example."},"shippingEstimate":{"type":["string","null"],"description":"Shipping estimate time in days. Three business days correspond to `3bd`, for example."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"pickupId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when shipping type is pickup."},"price":{"type":["integer","null"],"description":"Shipping cost."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) period."},"slas":{"type":"array","description":"Service Level Agreement (SLA) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) considered for the simulation.","items":{"type":"object","description":"Subscription order SLA details.","properties":{"id":{"type":["string","null"],"description":"ID of the shipping type (shipping method) of the shipping policy."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"deliveryChannel":{"type":["string","null"],"description":"Defines if the delivery channel is `delivery` or `pickup-in-point`.","enum":["delivery","pickup-in-point"]},"price":{"type":"integer","description":"Item shipping price in cents. This value does not account for the order total shipping price."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping estimate time in days. For instance, three business days is represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. One business day is represented as `1bd`, for example."},"deliveryWindows":{"type":["array","null"],"description":"[Delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about a given delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}},"availableDeliveryWindows":{"type":["array","null"],"description":"Available [delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about an available delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Available delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Available delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}}}}}}}},"paymentData":{"type":["object","null"],"description":"Simulation payment information.","properties":{"payments":{"type":["array","null"],"description":"Payment information.","items":{"type":["object","null"],"description":"Payment details.","properties":{"id":{"type":["string","null"],"description":"Payment ID unique identifier in VTEX."},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"group":{"type":["string","null"],"description":"Payment system group."},"bin":{"type":["string","null"],"description":"Abbreviation for _Bank Identification Number_, which is a code that identifies the institution responsible for issuing the credit card."},"accountId":{"type":["string","null"],"description":"Store account ID."},"parentAccountId":{"type":["string","null"],"description":"Retrieves the main account ID if the payment was made in a subaccount."},"referenceValue":{"type":["integer","null"],"format":"int64","description":"Payment reference value in cents."},"value":{"type":["integer","null"],"format":"int64","description":"Payment value in cents."},"installments":{"type":["integer","null"],"description":"Number of installments."},"url":{"type":["string","null"],"description":"Payment URL."},"cardNumber":{"type":["string","null"],"description":"Card number information."},"fields":{"type":["array","null"],"description":"Payment parameters names and values.","items":{"type":"object","description":"Information about a given payment parameter.","properties":{"name":{"type":["string","null"],"description":"Payment parameter name."},"value":{"type":["string","null"],"description":"Payment parameter value."}}}},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."}}}},"transactions":{"type":["array","null"],"description":"Financial transactions information. This array returns empty in the simulation.","items":{"type":["object","null"],"description":"Financial transactions details.","properties":{"isActive":{"type":["boolean","null"],"description":"Defines if the subscription order payment is active (`true`) or inactive (`false`)."}}}}}},"country":{"type":["string","null"],"description":"Subscription order simulation three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"postalCode":{"type":["string","null"],"description":"Subscription order simulation postal code."},"messages":{"type":["array","null"],"description":"Simulation messages information.","items":{"type":["object","null"],"description":"Simulation message details.","properties":{"code":{"type":["string","null"],"description":"Message code."},"status":{"type":["string","null"],"description":"Message status."},"text":{"type":["string","null"],"description":"Message text."}}}},"selectableGifts":{"type":["array","null"],"description":"Information about subscription selectable gifts. For example, when the customer gains a gift from the store based on a promotion.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":["string","null"],"description":"Selectable gift ID."},"availableQuantity":{"type":["integer","null"],"description":"Available quantity of selectable gifts."},"availableGifts":{"type":["array","null"],"description":"Details about available gifts.","items":{"type":["object","null"],"description":"Information about a given available gift.","properties":{"id":{"type":["string","null"],"description":"Gift ID."},"seller":{"type":["string","null"],"description":"Seller name."},"quantity":{"type":["integer","null"],"description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"unitMultiplier":{"type":["number","null"],"description":"Unit multiplier."},"attachments":{"type":["array","null"],"description":"Available gift attachments information, when applicable.","items":{"type":["object","null"],"description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Gift attachment name."},"content":{"type":["object","null"],"description":"Custom field for the gift attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Gift name."},"isGift":{"type":["boolean","null"],"description":"Defines it the item is from a gift list (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}},"isSelected":{"type":["boolean","null"],"description":"Defines if the item can be selected (`true`), or not (`false`)."}}}}}}},"totals":{"type":"array","description":"Information about simulation total counts.","items":{"type":"object","description":"Details about a given total count.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total count name."},"valueAsInt":{"type":"integer","format":"int64","description":"Total count value in cents."}}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}},"shippingEstimate":{"type":"object","description":"Subscription order shipping estimate information.","properties":{"name":{"type":"string","description":"ID of the shipping type (shipping method) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"estimate":{"type":"string","description":"Total shipping estimate time in days. Three business days is represented as `3bd`, for example."},"estimateDeliveryDate":{"type":"string","description":"Estimate delivery date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"matched":{"type":"boolean","description":"Defines if the shipping estimate is matched (`true`), or not (`false`)."}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}},"totals":{"type":"array","description":"Information about total counts.","items":{"type":"object","description":"Total cost per shipping or items.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"value":{"type":"number","description":"Total count value."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Simulates an order made by the specific subscription on checkout and retrieves the current price for items and shipping. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "simulation": { + "items": [ + { + "id": "9", + "seller": "1", + "quantity": 1, + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null, + "unitMultiplier": 1, + "measurementUnit": "un", + "attachments": null, + "name": null, + "isGift": false, + "priceTags": [] + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "quantity": 1, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "lockTTL": "1bd", + "shippingEstimate": null, + "addressId": "5028945524109", + "pickupId": null, + "price": 0, + "deliveryWindow": null, + "slas": [ + { + "id": "Normal", + "pickupPointId": null, + "deliveryChannel": "delivery", + "price": 500, + "shippingEstimate": "3bd", + "lockTTL": "1bd", + "deliveryWindows": [], + "availableDeliveryWindows": [] + } + ] + } + ], + "paymentData": { + "payments": [ + { + "id": null, + "paymentSystem": "6", + "group": null, + "bin": null, + "accountId": null, + "parentAccountId": null, + "referenceValue": 13460, + "value": 13460, + "installments": 1, + "url": null, + "cardNumber": null, + "fields": null, + "paymentSystemName": null + } + ], + "transactions": [] + }, + "country": null, + "postalCode": null, + "messages": [], + "selectableGifts": [], + "totals": [ + { + "id": "Items", + "name": "Items total", + "value": 12960 + }, + { + "id": "Shipping", + "name": "Shipping total", + "value": 500 + } + ], + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": null, + "sellingPrice": 12960, + "manualPrice": null + } + ] + }, + "shippingEstimate": { + "name": "Normal", + "estimate": "3bd", + "estimatedDeliveryDate": "2024-08-26T00:00:00Z", + "nextPurchaseDate": "2024-09-26T00:00:00Z", + "matched": true + }, + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null + } + ], + "totals": [ + { + "id": "Items", + "value": 12960 + }, + { + "id": "Shipping", + "value": 500 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for the provided subscription template.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for the provided subscription template.yml new file mode 100644 index 0000000000..0ff296b3d4 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Calculate the current prices for the provided subscription template.yml @@ -0,0 +1,283 @@ +info: + name: Calculate the current prices for the provided subscription template + type: http + seq: 9 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions/simulate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "items": [ + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400, + "attachments": [ + { + "name": "Engraving", + "content": { + "laborum_bb": "Happy Birthday!", + "dolor_d": "Happy Birthday!" + } + }, + { + "name": "Engraving", + "content": { + "minima5": "Happy Birthday!", + "officia_b": "Happy Birthday!", + "dolore16e": "Happy Birthday!", + "aute785": "Happy Birthday!" + } + } + ] + }, + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400, + "attachments": [ + { + "name": "Engraving", + "content": { + "exercitation41": "Happy Birthday!" + } + }, + { + "name": "Engraving", + "content": { + "ex_64f": "Happy Birthday!" + } + } + ] + } + ], + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "6559E125DB084A46994E045547DE504B", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "title": "fashionBasic", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "catalogAttachment": "vtex.subscription.tshirt-collection" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions/simulate - Schema is valid", function () { + const schema = {"type":"object","description":"Subscription order simulation response.","properties":{"simulation":{"type":"object","description":"Object with subscription order simulation details.","properties":{"items":{"type":"array","description":"Simulation items information.","items":{"type":"object","description":"Simulation information about a given item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"seller":{"type":["string","null"],"description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."},"quantity":{"type":"integer","description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"unitMultiplier":{"type":"number","description":"Item unit multiplier."},"measurementUnit":{"type":"string","description":"Item measurement unit."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Item name."},"isGift":{"type":"boolean","description":"Defines it the item is a gift (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}}}}},"logisticsInfo":{"type":"array","description":"Simulation logistics information.","items":{"type":"object","description":"Logistics details.","properties":{"itemIndex":{"type":"integer","description":"Each item in the subscription order is identified by an index. The position starts at `0`, followed by `1`, `2`, and so on."},"quantity":{"type":"integer","description":"Quantity of units."},"selectedSla":{"type":["string","null"],"description":"Selected Service Level Agreement (SLA)."},"selectedDeliveryChannel":{"type":["string","null"],"description":"Shipping type (shipping method) selected by the customer, like delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).","enum":["delivery","pickup-in-point"]},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA in days. One business day corresponds to `1bd`, for example."},"shippingEstimate":{"type":["string","null"],"description":"Shipping estimate time in days. Three business days correspond to `3bd`, for example."},"addressId":{"type":["string","null"],"description":"Shipping address ID."},"pickupId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when shipping type is pickup."},"price":{"type":["integer","null"],"description":"Shipping cost."},"deliveryWindow":{"type":["string","null"],"description":"[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) period."},"slas":{"type":"array","description":"Service Level Agreement (SLA) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) considered for the simulation.","items":{"type":"object","description":"Subscription order SLA details.","properties":{"id":{"type":["string","null"],"description":"ID of the shipping type (shipping method) of the shipping policy."},"pickupPointId":{"type":["string","null"],"description":"[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA."},"deliveryChannel":{"type":["string","null"],"description":"Defines if the delivery channel is `delivery` or `pickup-in-point`.","enum":["delivery","pickup-in-point"]},"price":{"type":"integer","description":"Item shipping price in cents. This value does not account for the order total shipping price."},"shippingEstimate":{"type":["string","null"],"description":"Total shipping estimate time in days. For instance, three business days is represented as `3bd`."},"lockTTL":{"type":["string","null"],"description":"Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. One business day is represented as `1bd`, for example."},"deliveryWindows":{"type":["array","null"],"description":"[Delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about a given delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}},"availableDeliveryWindows":{"type":["array","null"],"description":"Available [delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.","items":{"type":"object","description":"Information about an available delivery window.","properties":{"startDateUtc":{"type":["string","null"],"description":"Available delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"endDateUtc":{"type":["string","null"],"description":"Available delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"price":{"type":["integer","null"],"format":"int64","description":"Delivery window shipping price."}}}}}}}}}},"paymentData":{"type":["object","null"],"description":"Simulation payment information.","properties":{"payments":{"type":["array","null"],"description":"Payment information.","items":{"type":["object","null"],"description":"Payment details.","properties":{"id":{"type":["string","null"],"description":"Payment ID unique identifier in VTEX."},"paymentSystem":{"type":["string","null"],"description":"Payment system ID."},"group":{"type":["string","null"],"description":"Payment system group."},"bin":{"type":["string","null"],"description":"Abbreviation for _Bank Identification Number_, which is a code that identifies the institution responsible for issuing the credit card."},"accountId":{"type":["string","null"],"description":"Store account ID."},"parentAccountId":{"type":["string","null"],"description":"Retrieves the main account ID if the payment was made in a subaccount."},"referenceValue":{"type":["integer","null"],"format":"int64","description":"Payment reference value in cents."},"value":{"type":["integer","null"],"format":"int64","description":"Payment value in cents."},"installments":{"type":["integer","null"],"description":"Number of installments."},"url":{"type":["string","null"],"description":"Payment URL."},"cardNumber":{"type":["string","null"],"description":"Card number information."},"fields":{"type":["array","null"],"description":"Payment parameters names and values.","items":{"type":"object","description":"Information about a given payment parameter.","properties":{"name":{"type":["string","null"],"description":"Payment parameter name."},"value":{"type":["string","null"],"description":"Payment parameter value."}}}},"paymentSystemName":{"type":["string","null"],"description":"Payment system name."}}}},"transactions":{"type":["array","null"],"description":"Financial transactions information. This array returns empty in the simulation.","items":{"type":["object","null"],"description":"Financial transactions details.","properties":{"isActive":{"type":["boolean","null"],"description":"Defines if the subscription order payment is active (`true`) or inactive (`false`)."}}}}}},"country":{"type":["string","null"],"description":"Subscription order simulation three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format."},"postalCode":{"type":["string","null"],"description":"Subscription order simulation postal code."},"messages":{"type":["array","null"],"description":"Simulation messages information.","items":{"type":["object","null"],"description":"Simulation message details.","properties":{"code":{"type":["string","null"],"description":"Message code."},"status":{"type":["string","null"],"description":"Message status."},"text":{"type":["string","null"],"description":"Message text."}}}},"selectableGifts":{"type":["array","null"],"description":"Information about subscription selectable gifts. For example, when the customer gains a gift from the store based on a promotion.","items":{"type":"object","description":"Selectable gift information.","properties":{"id":{"type":["string","null"],"description":"Selectable gift ID."},"availableQuantity":{"type":["integer","null"],"description":"Available quantity of selectable gifts."},"availableGifts":{"type":["array","null"],"description":"Details about available gifts.","items":{"type":["object","null"],"description":"Information about a given available gift.","properties":{"id":{"type":["string","null"],"description":"Gift ID."},"seller":{"type":["string","null"],"description":"Seller name."},"quantity":{"type":["integer","null"],"description":"Quantity of units."},"price":{"type":["integer","null"],"format":"int64","description":"Price in cents."},"sellingPrice":{"type":["integer","null"],"format":"int64","description":"Selling price in cents."},"unitMultiplier":{"type":["number","null"],"description":"Unit multiplier."},"attachments":{"type":["array","null"],"description":"Available gift attachments information, when applicable.","items":{"type":["object","null"],"description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Gift attachment name."},"content":{"type":["object","null"],"description":"Custom field for the gift attachment content.","additionalProperties":{"type":["string","null"],"description":"Custom field information."}}}}},"name":{"type":["string","null"],"description":"Gift name."},"isGift":{"type":["boolean","null"],"description":"Defines it the item is from a gift list (`true`), or not (`false`)."},"priceTags":{"type":["array","null"],"description":"List of price tags, which are price modifiers.","items":{"type":"object","description":"Information about a given price tag.","properties":{"name":{"type":["string","null"],"description":"Price tag name."},"valueAsInt":{"type":"integer","format":"int64","description":"Price tag value."},"rawValue":{"type":"number","format":"double","description":"Price tag raw value."},"isPercentual":{"type":"boolean","description":"Defines if the price tag is applied as a percentage (`true`), or not (`false`)."},"identifier":{"type":["string","null"],"description":"Price tag identifier."}}}},"isSelected":{"type":["boolean","null"],"description":"Defines if the item can be selected (`true`), or not (`false`)."}}}}}}},"totals":{"type":"array","description":"Information about simulation total counts.","items":{"type":"object","description":"Details about a given total count.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"name":{"type":"string","description":"Total count name."},"valueAsInt":{"type":"integer","format":"int64","description":"Total count value in cents."}}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}}}},"shippingEstimate":{"type":"object","description":"Subscription order shipping estimate information.","properties":{"name":{"type":"string","description":"ID of the shipping type (shipping method) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)."},"estimate":{"type":"string","description":"Total shipping estimate time in days. Three business days is represented as `3bd`, for example."},"estimateDeliveryDate":{"type":"string","description":"Estimate delivery date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"matched":{"type":"boolean","description":"Defines if the shipping estimate is matched (`true`), or not (`false`)."}}},"totalsBySimulationItems":{"type":"array","description":"Information about simulation totals regarding items.","items":{"type":"object","description":"Simulation information about an item.","properties":{"id":{"type":["string","null"],"description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units for the given SKU."},"unitPrice":{"type":["integer","null"],"format":"int64","description":"Unit price in cents."},"status":{"type":"string","description":"Subscription cycle status in the simulation."},"price":{"type":["integer","null"],"description":"Price in cents."},"sellingPrice":{"type":"integer","description":"Selling price in cents."},"manualPrice":{"type":["number","null"],"description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."}}}},"totals":{"type":"array","description":"Information about total counts.","items":{"type":"object","description":"Total cost per shipping or items.","properties":{"id":{"type":"string","description":"Code that identifies if the information is about items, discounts, shipping or taxes.","enum":["Items","Discounts","Shipping","Tax"]},"value":{"type":"number","description":"Total count value."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Simulates an order made by subscriptions on checkout and retrieves the current price for items and shipping. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "simulation": { + "items": [ + { + "id": "9", + "seller": "1", + "quantity": 1, + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null, + "unitMultiplier": 1, + "measurementUnit": "un", + "attachments": null, + "name": null, + "isGift": false, + "priceTags": [] + } + ], + "logisticsInfo": [ + { + "itemIndex": 0, + "quantity": 1, + "selectedSla": "Normal", + "selectedDeliveryChannel": "delivery", + "lockTTL": "1bd", + "shippingEstimate": null, + "addressId": "5028945524109", + "pickupId": null, + "price": 0, + "deliveryWindow": null, + "slas": [ + { + "id": "Normal", + "pickupPointId": null, + "deliveryChannel": "delivery", + "price": 500, + "shippingEstimate": "3bd", + "lockTTL": "1bd", + "deliveryWindows": [], + "availableDeliveryWindows": [] + } + ] + } + ], + "paymentData": { + "payments": [ + { + "id": null, + "paymentSystem": "6", + "group": null, + "bin": null, + "accountId": null, + "parentAccountId": null, + "referenceValue": 13460, + "value": 13460, + "installments": 1, + "url": null, + "cardNumber": null, + "fields": null, + "paymentSystemName": null + } + ], + "transactions": [] + }, + "country": null, + "postalCode": null, + "messages": [], + "selectableGifts": [], + "totals": [ + { + "id": "Items", + "name": "Items total", + "value": 12960 + }, + { + "id": "Shipping", + "name": "Shipping total", + "value": 500 + } + ], + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": null, + "sellingPrice": 12960, + "manualPrice": null + } + ] + }, + "shippingEstimate": { + "name": "Normal", + "estimate": "3bd", + "estimatedDeliveryDate": "2024-08-26T00:00:00Z", + "nextPurchaseDate": "2024-09-26T00:00:00Z", + "matched": true + }, + "totalsBySimulationItems": [ + { + "id": "9", + "quantity": 1, + "unitPrice": 12960, + "status": "OK", + "price": 12960, + "sellingPrice": 12960, + "manualPrice": null + } + ], + "totals": [ + { + "id": "Items", + "value": 12960 + }, + { + "id": "Shipping", + "value": 500 + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Create subscription.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Create subscription.yml new file mode 100644 index 0000000000..9f17900760 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Create subscription.yml @@ -0,0 +1,217 @@ +info: + name: Create subscription + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/rns/pub/subscriptions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "items": [ + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400, + "attachments": [ + { + "name": "Engraving", + "content": { + "laborum_bb": "Happy Birthday!", + "dolor_d": "Happy Birthday!" + } + }, + { + "name": "Engraving", + "content": { + "minima5": "Happy Birthday!", + "officia_b": "Happy Birthday!", + "dolore16e": "Happy Birthday!", + "aute785": "Happy Birthday!" + } + } + ] + }, + { + "skuId": "12", + "quantity": 5, + "manualPrice": 400, + "attachments": [ + { + "name": "Engraving", + "content": { + "exercitation41": "Happy Birthday!" + } + }, + { + "name": "Engraving", + "content": { + "ex_64f": "Happy Birthday!" + } + } + ] + } + ], + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "6559E125DB084A46994E045547DE504B", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "title": "fashionBasic", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "catalogAttachment": "vtex.subscription.tshirt-collection" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/rns/pub/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/rns/pub/subscriptions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/rns/pub/subscriptions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/rns/pub/subscriptions - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new subscription. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "id": "8B91E3077495AB982117AD0BA4A5829D", + "customerId": "c00a9529-806b-4ef3-a5f7-ed7846a66d3d", + "customerEmail": "customer@email.com", + "title": null, + "status": "PAUSED", + "isSkipped": false, + "nextPurchaseDate": "2024-09-21T15:53:27.0665798Z", + "lastPurchaseDate": "2024-08-21T15:53:27.0665798Z", + "plan": { + "id": "store.subscription.basic", + "frequency": { + "periodicity": "DAILY", + "interval": 1 + }, + "validity": { + "begin": "2024-09-21T15:53:27.0665798Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "6", + "installments": 1, + "paymentSystemName": "Bank Slips", + "paymentSystemGroup": "bankInvoice" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 0, + "createdAt": "2024-08-21T15:53:27.0665798Z", + "lastUpdate": "0001-01-01T00:00:00", + "items": [ + { + "id": "0F821B992DD848028E3A82C40DBCD834", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "cycleCount": 0, + "manualPrice": 736, + "attachments": null + } + ], + "lastCycleId": null, + "customData": {} + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Edit item from subscription.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Edit item from subscription.yml new file mode 100644 index 0000000000..2af16303a1 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Edit item from subscription.yml @@ -0,0 +1,162 @@ +info: + name: Edit item from subscription + type: http + seq: 6 + +http: + method: PATCH + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + - name: itemId + value: 0A6C01CA4582458A9CF8F61A9F6E1A68 + type: path + body: + type: json + data: |- + { + "status": "ACTIVE", + "isSkipped": false, + "quantity": 5, + "manualPrice": 400.3 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id/items/:itemId - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Edits an item from a given subscription. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `itemId` | path | (Required) ID of the subscription item being edited. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get conversation messages.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get conversation messages.yml new file mode 100644 index 0000000000..33d2036337 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get conversation messages.yml @@ -0,0 +1,115 @@ +info: + name: Get conversation messages + type: http + seq: 10 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions/:subscriptionId/conversation-message" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: subscriptionId + value: 123456789abc + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions/:subscriptionId/conversation-message - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Each message exchanged with the customer related to the subscription.","properties":{"id":{"type":"string","description":"Message ID."},"from":{"type":"object","description":"Information regarding the message sender.","properties":{"conversationRelatedTo":{"type":"string","description":"ID of the subscription related to the message."},"conversationSubject":{"type":"string","description":"Subject of the conversation."},"emailAlias":{"type":"string","description":"Email alias."},"aliasMaskType":{"type":"string","description":"Alias [mask type](https://help.vtex.com/en/tutorial/how-communication-with-the-client-is-made-during-the-order-flow--tutorials_195)."},"email":{"type":"string","description":"Sender email address."},"name":{"type":"string","description":"Sender name."},"role":{"type":["string","null"],"description":"Sender [role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc)."}}},"to":{"type":"array","description":"Information regarding the message receiver.","items":{"type":"object","description":"Message receiver details.","properties":{"conversationRelatedTo":{"type":"string","description":"ID of the subscription related to the message."},"conversationSubject":{"type":"string","description":"Subject of the conversation."},"emailAlias":{"type":"string","description":"Email alias."},"aliasMaskType":{"type":"string","description":"Alias [mask type](https://help.vtex.com/en/tutorial/how-communication-with-the-client-is-made-during-the-order-flow--tutorials_195)."},"email":{"type":"string","description":"Customer email address."},"name":{"type":"string","description":"Customer name."},"role":{"type":"string","description":"Role identification."}}}},"subject":{"type":"string","description":"Message subject."},"firstWords":{"type":"string","description":"First words of the message text."},"body":{"type":"string","description":"HTML content of the message's body."},"hasAttachment":{"type":"boolean","description":"Indicates if the message has [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) (`true`) or not (`false`)."},"attachmentNames":{"type":["array","null"],"description":"Attachment names.","items":{"type":["string","null"],"description":"Attachment name."}},"date":{"type":"string","description":"Message date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves all conversation messages sent to a customer regarding a subscription. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `subscriptionId` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "2024-07-25t22-01-08_80e67e10318d4a73a66dbfdb3d471cfb", + "from": { + "conversationRelatedTo": "875a3b36d02e17058ed46e5b0c50353c", + "conversationSubject": "rns", + "emailAlias": "a506b3df1b584381b2838447a44d0579@ct.vtex.com.br", + "aliasMaskType": "0", + "email": "noreply@vtexcommerce.com.br", + "name": "no reply", + "role": null + }, + "to": [ + { + "conversationRelatedTo": "875a3b36d02e17058ed46e5b0c50353c", + "conversationSubject": "rns", + "emailAlias": "dda23454991e4cfea71ca7beb4ec0aad@ct.vtex.com.br", + "aliasMaskType": "0", + "email": "sophia.smith@email.com", + "name": "Sophia Smith", + "role": "Customer" + } + ], + "subject": "Your subscription was confirmed", + "firstWords": "Hello, your subscription was successfully created! We will email you a confirmation after each order payment is approved.", + "body": " test
Próxima compra
25/12/2021
Entrega estimada
13/01/2022
************2503
!important; \" align=\"left\">

Atenciosamente,
Equipe CeA.

", + "hasAttachment": false, + "attachmentNames": [], + "date": "2024-07-25T22:01:25Z" + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get subscription details by ID.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get subscription details by ID.yml new file mode 100644 index 0000000000..9e9f94d3cd --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Get subscription details by ID.yml @@ -0,0 +1,149 @@ +info: + name: Get subscription details by ID + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: F35A8B497EA9E5A6D8F3778CBBA4C9E3 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about a subscription, searching by subscription ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/List subscriptions.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/List subscriptions.yml new file mode 100644 index 0000000000..d92e97830f --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/List subscriptions.yml @@ -0,0 +1,194 @@ +info: + name: List subscriptions + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/api/rns/pub/subscriptions" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: customerEmail + value: customer@email.com + type: query + disabled: true + - name: status + value: ACTIVE + type: query + disabled: true + - name: addressId + value: "5028945524109" + type: query + disabled: true + - name: paymentId + value: 807E03E56A844BE2B1727B752E19C828 + type: query + disabled: true + - name: planId + value: store.subscription.basic + type: query + disabled: true + - name: nextPurchaseDate + value: 2024-10-30 + type: query + disabled: true + - name: originalOrderId + value: 1421091661214-01 + type: query + disabled: true + - name: page + value: "3" + type: query + disabled: true + - name: size + value: "10" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/rns/pub/subscriptions - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/rns/pub/subscriptions - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/rns/pub/subscriptions - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/rns/pub/subscriptions - Schema is valid", function () { + const schema = {"type":"array","items":{"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Lists subscriptions from your store. By default, this request uses the query parameter `page` = `1`, and `size` = `15`. If you wish, you can use different values for query parameters. + + >⚠️ Each response is limited to 15 results. You can get different values by combining pagination query parameters. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view only** | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `customerEmail` | query | Email of a customer that subscrived to your store. | + | `status` | query | Subscription status. The acceptable values are: - ACTIVE - PAUSED - CANCELED - EXPIRED - MISSING | + | `addressId` | query | Subscription shipping address ID. | + | `paymentId` | query | [Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) ID. It corresponds to the `paymentAccountId` field. | + | `planId` | query | [Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) ID. | + | `nextPurchaseDate` | query | Subscription next purchase date in the format `YYYY-MM-DD`. | + | `originalOrderId` | query | Order ID of when the customer subscribed. | + | `page` | query | Number of the starting page of the response. When no value is sent, it starts in page `1`. | + | `size` | query | Determines the number of subscriptions in the response. The maximum is equal to the default value, which is `15`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + [ + { + "id": "F35A8B497EA9E5A6D8F3778CBBA4C9E3", + "customerId": "5aff33ec-5302-4580-a4ed-be9aa32ba3db", + "customerEmail": "customer@email.com", + "title": null, + "status": "ACTIVE", + "isSkipped": false, + "nextPurchaseDate": "2024-08-21T12:00:00Z", + "lastPurchaseDate": "2024-08-19T00:00:00Z", + "plan": { + "id": "store.subscription.ana-plan", + "frequency": { + "periodicity": "DAILY", + "interval": 2 + }, + "validity": { + "begin": "2024-08-01T00:00:00Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "2", + "installments": 1, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 9, + "createdAt": "2024-08-01T12:31:55.7308301Z", + "lastUpdate": "2024-08-19T12:16:51.0237801Z", + "items": [ + { + "id": "0213AB4188FE4007A865AD33D972FA37", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "originalOrderId": "1451256157912-01", + "cycleCount": 9, + "priceAtSubscriptionDate": 736, + "manualPrice": 736, + "attachments": [ + { + "name": "printMessage", + "content": { + "printMessage": "Hello" + } + } + ] + } + ], + "lastCycleId": "F35A8B497EA9E5A6D8F3778CBBA4C9E3-20240819", + "customData": null + } + ] + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Remove item from subscription.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Remove item from subscription.yml new file mode 100644 index 0000000000..7281f6e2c7 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Remove item from subscription.yml @@ -0,0 +1,65 @@ +info: + name: Remove item from subscription + type: http + seq: 5 + +http: + method: DELETE + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id/items/:itemId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 8700734451ED4FD4955697873BEC51C3 + type: path + - name: itemId + value: 0A6C01CA4582458A9CF8F61A9F6E1A68 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/rns/pub/subscriptions/:id/items/:itemId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/rns/pub/subscriptions/:id/items/:itemId - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes an item from a given subscription. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `itemId` | path | (Required) Subscription item ID of the SKU being removed from the subscription. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Update subscription by ID.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Update subscription by ID.yml new file mode 100644 index 0000000000..63c11736e2 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/Update subscription by ID.yml @@ -0,0 +1,178 @@ +info: + name: Update subscription by ID + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/rns/pub/subscriptions/:id" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: id + value: 1E7886FC8E45FF38C527897D749584F4 + type: path + body: + type: json + data: |- + { + "customerEmail": "customer@email.com", + "title": "catFood", + "status": "ACTIVE", + "nextPurchaseDate": "2024-09-21T00:00:00Z", + "isSkipped": false, + "plan": { + "id": "subscription.clothes", + "frequency": { + "interval": 3, + "periodicity": "MONTHLY" + }, + "validity": { + "begin": "2024-08-21T00:00:00Z", + "end": "2025-08-21T00:00:00Z" + }, + "purchaseDay": "3" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentSystem": "4", + "paymentAccountId": "6559E125DB084A46994E045547DE504B", + "installments": 3, + "paymentSystemName": "creditCard", + "paymentSystemGroup": "creditCard" + }, + "salesChannel": "1", + "currencyCode": "BRL", + "selectedSla": "Normal", + "seller": "1" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/rns/pub/subscriptions/:id - Schema is valid", function () { + const schema = {"type":"object","description":"Information about a given subscription.","required":["createdAt","customerEmail","customerId","cycleCount","id","isSkipped","items","lastUpdate","nextPurchaseDate","plan","purchaseSettings","shippingAddress","status"],"properties":{"id":{"type":"string","description":"[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID."},"customerId":{"type":"string","description":"Customer ID."},"customerEmail":{"type":"string","description":"Customer email."},"title":{"type":["string","null"],"description":"Subscription title."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)."},"nextPurchaseDate":{"type":"string","description":"Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastPurchaseDate":{"type":["string","null"],"description":"Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"plan":{"type":"object","description":"[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.","required":["frequency","id","purchaseDay","validity"],"properties":{"id":{"type":["string","null"],"description":"Subscription plan ID."},"frequency":{"type":"object","description":"Subscription plan frequency.","required":["interval","periodicity"],"properties":{"periodicity":{"type":["string","null"],"description":"Plan repurchase frequency, defines the subscription recurrence.","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"]},"interval":{"type":"integer","description":"Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on."}}},"validity":{"type":"object","description":"Information about the period during which the subscription plan will be valid.","required":["begin"],"properties":{"begin":{"type":"string","description":"Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"end":{"type":["string","null"],"description":"Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."}}},"purchaseDay":{"type":"string","description":"Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`."}}},"shippingAddress":{"type":"object","description":"Information about the subscription shipping address.","required":["addressId","addressType"],"properties":{"addressId":{"type":"string","description":"Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type."},"addressType":{"type":"string","description":"Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.","enum":["residential","pickup"]}}},"purchaseSettings":{"type":"object","description":"Object with purchase information.","required":["currencyCode","paymentMethod"],"properties":{"paymentMethod":{"type":"object","description":"[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.","required":["paymentSystem"],"properties":{"paymentAccountId":{"type":["string","null"],"description":"Payment account ID."},"paymentSystem":{"type":"string","description":"Payment system ID."},"installments":{"type":"integer","description":"Number of installments."},"paymentSystemName":{"type":"string","description":"Payment system name."},"paymentSystemGroup":{"type":"string","description":"Payment system group."}}},"currencyCode":{"type":"string","description":"Currency code in [ISO 4217](https://www.iban.com/currency-codes) format."},"selectedSla":{"type":"string","description":"Selected Service Level Agreement (SLA)."},"salesChannel":{"type":"string","description":"Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase."},"seller":{"type":"string","description":"Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1."}}},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"createdAt":{"type":"string","description":"Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":["string","null"],"description":"Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"items":{"type":"array","description":"Information about subscription items.","items":{"type":"object","description":"Information about a given subscription item.","required":["id","isSkipped","quantity","skuId","status"],"properties":{"id":{"type":"string","description":"Subscription item ID."},"skuId":{"type":"string","description":"SKU ID."},"quantity":{"type":"integer","description":"Quantity of units."},"isSkipped":{"type":"boolean","description":"Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)."},"status":{"type":"string","description":"Subscription status.","enum":["ACTIVE","PAUSED","CANCELED","EXPIRED","MISSING"]},"originalOrderId":{"type":"string","description":"Subscription original order ID."},"cycleCount":{"type":"integer","description":"The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on."},"priceAtSubscriptionDate":{"type":"number","description":"Price at subscription date."},"manualPrice":{"type":"number","description":"[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)."},"attachments":{"type":["array","null"],"description":"Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).","items":{"type":"object","description":"Information about a given attachment.","properties":{"name":{"type":["string","null"],"description":"Attachment name."},"content":{"type":["object","null"],"description":"Custom field for attachment content.","additionalProperties":{"type":"string","description":"Custom field information."}}}}}}}},"lastCycleId":{"type":["string","null"],"description":"Last subscription cycle ID."},"customData":{"type":["object","null"],"description":"Customizable fields created by the store for the shopping cart. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt.","properties":{"customApps":{"type":["array","null"],"description":"Customizable apps created by the store.","items":{"type":["string","null"],"description":"Customizable apps details."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates a subscription, searching by subscription ID. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Subscriptions | ApplicationAccess | **Subscription view and edit** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `id` | path | (Required) [Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "8B91E3077495AB982117AD0BA4A5829D", + "customerId": "c00a9529-806b-4ef3-a5f7-ed7846a66d3d", + "customerEmail": "customer@email.com", + "title": null, + "status": "PAUSED", + "isSkipped": false, + "nextPurchaseDate": "2024-09-21T15:53:27.0665798Z", + "lastPurchaseDate": "2024-08-21T15:53:27.0665798Z", + "plan": { + "id": "store.subscription.basic", + "frequency": { + "periodicity": "DAILY", + "interval": 1 + }, + "validity": { + "begin": "2024-09-21T15:53:27.0665798Z", + "end": null + }, + "purchaseDay": "Not_Applicable" + }, + "shippingAddress": { + "addressId": "5028945524109", + "addressType": "residential" + }, + "purchaseSettings": { + "paymentMethod": { + "paymentAccountId": "B2BBDD0F2E4B47FC9E48D2DA99C318EF", + "paymentSystem": "6", + "installments": 1, + "paymentSystemName": "Bank Slips", + "paymentSystemGroup": "bankInvoice" + }, + "currencyCode": "BRL", + "selectedSla": "Normal", + "salesChannel": "1", + "seller": "1" + }, + "cycleCount": 0, + "createdAt": "2024-08-21T15:53:27.0665798Z", + "lastUpdate": "0001-01-01T00:00:00", + "items": [ + { + "id": "0F821B992DD848028E3A82C40DBCD834", + "skuId": "9", + "quantity": 1, + "isSkipped": false, + "status": "ACTIVE", + "cycleCount": 0, + "manualPrice": 736, + "attachments": null + } + ], + "lastCycleId": null, + "customData": {} + } + ``` diff --git a/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/folder.yml b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/folder.yml new file mode 100644 index 0000000000..e371f87443 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/Subscriptions/folder.yml @@ -0,0 +1,4 @@ +info: + name: Subscriptions + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - Subscriptions API v3/environments/VTEX.yml b/BrunoCollections/VTEX - Subscriptions API v3/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Subscriptions API v3/opencollection.yml b/BrunoCollections/VTEX - Subscriptions API v3/opencollection.yml new file mode 100644 index 0000000000..64d086dd7c --- /dev/null +++ b/BrunoCollections/VTEX - Subscriptions API v3/opencollection.yml @@ -0,0 +1,32 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Subscriptions API v3 + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [Subscriptions](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) is the VTEX solution for customers to make recurrent purchases at your store on a regular schedule. When customers subscribe, they define what products they want to acquire regularly and at what frequency they want these automatic orders to be created. For more information, see [Subscriptions onboarding guide](https://developers.vtex.com/docs/guides/subscriptions). + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Template openAPI/environments/VTEX.yml b/BrunoCollections/VTEX - Template openAPI/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - Template openAPI/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - Template openAPI/opencollection.yml b/BrunoCollections/VTEX - Template openAPI/opencollection.yml new file mode 100644 index 0000000000..af61e2e9cf --- /dev/null +++ b/BrunoCollections/VTEX - Template openAPI/opencollection.yml @@ -0,0 +1,21 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Template openAPI + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: "{api-description}" + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - Template openAPI/undefined/folder.yml b/BrunoCollections/VTEX - Template openAPI/undefined/folder.yml new file mode 100644 index 0000000000..c2f791c236 --- /dev/null +++ b/BrunoCollections/VTEX - Template openAPI/undefined/folder.yml @@ -0,0 +1,4 @@ +info: + name: undefined + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Tracking/Authentication/Asynchronous login.yml b/BrunoCollections/VTEX - Tracking/Authentication/Asynchronous login.yml new file mode 100644 index 0000000000..8e61688e1d --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Authentication/Asynchronous login.yml @@ -0,0 +1,84 @@ +info: + name: Asynchronous login + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/auth" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "username": "clientUserName", + "password": "32gv34fs" + } + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/auth - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/auth - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/auth - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/auth - Schema is valid", function () { + const schema = {"type":"object","properties":{"authenticated":{"type":"boolean","description":"If the authentication was successful (`true`) or not (`false`)."},"created":{"type":"string","description":"Creation date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"expiration":{"type":"string","description":"Expiration date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"accessToken":{"type":"string","description":"Acess token."},"message":{"type":"string","description":"Authentication message."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint permits the user to acquire the mandatory authentication to access the [VTEX Tracking](https://help.vtex.com/en/tutorial/vtex-tracking-overview--1uDRquVudbPuoK05MtbZGh) endpoints. + > There is a single version of VTEX Tracking API, so it is no longer necessary to specify the version on the URL, as explained in this [release note](https://developers.vtex.com/updates/release-notes/vtex-tracking-api-changes-in-all-paths). The previous routes were not deprecated and can still be used, and if there is a breaking change, it will be informed. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authenticated": true, + "created": "2024-04-11T09:14:41.3695207Z", + "expiration": "2024-05-11T09:14:41.3695207Z", + "accessToken": "32985745", + "message": "Authenticated" + } + ``` diff --git a/BrunoCollections/VTEX - Tracking/Authentication/folder.yml b/BrunoCollections/VTEX - Tracking/Authentication/folder.yml new file mode 100644 index 0000000000..3f929f49d6 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by ID.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by ID.yml new file mode 100644 index 0000000000..f33949f4be --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by ID.yml @@ -0,0 +1,77 @@ +info: + name: Get delivery service by ID + type: http + seq: 4 + +http: + method: GET + url: "{{baseUrl}}/services/:idDeliveryService" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: idDeliveryService + value: "1" + type: path + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/services/:idDeliveryService - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/services/:idDeliveryService - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/services/:idDeliveryService - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/services/:idDeliveryService - Schema is valid", function () { + const schema = {"type":"object","description":"Delivery service response.","properties":{"pictures":{"type":"array","description":"Pictures array.","items":{"type":"string","description":"Picture URL."}},"idDeliveryService":{"type":"integer","format":"int32","description":"ID of the delivery service."},"deliveryServiceType":{"type":"object","description":"Delivery service type information.","properties":{"description":{"type":"string","description":"Description of the delivery service type."}}},"deliveryServiceStatus":{"type":"object","description":"Delivery service status information.","properties":{"description":{"type":"string","description":"Description of the delivery service status."}}},"shipper":{"type":"object","description":"Shipper information.","properties":{"companyName":{"type":"string","description":"Shipper company name."}}},"shipperCustomer":{"type":"object","description":"Shipper customer information.","properties":{"idShipperCustomer":{"type":"integer","format":"int32","description":"Unique identifier for the shipper customer."},"email":{"type":"string","description":"Email address of the shipper customer."},"firstName":{"type":"string","description":"First name of the shipper customer."},"lastName":{"type":"string","description":"Last name of the shipper customer."},"cpf":{"type":"string","description":"CPF number of the shipper customer."},"addressStreet":{"type":"string","description":"Street of the shipper customer address."},"addressNumber":{"type":"string","description":"Address number of the shipper customer."},"addressComplement":{"type":"string","description":"Address complement of the shipper customer."},"addressNeighborhood":{"type":"string","description":"Neighborhood of the shipper customer's address."},"addressCity":{"type":"string","description":"City of the shipper customer's address."},"postalCode":{"type":"string","description":"Postal code of the shipper customer's address."},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"created":{"type":"string","format":"date-time","description":"Date and time when the shipper customer record was created."},"companyName":{"type":"string","description":"Company name of the shipper customer."},"cnpj":{"type":"string","description":"CNPJ number of the shipper customer."},"legalType":{"type":["object","null"],"description":"Legal type information.","properties":{"description":{"type":"string","description":"Description of the legal type of the shipper customer."}}},"idExternalShipperCustomer":{"type":["string","null"],"description":"External identifier for the shipper customer."},"phoneAreaCode":{"type":"string","description":"Area code for the shipper customer's phone number."},"phoneNumber":{"type":"string","description":"Phone number of the shipper customer."}}},"carrier":{"type":"object","description":"Carrier information.","properties":{"username":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the username of the carrier."},"firstName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the first name of the carrier."},"lastName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the last name of the carrier."},"cpf":{"maxLength":14,"minLength":0,"type":"string","description":"A string representing the Brazilian CPF number of the carrier."},"email":{"maxLength":254,"minLength":0,"type":"string","description":"A string representing the email address of the carrier."},"cnpjtransportCompany":{"type":"string","description":"A string representing the CNPJ number of the transport company associated with the carrier."},"mobileAreaCode":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the area code for the carrier's mobile phone."},"mobile":{"maxLength":10,"minLength":0,"type":"string","description":"The carrier's mobile phone number."},"phoneAreaCode":{"maxLength":3,"minLength":0,"type":"string","description":"Area code for the carrier's landline phone."},"phone":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the carrier's landline phone number."},"created":{"type":"string","format":"date-time","description":"Date and time when the carrier record was created."},"idExternalCarrier":{"maxLength":30,"minLength":0,"type":"string","description":"External identifier for the carrier."},"isCarrierAppOnline":{"type":"boolean","description":"A boolean indicating whether the carrier is currently online in the carrier application."},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"rg":{"maxLength":12,"minLength":0,"type":"string","description":"A string representing the Brazilian RG number of the carrier."}}},"displacementType":{"type":"object","description":"Displacement type information.","properties":{"description":{"type":"string","description":"Displacement type description."},"vehicleType":{"type":"object","description":"Vehicle type information.","properties":{"description":{"type":"string","description":"Description of the vehicle type."}}}}},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"nonDeliveryReason":{"type":"object","description":"Information about the reason for non-delivery.","properties":{"description":{"type":"string","description":"A description explaining the reason for non-delivery."}}},"shipperPartner":{"type":"object","description":"Shipper partner information.","properties":{"cnpj":{"type":"string","description":"The CNPJ number of the Shipper partner."},"name":{"type":"string","description":"Shipper partner name."}}},"shipperBranch":{"type":"object","description":"Shipper branch information.","properties":{"shipperType":{"type":"object","description":"Shipper type information.","properties":{"description":{"type":"string","description":"Description of the type of shipper."}}},"companyName":{"type":"string","description":"The name of the shipping company branch."},"trade":{"type":"string","description":"The trade or industry in which the shipping company operates."},"cnpj":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the shipping company branch."},"companyContact":{"type":"string","description":"The primary contact person's name at the shipping company branch."},"telephoneArea":{"type":"string","description":"The area code for the shipping company branch's telephone number."},"telephone":{"type":"string","description":"The telephone number of the shipping company branch."},"mobileArea":{"type":"string","description":"The area code for the shipping company branch's mobile number."},"mobile":{"type":"string","description":"The mobile number of the shipping company branch."},"email":{"type":"string","description":"The email address of the shipping company branch."}}},"freightPrice":{"type":"object","description":"Freight price information.","properties":{"description":{"type":"string","description":"Description of the freight price details."},"firstPostalCodeInterval":{"type":"string","description":"The starting range of postal codes for which the freight price applies."},"secondPostalCodeInterval":{"type":"string","description":"The ending range of postal codes for which the freight price applies."},"price":{"type":"number","description":"The price charged for the freight service."},"created":{"type":"string","format":"date-time","description":"The date and time when the freight price was created."}}},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"invoiceOrderOfService":{"type":"string","description":"The invoice order number for the service."},"description":{"type":"string","description":"Delivery service description."},"addressStreet":{"type":"string","description":"The street address for the delivery."},"addressNumber":{"type":"string","description":"The number of the building or house for the delivery address."},"addressComplement":{"type":"string","description":"Additional address details, such as apartment or suite number."},"addressNeighborhood":{"type":"string","description":"The neighborhood of the delivery address."},"addressCity":{"type":"string","description":"The city of the delivery address."},"postalCode":{"type":"string","description":"The postal code of the delivery address."},"estimateDeliveryHour":{"type":"string","format":"date-time","description":"The estimated delivery time and date."},"created":{"type":"string","format":"date-time","description":"The date and time when the delivery service was created."},"initialEstimateDeliveryHour":{"type":"string","format":"date-time","description":"The initially estimated delivery time and date."},"deliveryDateTime":{"type":"string","format":"date-time","description":"Date and time of delivery."},"estimateDeliveryDistance":{"type":"integer","format":"int32","description":"Delivery service esimate distance."},"travelledDeliveryDistance":{"type":"integer","format":"int32","description":"The total distance traveled for the delivery, measured in kilometers."},"orderNumber":{"type":"string","description":"The unique number associated with the order."},"cteNumber":{"type":"string","description":"The number of the CTE (Conhecimento de Transporte Eletrônico), an electronic transport document used in Brazil."},"cteDate":{"type":"string","format":"date-time","description":"The date and time when the CTE was issued."},"sender":{"type":"string","description":"The name of the sender of the delivery."},"senderCity":{"type":"string","description":"The city from which the delivery was sent."},"senderState":{"type":"integer","format":"int32","description":"The state code from which the delivery was sent."},"weight":{"type":"number","description":"The weight of the delivery item in kilograms."},"cubicMeter":{"type":"number","description":"The volume of the delivery item in cubic meters."},"cubicMeterWeight":{"type":"number","description":"The weight of the delivery item calculated based on its volume."},"value":{"type":"number","description":"The monetary value of the delivery item."},"freightPriceReceived":{"type":"number","description":"The amount received for the freight service."},"deliveryAttempts":{"type":"integer","format":"int32","description":"The number of attempts made to deliver the item."},"serviceTime":{"type":"integer","format":"int32","description":"The time spent on the delivery service, measured in minutes."},"invoiceOrderOfServiceSerie":{"type":"string","description":"The series of the invoice order of service."},"leadTime":{"type":"string","format":"date-time","description":"The lead time for the delivery, calculated from the order date to the delivery date."},"cnpjcarrier":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the carrier company."},"cnpjbranch":{"type":"string","description":"The CNPJ number of the branch of the carrier company."},"idExternal":{"type":"string","description":"External ID of the delivery service."},"billingInfo":{"type":"array","description":"Billing information array.","items":{"type":"object","description":"Billing information.","properties":{"receivableAmount":{"type":"number","description":"The total amount receivable for the billing item."},"money":{"type":"number","description":"The amount received in cash."},"cheque":{"type":"number","description":"The amount received via cheque."},"creditCard":{"type":"number","description":"The amount received via credit card."},"webComment":{"type":"string","description":"Comments or notes made via the web interface regarding the billing item."},"carrierComment":{"type":"string","description":"Comments or notes made by the carrier regarding the billing item."},"billingConfirmDate":{"type":"string","format":"date-time","description":"The date and time when the billing was confirmed."},"created":{"type":"string","format":"date-time","description":"The date and time when the billing item was created."}}}},"deliveryServiceRouteItem":{"type":"array","description":"Array in which each item corresponds to a delivery service route.","items":{"type":"object","description":"Delivery service route information.","properties":{"idDeliveryServiceRouteItem":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route item."},"deliveryServiceRoute":{"description":"Delivery service route.","type":"object","properties":{"idDeliveryServiceRoute":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route."},"deliveryServiceRouteStatus":{"type":"object","description":"Delivery service route status.","properties":{"description":{"type":"string","description":"Delivery service route status response description."}}},"deliveryServiceDate":{"type":"string","format":"date-time","description":"Date and time of the delivery service."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route was created."},"startWorkDayDateTime":{"type":"string","format":"date-time","description":"Start date and time of the workday."},"finishWorkDayDateTime":{"type":"string","format":"date-time","description":"Finish date and time of the workday."},"itinerantDate":{"type":"string","format":"date-time","description":"Date and time of the itinerant delivery service."}}},"deliveryServiceRouteItemStatus":{"type":"object","description":"Delivery service route item status.","properties":{"description":{"type":"string","description":"Description of the delivery service route item status."}}},"nonDeliveryDescription":{"type":"string","description":"Description of why the delivery was not completed."},"index":{"type":"integer","format":"int32","description":"Index of the delivery service route item."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route item was created."},"startDisplacementDateTime":{"type":"string","format":"date-time","description":"Start date and time of the displacement."},"startDisplacementLatitude":{"type":"number","description":"Latitude at the start of the displacement."},"startDisplacementLongitude":{"type":"number","description":"Longitude at the start of the displacement."},"finishedDisplacementLatitude":{"type":"number","description":"Latitude at the end of the displacement."},"finishedDisplacementLongitude":{"type":"number","description":"Longitude at the end of the displacement."},"receiverName":{"type":"string","description":"Name of the person receiving the delivery."},"receiverDocument":{"type":"string","description":"Document or identification of the receiver."},"description":{"type":"string","description":"Description of the delivery service route item."},"deliveryArrived":{"type":"string","format":"date-time","description":"Date and time when the delivery arrived."},"comment":{"type":"string","description":"Additional comments about the delivery service route item."},"rating":{"type":"integer","format":"int32","description":"Rating given to the delivery service."},"pauseDisplacementDateTime":{"type":"string","format":"date-time","description":"Date and time when the displacement was paused."},"deliveryLeft":{"type":"string","format":"date-time","description":"Date and time when the delivery was left or completed."},"deliveryReason":{"type":"object","description":"Delivery reason.","properties":{"description":{"type":"string","description":"Description of the reason for the delivery."}}}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a specific Service's general information by searching through its ID. + > We strongly recommend that a call to a VTEX Tracking GET endpoint is made only once every 6 hours. Retrieving data from the same endpoint more than once during a 6-hour window represents a load to our API that will slow down the overall usage of systems. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `idDeliveryService` | path | (Required) The delivery service's unique identifier. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `Success` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by invoice.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by invoice.yml new file mode 100644 index 0000000000..5f72b1238d --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery service by invoice.yml @@ -0,0 +1,78 @@ +info: + name: Get delivery service by invoice + type: http + seq: 7 + +http: + method: GET + url: "{{baseUrl}}/services/invoice" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: invoice + value: "24382" + type: query + disabled: true + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/services/invoice - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/services/invoice - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/services/invoice - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/services/invoice - Schema is valid", function () { + const schema = {"description":"Paginated delivery service response.","type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Number of the page that was returned."},"pageSize":{"type":"integer","format":"int32","description":"Number of items per returned page."},"totalCount":{"type":"integer","format":"int32","description":"Total number of pages given the page size and total results."},"data":{"type":"array","items":{"type":"object","description":"Delivery service response.","properties":{"pictures":{"type":"array","description":"Pictures array.","items":{"type":"string","description":"Picture URL."}},"idDeliveryService":{"type":"integer","format":"int32","description":"ID of the delivery service."},"deliveryServiceType":{"type":"object","description":"Delivery service type information.","properties":{"description":{"type":"string","description":"Description of the delivery service type."}}},"deliveryServiceStatus":{"type":"object","description":"Delivery service status information.","properties":{"description":{"type":"string","description":"Description of the delivery service status."}}},"shipper":{"type":"object","description":"Shipper information.","properties":{"companyName":{"type":"string","description":"Shipper company name."}}},"shipperCustomer":{"type":"object","description":"Shipper customer information.","properties":{"idShipperCustomer":{"type":"integer","format":"int32","description":"Unique identifier for the shipper customer."},"email":{"type":"string","description":"Email address of the shipper customer."},"firstName":{"type":"string","description":"First name of the shipper customer."},"lastName":{"type":"string","description":"Last name of the shipper customer."},"cpf":{"type":"string","description":"CPF number of the shipper customer."},"addressStreet":{"type":"string","description":"Street of the shipper customer address."},"addressNumber":{"type":"string","description":"Address number of the shipper customer."},"addressComplement":{"type":"string","description":"Address complement of the shipper customer."},"addressNeighborhood":{"type":"string","description":"Neighborhood of the shipper customer's address."},"addressCity":{"type":"string","description":"City of the shipper customer's address."},"postalCode":{"type":"string","description":"Postal code of the shipper customer's address."},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"created":{"type":"string","format":"date-time","description":"Date and time when the shipper customer record was created."},"companyName":{"type":"string","description":"Company name of the shipper customer."},"cnpj":{"type":"string","description":"CNPJ number of the shipper customer."},"legalType":{"type":["object","null"],"description":"Legal type information.","properties":{"description":{"type":"string","description":"Description of the legal type of the shipper customer."}}},"idExternalShipperCustomer":{"type":["string","null"],"description":"External identifier for the shipper customer."},"phoneAreaCode":{"type":"string","description":"Area code for the shipper customer's phone number."},"phoneNumber":{"type":"string","description":"Phone number of the shipper customer."}}},"carrier":{"type":"object","description":"Carrier information.","properties":{"username":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the username of the carrier."},"firstName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the first name of the carrier."},"lastName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the last name of the carrier."},"cpf":{"maxLength":14,"minLength":0,"type":"string","description":"A string representing the Brazilian CPF number of the carrier."},"email":{"maxLength":254,"minLength":0,"type":"string","description":"A string representing the email address of the carrier."},"cnpjtransportCompany":{"type":"string","description":"A string representing the CNPJ number of the transport company associated with the carrier."},"mobileAreaCode":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the area code for the carrier's mobile phone."},"mobile":{"maxLength":10,"minLength":0,"type":"string","description":"The carrier's mobile phone number."},"phoneAreaCode":{"maxLength":3,"minLength":0,"type":"string","description":"Area code for the carrier's landline phone."},"phone":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the carrier's landline phone number."},"created":{"type":"string","format":"date-time","description":"Date and time when the carrier record was created."},"idExternalCarrier":{"maxLength":30,"minLength":0,"type":"string","description":"External identifier for the carrier."},"isCarrierAppOnline":{"type":"boolean","description":"A boolean indicating whether the carrier is currently online in the carrier application."},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"rg":{"maxLength":12,"minLength":0,"type":"string","description":"A string representing the Brazilian RG number of the carrier."}}},"displacementType":{"type":"object","description":"Displacement type information.","properties":{"description":{"type":"string","description":"Displacement type description."},"vehicleType":{"type":"object","description":"Vehicle type information.","properties":{"description":{"type":"string","description":"Description of the vehicle type."}}}}},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"nonDeliveryReason":{"type":"object","description":"Information about the reason for non-delivery.","properties":{"description":{"type":"string","description":"A description explaining the reason for non-delivery."}}},"shipperPartner":{"type":"object","description":"Shipper partner information.","properties":{"cnpj":{"type":"string","description":"The CNPJ number of the Shipper partner."},"name":{"type":"string","description":"Shipper partner name."}}},"shipperBranch":{"type":"object","description":"Shipper branch information.","properties":{"shipperType":{"type":"object","description":"Shipper type information.","properties":{"description":{"type":"string","description":"Description of the type of shipper."}}},"companyName":{"type":"string","description":"The name of the shipping company branch."},"trade":{"type":"string","description":"The trade or industry in which the shipping company operates."},"cnpj":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the shipping company branch."},"companyContact":{"type":"string","description":"The primary contact person's name at the shipping company branch."},"telephoneArea":{"type":"string","description":"The area code for the shipping company branch's telephone number."},"telephone":{"type":"string","description":"The telephone number of the shipping company branch."},"mobileArea":{"type":"string","description":"The area code for the shipping company branch's mobile number."},"mobile":{"type":"string","description":"The mobile number of the shipping company branch."},"email":{"type":"string","description":"The email address of the shipping company branch."}}},"freightPrice":{"type":"object","description":"Freight price information.","properties":{"description":{"type":"string","description":"Description of the freight price details."},"firstPostalCodeInterval":{"type":"string","description":"The starting range of postal codes for which the freight price applies."},"secondPostalCodeInterval":{"type":"string","description":"The ending range of postal codes for which the freight price applies."},"price":{"type":"number","description":"The price charged for the freight service."},"created":{"type":"string","format":"date-time","description":"The date and time when the freight price was created."}}},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"invoiceOrderOfService":{"type":"string","description":"The invoice order number for the service."},"description":{"type":"string","description":"Delivery service description."},"addressStreet":{"type":"string","description":"The street address for the delivery."},"addressNumber":{"type":"string","description":"The number of the building or house for the delivery address."},"addressComplement":{"type":"string","description":"Additional address details, such as apartment or suite number."},"addressNeighborhood":{"type":"string","description":"The neighborhood of the delivery address."},"addressCity":{"type":"string","description":"The city of the delivery address."},"postalCode":{"type":"string","description":"The postal code of the delivery address."},"estimateDeliveryHour":{"type":"string","format":"date-time","description":"The estimated delivery time and date."},"created":{"type":"string","format":"date-time","description":"The date and time when the delivery service was created."},"initialEstimateDeliveryHour":{"type":"string","format":"date-time","description":"The initially estimated delivery time and date."},"deliveryDateTime":{"type":"string","format":"date-time","description":"Date and time of delivery."},"estimateDeliveryDistance":{"type":"integer","format":"int32","description":"Delivery service esimate distance."},"travelledDeliveryDistance":{"type":"integer","format":"int32","description":"The total distance traveled for the delivery, measured in kilometers."},"orderNumber":{"type":"string","description":"The unique number associated with the order."},"cteNumber":{"type":"string","description":"The number of the CTE (Conhecimento de Transporte Eletrônico), an electronic transport document used in Brazil."},"cteDate":{"type":"string","format":"date-time","description":"The date and time when the CTE was issued."},"sender":{"type":"string","description":"The name of the sender of the delivery."},"senderCity":{"type":"string","description":"The city from which the delivery was sent."},"senderState":{"type":"integer","format":"int32","description":"The state code from which the delivery was sent."},"weight":{"type":"number","description":"The weight of the delivery item in kilograms."},"cubicMeter":{"type":"number","description":"The volume of the delivery item in cubic meters."},"cubicMeterWeight":{"type":"number","description":"The weight of the delivery item calculated based on its volume."},"value":{"type":"number","description":"The monetary value of the delivery item."},"freightPriceReceived":{"type":"number","description":"The amount received for the freight service."},"deliveryAttempts":{"type":"integer","format":"int32","description":"The number of attempts made to deliver the item."},"serviceTime":{"type":"integer","format":"int32","description":"The time spent on the delivery service, measured in minutes."},"invoiceOrderOfServiceSerie":{"type":"string","description":"The series of the invoice order of service."},"leadTime":{"type":"string","format":"date-time","description":"The lead time for the delivery, calculated from the order date to the delivery date."},"cnpjcarrier":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the carrier company."},"cnpjbranch":{"type":"string","description":"The CNPJ number of the branch of the carrier company."},"idExternal":{"type":"string","description":"External ID of the delivery service."},"billingInfo":{"type":"array","description":"Billing information array.","items":{"type":"object","description":"Billing information.","properties":{"receivableAmount":{"type":"number","description":"The total amount receivable for the billing item."},"money":{"type":"number","description":"The amount received in cash."},"cheque":{"type":"number","description":"The amount received via cheque."},"creditCard":{"type":"number","description":"The amount received via credit card."},"webComment":{"type":"string","description":"Comments or notes made via the web interface regarding the billing item."},"carrierComment":{"type":"string","description":"Comments or notes made by the carrier regarding the billing item."},"billingConfirmDate":{"type":"string","format":"date-time","description":"The date and time when the billing was confirmed."},"created":{"type":"string","format":"date-time","description":"The date and time when the billing item was created."}}}},"deliveryServiceRouteItem":{"type":"array","description":"Array in which each item corresponds to a delivery service route.","items":{"type":"object","description":"Delivery service route information.","properties":{"idDeliveryServiceRouteItem":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route item."},"deliveryServiceRoute":{"description":"Delivery service route.","type":"object","properties":{"idDeliveryServiceRoute":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route."},"deliveryServiceRouteStatus":{"type":"object","description":"Delivery service route status.","properties":{"description":{"type":"string","description":"Delivery service route status response description."}}},"deliveryServiceDate":{"type":"string","format":"date-time","description":"Date and time of the delivery service."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route was created."},"startWorkDayDateTime":{"type":"string","format":"date-time","description":"Start date and time of the workday."},"finishWorkDayDateTime":{"type":"string","format":"date-time","description":"Finish date and time of the workday."},"itinerantDate":{"type":"string","format":"date-time","description":"Date and time of the itinerant delivery service."}}},"deliveryServiceRouteItemStatus":{"type":"object","description":"Delivery service route item status.","properties":{"description":{"type":"string","description":"Description of the delivery service route item status."}}},"nonDeliveryDescription":{"type":"string","description":"Description of why the delivery was not completed."},"index":{"type":"integer","format":"int32","description":"Index of the delivery service route item."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route item was created."},"startDisplacementDateTime":{"type":"string","format":"date-time","description":"Start date and time of the displacement."},"startDisplacementLatitude":{"type":"number","description":"Latitude at the start of the displacement."},"startDisplacementLongitude":{"type":"number","description":"Longitude at the start of the displacement."},"finishedDisplacementLatitude":{"type":"number","description":"Latitude at the end of the displacement."},"finishedDisplacementLongitude":{"type":"number","description":"Longitude at the end of the displacement."},"receiverName":{"type":"string","description":"Name of the person receiving the delivery."},"receiverDocument":{"type":"string","description":"Document or identification of the receiver."},"description":{"type":"string","description":"Description of the delivery service route item."},"deliveryArrived":{"type":"string","format":"date-time","description":"Date and time when the delivery arrived."},"comment":{"type":"string","description":"Additional comments about the delivery service route item."},"rating":{"type":"integer","format":"int32","description":"Rating given to the delivery service."},"pauseDisplacementDateTime":{"type":"string","format":"date-time","description":"Date and time when the displacement was paused."},"deliveryLeft":{"type":"string","format":"date-time","description":"Date and time when the delivery was left or completed."},"deliveryReason":{"type":"object","description":"Delivery reason.","properties":{"description":{"type":"string","description":"Description of the reason for the delivery."}}}}}}}},"description":"Array where each item contains information of a delivery service."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a given Service's information by filtering through the chosen invoice number. + > We strongly recommend that a call to a VTEX Tracking GET endpoint is made only once every 6 hours. Retrieving data from the same endpoint more than once during a 6-hour window represents a load to our API that will slow down the overall usage of systems. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `invoice` | query | Invoice code. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `Success` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list by route.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list by route.yml new file mode 100644 index 0000000000..2bf7543ae2 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list by route.yml @@ -0,0 +1,98 @@ +info: + name: Get delivery services list by route + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/services/routes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: status + value: Ativo + type: query + disabled: true + - name: dateInit + value: 2024-05-28 + type: query + disabled: true + - name: dateEnd + value: 2024-06-15 + type: query + disabled: true + - name: pageSize + value: "40" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/services/routes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/services/routes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/services/routes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/services/routes - Schema is valid", function () { + const schema = {"description":"Paginated delivery service response.","type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Number of the page that was returned."},"pageSize":{"type":"integer","format":"int32","description":"Number of items per returned page."},"totalCount":{"type":"integer","format":"int32","description":"Total number of pages given the page size and total results."},"data":{"type":"array","items":{"type":"object","description":"Delivery service response.","properties":{"pictures":{"type":"array","description":"Pictures array.","items":{"type":"string","description":"Picture URL."}},"idDeliveryService":{"type":"integer","format":"int32","description":"ID of the delivery service."},"deliveryServiceType":{"type":"object","description":"Delivery service type information.","properties":{"description":{"type":"string","description":"Description of the delivery service type."}}},"deliveryServiceStatus":{"type":"object","description":"Delivery service status information.","properties":{"description":{"type":"string","description":"Description of the delivery service status."}}},"shipper":{"type":"object","description":"Shipper information.","properties":{"companyName":{"type":"string","description":"Shipper company name."}}},"shipperCustomer":{"type":"object","description":"Shipper customer information.","properties":{"idShipperCustomer":{"type":"integer","format":"int32","description":"Unique identifier for the shipper customer."},"email":{"type":"string","description":"Email address of the shipper customer."},"firstName":{"type":"string","description":"First name of the shipper customer."},"lastName":{"type":"string","description":"Last name of the shipper customer."},"cpf":{"type":"string","description":"CPF number of the shipper customer."},"addressStreet":{"type":"string","description":"Street of the shipper customer address."},"addressNumber":{"type":"string","description":"Address number of the shipper customer."},"addressComplement":{"type":"string","description":"Address complement of the shipper customer."},"addressNeighborhood":{"type":"string","description":"Neighborhood of the shipper customer's address."},"addressCity":{"type":"string","description":"City of the shipper customer's address."},"postalCode":{"type":"string","description":"Postal code of the shipper customer's address."},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"created":{"type":"string","format":"date-time","description":"Date and time when the shipper customer record was created."},"companyName":{"type":"string","description":"Company name of the shipper customer."},"cnpj":{"type":"string","description":"CNPJ number of the shipper customer."},"legalType":{"type":["object","null"],"description":"Legal type information.","properties":{"description":{"type":"string","description":"Description of the legal type of the shipper customer."}}},"idExternalShipperCustomer":{"type":["string","null"],"description":"External identifier for the shipper customer."},"phoneAreaCode":{"type":"string","description":"Area code for the shipper customer's phone number."},"phoneNumber":{"type":"string","description":"Phone number of the shipper customer."}}},"carrier":{"type":"object","description":"Carrier information.","properties":{"username":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the username of the carrier."},"firstName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the first name of the carrier."},"lastName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the last name of the carrier."},"cpf":{"maxLength":14,"minLength":0,"type":"string","description":"A string representing the Brazilian CPF number of the carrier."},"email":{"maxLength":254,"minLength":0,"type":"string","description":"A string representing the email address of the carrier."},"cnpjtransportCompany":{"type":"string","description":"A string representing the CNPJ number of the transport company associated with the carrier."},"mobileAreaCode":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the area code for the carrier's mobile phone."},"mobile":{"maxLength":10,"minLength":0,"type":"string","description":"The carrier's mobile phone number."},"phoneAreaCode":{"maxLength":3,"minLength":0,"type":"string","description":"Area code for the carrier's landline phone."},"phone":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the carrier's landline phone number."},"created":{"type":"string","format":"date-time","description":"Date and time when the carrier record was created."},"idExternalCarrier":{"maxLength":30,"minLength":0,"type":"string","description":"External identifier for the carrier."},"isCarrierAppOnline":{"type":"boolean","description":"A boolean indicating whether the carrier is currently online in the carrier application."},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"rg":{"maxLength":12,"minLength":0,"type":"string","description":"A string representing the Brazilian RG number of the carrier."}}},"displacementType":{"type":"object","description":"Displacement type information.","properties":{"description":{"type":"string","description":"Displacement type description."},"vehicleType":{"type":"object","description":"Vehicle type information.","properties":{"description":{"type":"string","description":"Description of the vehicle type."}}}}},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"nonDeliveryReason":{"type":"object","description":"Information about the reason for non-delivery.","properties":{"description":{"type":"string","description":"A description explaining the reason for non-delivery."}}},"shipperPartner":{"type":"object","description":"Shipper partner information.","properties":{"cnpj":{"type":"string","description":"The CNPJ number of the Shipper partner."},"name":{"type":"string","description":"Shipper partner name."}}},"shipperBranch":{"type":"object","description":"Shipper branch information.","properties":{"shipperType":{"type":"object","description":"Shipper type information.","properties":{"description":{"type":"string","description":"Description of the type of shipper."}}},"companyName":{"type":"string","description":"The name of the shipping company branch."},"trade":{"type":"string","description":"The trade or industry in which the shipping company operates."},"cnpj":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the shipping company branch."},"companyContact":{"type":"string","description":"The primary contact person's name at the shipping company branch."},"telephoneArea":{"type":"string","description":"The area code for the shipping company branch's telephone number."},"telephone":{"type":"string","description":"The telephone number of the shipping company branch."},"mobileArea":{"type":"string","description":"The area code for the shipping company branch's mobile number."},"mobile":{"type":"string","description":"The mobile number of the shipping company branch."},"email":{"type":"string","description":"The email address of the shipping company branch."}}},"freightPrice":{"type":"object","description":"Freight price information.","properties":{"description":{"type":"string","description":"Description of the freight price details."},"firstPostalCodeInterval":{"type":"string","description":"The starting range of postal codes for which the freight price applies."},"secondPostalCodeInterval":{"type":"string","description":"The ending range of postal codes for which the freight price applies."},"price":{"type":"number","description":"The price charged for the freight service."},"created":{"type":"string","format":"date-time","description":"The date and time when the freight price was created."}}},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"invoiceOrderOfService":{"type":"string","description":"The invoice order number for the service."},"description":{"type":"string","description":"Delivery service description."},"addressStreet":{"type":"string","description":"The street address for the delivery."},"addressNumber":{"type":"string","description":"The number of the building or house for the delivery address."},"addressComplement":{"type":"string","description":"Additional address details, such as apartment or suite number."},"addressNeighborhood":{"type":"string","description":"The neighborhood of the delivery address."},"addressCity":{"type":"string","description":"The city of the delivery address."},"postalCode":{"type":"string","description":"The postal code of the delivery address."},"estimateDeliveryHour":{"type":"string","format":"date-time","description":"The estimated delivery time and date."},"created":{"type":"string","format":"date-time","description":"The date and time when the delivery service was created."},"initialEstimateDeliveryHour":{"type":"string","format":"date-time","description":"The initially estimated delivery time and date."},"deliveryDateTime":{"type":"string","format":"date-time","description":"Date and time of delivery."},"estimateDeliveryDistance":{"type":"integer","format":"int32","description":"Delivery service esimate distance."},"travelledDeliveryDistance":{"type":"integer","format":"int32","description":"The total distance traveled for the delivery, measured in kilometers."},"orderNumber":{"type":"string","description":"The unique number associated with the order."},"cteNumber":{"type":"string","description":"The number of the CTE (Conhecimento de Transporte Eletrônico), an electronic transport document used in Brazil."},"cteDate":{"type":"string","format":"date-time","description":"The date and time when the CTE was issued."},"sender":{"type":"string","description":"The name of the sender of the delivery."},"senderCity":{"type":"string","description":"The city from which the delivery was sent."},"senderState":{"type":"integer","format":"int32","description":"The state code from which the delivery was sent."},"weight":{"type":"number","description":"The weight of the delivery item in kilograms."},"cubicMeter":{"type":"number","description":"The volume of the delivery item in cubic meters."},"cubicMeterWeight":{"type":"number","description":"The weight of the delivery item calculated based on its volume."},"value":{"type":"number","description":"The monetary value of the delivery item."},"freightPriceReceived":{"type":"number","description":"The amount received for the freight service."},"deliveryAttempts":{"type":"integer","format":"int32","description":"The number of attempts made to deliver the item."},"serviceTime":{"type":"integer","format":"int32","description":"The time spent on the delivery service, measured in minutes."},"invoiceOrderOfServiceSerie":{"type":"string","description":"The series of the invoice order of service."},"leadTime":{"type":"string","format":"date-time","description":"The lead time for the delivery, calculated from the order date to the delivery date."},"cnpjcarrier":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the carrier company."},"cnpjbranch":{"type":"string","description":"The CNPJ number of the branch of the carrier company."},"idExternal":{"type":"string","description":"External ID of the delivery service."},"billingInfo":{"type":"array","description":"Billing information array.","items":{"type":"object","description":"Billing information.","properties":{"receivableAmount":{"type":"number","description":"The total amount receivable for the billing item."},"money":{"type":"number","description":"The amount received in cash."},"cheque":{"type":"number","description":"The amount received via cheque."},"creditCard":{"type":"number","description":"The amount received via credit card."},"webComment":{"type":"string","description":"Comments or notes made via the web interface regarding the billing item."},"carrierComment":{"type":"string","description":"Comments or notes made by the carrier regarding the billing item."},"billingConfirmDate":{"type":"string","format":"date-time","description":"The date and time when the billing was confirmed."},"created":{"type":"string","format":"date-time","description":"The date and time when the billing item was created."}}}},"deliveryServiceRouteItem":{"type":"array","description":"Array in which each item corresponds to a delivery service route.","items":{"type":"object","description":"Delivery service route information.","properties":{"idDeliveryServiceRouteItem":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route item."},"deliveryServiceRoute":{"description":"Delivery service route.","type":"object","properties":{"idDeliveryServiceRoute":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route."},"deliveryServiceRouteStatus":{"type":"object","description":"Delivery service route status.","properties":{"description":{"type":"string","description":"Delivery service route status response description."}}},"deliveryServiceDate":{"type":"string","format":"date-time","description":"Date and time of the delivery service."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route was created."},"startWorkDayDateTime":{"type":"string","format":"date-time","description":"Start date and time of the workday."},"finishWorkDayDateTime":{"type":"string","format":"date-time","description":"Finish date and time of the workday."},"itinerantDate":{"type":"string","format":"date-time","description":"Date and time of the itinerant delivery service."}}},"deliveryServiceRouteItemStatus":{"type":"object","description":"Delivery service route item status.","properties":{"description":{"type":"string","description":"Description of the delivery service route item status."}}},"nonDeliveryDescription":{"type":"string","description":"Description of why the delivery was not completed."},"index":{"type":"integer","format":"int32","description":"Index of the delivery service route item."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route item was created."},"startDisplacementDateTime":{"type":"string","format":"date-time","description":"Start date and time of the displacement."},"startDisplacementLatitude":{"type":"number","description":"Latitude at the start of the displacement."},"startDisplacementLongitude":{"type":"number","description":"Longitude at the start of the displacement."},"finishedDisplacementLatitude":{"type":"number","description":"Latitude at the end of the displacement."},"finishedDisplacementLongitude":{"type":"number","description":"Longitude at the end of the displacement."},"receiverName":{"type":"string","description":"Name of the person receiving the delivery."},"receiverDocument":{"type":"string","description":"Document or identification of the receiver."},"description":{"type":"string","description":"Description of the delivery service route item."},"deliveryArrived":{"type":"string","format":"date-time","description":"Date and time when the delivery arrived."},"comment":{"type":"string","description":"Additional comments about the delivery service route item."},"rating":{"type":"integer","format":"int32","description":"Rating given to the delivery service."},"pauseDisplacementDateTime":{"type":"string","format":"date-time","description":"Date and time when the displacement was paused."},"deliveryLeft":{"type":"string","format":"date-time","description":"Date and time when the delivery was left or completed."},"deliveryReason":{"type":"object","description":"Delivery reason.","properties":{"description":{"type":"string","description":"Description of the reason for the delivery."}}}}}}}},"description":"Array where each item contains information of a delivery service."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint retrieves a list of Delivery Services by Route Item Date Async. + > We strongly recommend that a call to a VTEX Tracking GET endpoint is made only once every 6 hours. Retrieving data from the same endpoint more than once during a 6-hour window represents a load to our API that will slow down the overall usage of systems. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `status` | query | Current status of the delivery service. Includes the following statuses as possible values: `Ativo`, `Roteirizado`, `Realizado`, `EmAndamento`, `NaoRealizado`. | + | `dateInit` | query | Initial date of registration of the requested service. The date format is `yyyy-mm-dd`. | + | `dateEnd` | query | End date of registration of the requested service. The date format is `yyyy-mm-dd`. Make sure that the period of time between `dateInit` and `dateEnd` is not greater than 30 days. | + | `pageSize` | query | Number of items shown per consultation page. The default is `25`. | + | `page` | query | The desired page for the consultation. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `Success` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list.yml new file mode 100644 index 0000000000..bbf42c3210 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Get delivery services list.yml @@ -0,0 +1,98 @@ +info: + name: Get delivery services list + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/services" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: status + value: Ativo + type: query + disabled: true + - name: dateInit + value: 2024-05-28 + type: query + disabled: true + - name: dateEnd + value: 2024-05-29 + type: query + disabled: true + - name: pageSize + value: "40" + type: query + disabled: true + - name: page + value: "1" + type: query + disabled: true + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/services - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/services - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/services - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/services - Schema is valid", function () { + const schema = {"description":"Paginated delivery service response.","type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Number of the page that was returned."},"pageSize":{"type":"integer","format":"int32","description":"Number of items per returned page."},"totalCount":{"type":"integer","format":"int32","description":"Total number of pages given the page size and total results."},"data":{"type":"array","items":{"type":"object","description":"Delivery service response.","properties":{"pictures":{"type":"array","description":"Pictures array.","items":{"type":"string","description":"Picture URL."}},"idDeliveryService":{"type":"integer","format":"int32","description":"ID of the delivery service."},"deliveryServiceType":{"type":"object","description":"Delivery service type information.","properties":{"description":{"type":"string","description":"Description of the delivery service type."}}},"deliveryServiceStatus":{"type":"object","description":"Delivery service status information.","properties":{"description":{"type":"string","description":"Description of the delivery service status."}}},"shipper":{"type":"object","description":"Shipper information.","properties":{"companyName":{"type":"string","description":"Shipper company name."}}},"shipperCustomer":{"type":"object","description":"Shipper customer information.","properties":{"idShipperCustomer":{"type":"integer","format":"int32","description":"Unique identifier for the shipper customer."},"email":{"type":"string","description":"Email address of the shipper customer."},"firstName":{"type":"string","description":"First name of the shipper customer."},"lastName":{"type":"string","description":"Last name of the shipper customer."},"cpf":{"type":"string","description":"CPF number of the shipper customer."},"addressStreet":{"type":"string","description":"Street of the shipper customer address."},"addressNumber":{"type":"string","description":"Address number of the shipper customer."},"addressComplement":{"type":"string","description":"Address complement of the shipper customer."},"addressNeighborhood":{"type":"string","description":"Neighborhood of the shipper customer's address."},"addressCity":{"type":"string","description":"City of the shipper customer's address."},"postalCode":{"type":"string","description":"Postal code of the shipper customer's address."},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"created":{"type":"string","format":"date-time","description":"Date and time when the shipper customer record was created."},"companyName":{"type":"string","description":"Company name of the shipper customer."},"cnpj":{"type":"string","description":"CNPJ number of the shipper customer."},"legalType":{"type":["object","null"],"description":"Legal type information.","properties":{"description":{"type":"string","description":"Description of the legal type of the shipper customer."}}},"idExternalShipperCustomer":{"type":["string","null"],"description":"External identifier for the shipper customer."},"phoneAreaCode":{"type":"string","description":"Area code for the shipper customer's phone number."},"phoneNumber":{"type":"string","description":"Phone number of the shipper customer."}}},"carrier":{"type":"object","description":"Carrier information.","properties":{"username":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the username of the carrier."},"firstName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the first name of the carrier."},"lastName":{"maxLength":100,"minLength":0,"type":"string","description":"A string representing the last name of the carrier."},"cpf":{"maxLength":14,"minLength":0,"type":"string","description":"A string representing the Brazilian CPF number of the carrier."},"email":{"maxLength":254,"minLength":0,"type":"string","description":"A string representing the email address of the carrier."},"cnpjtransportCompany":{"type":"string","description":"A string representing the CNPJ number of the transport company associated with the carrier."},"mobileAreaCode":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the area code for the carrier's mobile phone."},"mobile":{"maxLength":10,"minLength":0,"type":"string","description":"The carrier's mobile phone number."},"phoneAreaCode":{"maxLength":3,"minLength":0,"type":"string","description":"Area code for the carrier's landline phone."},"phone":{"maxLength":10,"minLength":0,"type":"string","description":"A string representing the carrier's landline phone number."},"created":{"type":"string","format":"date-time","description":"Date and time when the carrier record was created."},"idExternalCarrier":{"maxLength":30,"minLength":0,"type":"string","description":"External identifier for the carrier."},"isCarrierAppOnline":{"type":"boolean","description":"A boolean indicating whether the carrier is currently online in the carrier application."},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"rg":{"maxLength":12,"minLength":0,"type":"string","description":"A string representing the Brazilian RG number of the carrier."}}},"displacementType":{"type":"object","description":"Displacement type information.","properties":{"description":{"type":"string","description":"Displacement type description."},"vehicleType":{"type":"object","description":"Vehicle type information.","properties":{"description":{"type":"string","description":"Description of the vehicle type."}}}}},"state":{"type":"object","description":"State response.","properties":{"name":{"type":"string","description":"State name."},"code":{"type":"string","description":"State code."}}},"country":{"type":"object","description":"Country response.","properties":{"name":{"type":"string","description":"Country name."},"code":{"type":"string","description":"Country code."}}},"nonDeliveryReason":{"type":"object","description":"Information about the reason for non-delivery.","properties":{"description":{"type":"string","description":"A description explaining the reason for non-delivery."}}},"shipperPartner":{"type":"object","description":"Shipper partner information.","properties":{"cnpj":{"type":"string","description":"The CNPJ number of the Shipper partner."},"name":{"type":"string","description":"Shipper partner name."}}},"shipperBranch":{"type":"object","description":"Shipper branch information.","properties":{"shipperType":{"type":"object","description":"Shipper type information.","properties":{"description":{"type":"string","description":"Description of the type of shipper."}}},"companyName":{"type":"string","description":"The name of the shipping company branch."},"trade":{"type":"string","description":"The trade or industry in which the shipping company operates."},"cnpj":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the shipping company branch."},"companyContact":{"type":"string","description":"The primary contact person's name at the shipping company branch."},"telephoneArea":{"type":"string","description":"The area code for the shipping company branch's telephone number."},"telephone":{"type":"string","description":"The telephone number of the shipping company branch."},"mobileArea":{"type":"string","description":"The area code for the shipping company branch's mobile number."},"mobile":{"type":"string","description":"The mobile number of the shipping company branch."},"email":{"type":"string","description":"The email address of the shipping company branch."}}},"freightPrice":{"type":"object","description":"Freight price information.","properties":{"description":{"type":"string","description":"Description of the freight price details."},"firstPostalCodeInterval":{"type":"string","description":"The starting range of postal codes for which the freight price applies."},"secondPostalCodeInterval":{"type":"string","description":"The ending range of postal codes for which the freight price applies."},"price":{"type":"number","description":"The price charged for the freight service."},"created":{"type":"string","format":"date-time","description":"The date and time when the freight price was created."}}},"shippingCompany":{"type":"object","description":"Shipping company response.","properties":{"companyName":{"type":"string","description":"The name of the company."},"trade":{"type":"string","description":"The trade or industry in which the company operates."},"cnpj":{"type":"string","description":"The CNPJ number, which is the Brazilian national registry of legal entities."},"companyContact":{"type":"string","description":"The primary contact person's name at the company."},"telephoneArea":{"type":"string","description":"The area code for the company's telephone number."},"telephone":{"type":"string","description":"The company's telephone number."},"mobileArea":{"type":"string","description":"The area code for the company's mobile number."},"mobile":{"type":"string","description":"The company's mobile number."},"email":{"type":"string","description":"The company's email address."}}},"invoiceOrderOfService":{"type":"string","description":"The invoice order number for the service."},"description":{"type":"string","description":"Delivery service description."},"addressStreet":{"type":"string","description":"The street address for the delivery."},"addressNumber":{"type":"string","description":"The number of the building or house for the delivery address."},"addressComplement":{"type":"string","description":"Additional address details, such as apartment or suite number."},"addressNeighborhood":{"type":"string","description":"The neighborhood of the delivery address."},"addressCity":{"type":"string","description":"The city of the delivery address."},"postalCode":{"type":"string","description":"The postal code of the delivery address."},"estimateDeliveryHour":{"type":"string","format":"date-time","description":"The estimated delivery time and date."},"created":{"type":"string","format":"date-time","description":"The date and time when the delivery service was created."},"initialEstimateDeliveryHour":{"type":"string","format":"date-time","description":"The initially estimated delivery time and date."},"deliveryDateTime":{"type":"string","format":"date-time","description":"Date and time of delivery."},"estimateDeliveryDistance":{"type":"integer","format":"int32","description":"Delivery service esimate distance."},"travelledDeliveryDistance":{"type":"integer","format":"int32","description":"The total distance traveled for the delivery, measured in kilometers."},"orderNumber":{"type":"string","description":"The unique number associated with the order."},"cteNumber":{"type":"string","description":"The number of the CTE (Conhecimento de Transporte Eletrônico), an electronic transport document used in Brazil."},"cteDate":{"type":"string","format":"date-time","description":"The date and time when the CTE was issued."},"sender":{"type":"string","description":"The name of the sender of the delivery."},"senderCity":{"type":"string","description":"The city from which the delivery was sent."},"senderState":{"type":"integer","format":"int32","description":"The state code from which the delivery was sent."},"weight":{"type":"number","description":"The weight of the delivery item in kilograms."},"cubicMeter":{"type":"number","description":"The volume of the delivery item in cubic meters."},"cubicMeterWeight":{"type":"number","description":"The weight of the delivery item calculated based on its volume."},"value":{"type":"number","description":"The monetary value of the delivery item."},"freightPriceReceived":{"type":"number","description":"The amount received for the freight service."},"deliveryAttempts":{"type":"integer","format":"int32","description":"The number of attempts made to deliver the item."},"serviceTime":{"type":"integer","format":"int32","description":"The time spent on the delivery service, measured in minutes."},"invoiceOrderOfServiceSerie":{"type":"string","description":"The series of the invoice order of service."},"leadTime":{"type":"string","format":"date-time","description":"The lead time for the delivery, calculated from the order date to the delivery date."},"cnpjcarrier":{"type":"string","description":"The CNPJ (Cadastro Nacional da Pessoa Jurídica) number of the carrier company."},"cnpjbranch":{"type":"string","description":"The CNPJ number of the branch of the carrier company."},"idExternal":{"type":"string","description":"External ID of the delivery service."},"billingInfo":{"type":"array","description":"Billing information array.","items":{"type":"object","description":"Billing information.","properties":{"receivableAmount":{"type":"number","description":"The total amount receivable for the billing item."},"money":{"type":"number","description":"The amount received in cash."},"cheque":{"type":"number","description":"The amount received via cheque."},"creditCard":{"type":"number","description":"The amount received via credit card."},"webComment":{"type":"string","description":"Comments or notes made via the web interface regarding the billing item."},"carrierComment":{"type":"string","description":"Comments or notes made by the carrier regarding the billing item."},"billingConfirmDate":{"type":"string","format":"date-time","description":"The date and time when the billing was confirmed."},"created":{"type":"string","format":"date-time","description":"The date and time when the billing item was created."}}}},"deliveryServiceRouteItem":{"type":"array","description":"Array in which each item corresponds to a delivery service route.","items":{"type":"object","description":"Delivery service route information.","properties":{"idDeliveryServiceRouteItem":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route item."},"deliveryServiceRoute":{"description":"Delivery service route.","type":"object","properties":{"idDeliveryServiceRoute":{"type":"integer","format":"int32","description":"Unique identifier for the delivery service route."},"deliveryServiceRouteStatus":{"type":"object","description":"Delivery service route status.","properties":{"description":{"type":"string","description":"Delivery service route status response description."}}},"deliveryServiceDate":{"type":"string","format":"date-time","description":"Date and time of the delivery service."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route was created."},"startWorkDayDateTime":{"type":"string","format":"date-time","description":"Start date and time of the workday."},"finishWorkDayDateTime":{"type":"string","format":"date-time","description":"Finish date and time of the workday."},"itinerantDate":{"type":"string","format":"date-time","description":"Date and time of the itinerant delivery service."}}},"deliveryServiceRouteItemStatus":{"type":"object","description":"Delivery service route item status.","properties":{"description":{"type":"string","description":"Description of the delivery service route item status."}}},"nonDeliveryDescription":{"type":"string","description":"Description of why the delivery was not completed."},"index":{"type":"integer","format":"int32","description":"Index of the delivery service route item."},"created":{"type":"string","format":"date-time","description":"Date and time when the delivery service route item was created."},"startDisplacementDateTime":{"type":"string","format":"date-time","description":"Start date and time of the displacement."},"startDisplacementLatitude":{"type":"number","description":"Latitude at the start of the displacement."},"startDisplacementLongitude":{"type":"number","description":"Longitude at the start of the displacement."},"finishedDisplacementLatitude":{"type":"number","description":"Latitude at the end of the displacement."},"finishedDisplacementLongitude":{"type":"number","description":"Longitude at the end of the displacement."},"receiverName":{"type":"string","description":"Name of the person receiving the delivery."},"receiverDocument":{"type":"string","description":"Document or identification of the receiver."},"description":{"type":"string","description":"Description of the delivery service route item."},"deliveryArrived":{"type":"string","format":"date-time","description":"Date and time when the delivery arrived."},"comment":{"type":"string","description":"Additional comments about the delivery service route item."},"rating":{"type":"integer","format":"int32","description":"Rating given to the delivery service."},"pauseDisplacementDateTime":{"type":"string","format":"date-time","description":"Date and time when the displacement was paused."},"deliveryLeft":{"type":"string","format":"date-time","description":"Date and time when the delivery was left or completed."},"deliveryReason":{"type":"object","description":"Delivery reason.","properties":{"description":{"type":"string","description":"Description of the reason for the delivery."}}}}}}}},"description":"Array where each item contains information of a delivery service."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a list of services with pagination and URLs. You can consult the list using the following filters: the service's registration date, status, page size, and desired number of pages. Check the parameters documented below to see each filter's description. + > We strongly recommend that a call to a VTEX Tracking GET endpoint is made only once every 6 hours. Retrieving data from the same endpoint more than once during a 6-hour window represents a load to our API that will slow down the overall usage of systems. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `status` | query | Current status of the delivery service. The status parameters are not case sensitive, you can write them with upper or lower case. This field includes the following statuses as possible values: `Ativo`, `Roteirizado`, `Realizado`, `EmAndamento`, `NaoRealizado`. | + | `dateInit` | query | Initial date of registration of the requested service. The date format is `yyyy-mm-dd`. | + | `dateEnd` | query | End date of registration of the requested service. The date format is `yyyy-mm-dd`. Make sure that the period of time between `dateInit` and `dateEnd` is not greater than 30 days. | + | `pageSize` | query | Number of items shown per consultation page. The default is `25`. | + | `page` | query | The consultation's desired page. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + _Omitted here: 6 KB. See `Success` in PostmanCollections._ diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service with route scheduling.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service with route scheduling.yml new file mode 100644 index 0000000000..c4092dd806 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service with route scheduling.yml @@ -0,0 +1,345 @@ +info: + name: Post delivery service with route scheduling + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/services/routes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "deliveryService": [ + [ + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + }, + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + } + ], + [ + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + }, + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + } + ] + ], + "deliveryServiceRoute": { + "carrier": { + "username": "john_doe", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678909", + "email": "john.doe@example.com", + "mobileAreaCode": "011", + "mobile": "987654321", + "phoneAreaCode": "011", + "phone": "123456789", + "idExternalCarrier": "CARRIER12345", + "rg": "MG12345678", + "idShipperBranch": 102, + "idShippingCompany": 203 + }, + "displacementType": "moto", + "deliveryServiceDate": "2024-07-20T10:00:00Z", + "vehicle": { + "registrationPlate": "CCC-9999" + }, + "deliveryServiceRouteTimeOfDay": "morning", + "idExternalRoute": "ROUTE12345", + "itinerantDate": "2024-07-20T12:00:00Z", + "addressStart": { + "addressStreet": "Main St", + "addressNumber": "456", + "postalCode": "12345678", + "addressCity": "São Paulo", + "state": "SP" + } + } + } + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/services/routes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint creates a delivery service in your Tracking system. It allows the user to configure the Route Scheduling services with the Delivery Person and Route date already defined. + + ### Request body example + + ```json + [ + { + "deliveryServiceRoute": { + "deliveryServiceDate": "2020-09-28", + "displacementType": "Caminhão", + "carrier": { + "username": "empresa-joao.silva" + }, + "vehicle": { + "registrationPlate": "XPT-0123" + }, + "addressStart": { + "addressStreet": "Avenida das Américas", + "addressNumber": "5000", + "addressCity": "Rio de Janeiro", + "postalCode": "22640102", + "state": "RJ" + } + }, + "deliveryService": [ + { + "deliveryServiceType": "Entrega", + "shipperCustomer": { + "legalType": "PJ", + "companyName": "COMP. BRAS. DE TECN. PARA E-COMMERCE", + "cnpj": "05314972000174", + "addressStreet": "Rua Praia de Botafogo", + "addressNumber": "300", + "addressComplement": "SL", + "addressNeighborhood": "Botafogo", + "addressCity": "Rio de Janeiro", + "postalCode": "22250040", + "state": "RJ", + "phoneAreaCode": "21", + "phoneNumber": "999999999" + }, + "invoiceOrderOfService": "123456", + "invoiceOrderOfServiceSerie": "2", + "orderNumber": "987654321" + }, + { + "deliveryServiceType": "Entrega", + "shipperCustomer": { + "legalType": "PF", + "firstName": "Pedro", + "lastName": "Silva", + "cpf": "90498365778", + "addressStreet": "Rua Praia de Botafogo", + "addressNumber": "300", + "addressComplement": "SL", + "addressNeighborhood": "Botafogo", + "addressCity": "Rio de Janeiro", + "postalCode": "22250040", + "state": "RJ", + "phoneAreaCode": "21", + "phoneNumber": "999999999" + }, + "invoiceOrderOfService": "123457", + "invoiceOrderOfServiceSerie": "2", + "orderNumber": "987654322" + } + ] + } + ] + ``` + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service.yml new file mode 100644 index 0000000000..c6a4ebd42f --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Post delivery service.yml @@ -0,0 +1,192 @@ +info: + name: Post delivery service + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/services" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + }, + { + "deliveryServiceType": "Express", + "idExternalShipperCustomer": "EXT123456", + "shipperCustomer": { + "legalType": "PF", + "addressStreet": "Avenida Teodoro Sampaio", + "postalCode": "12345-678", + "email": "customer@example.com", + "firstName": "John", + "lastName": "Doe", + "cpf": "12345678900", + "addressNumber": "456", + "addressComplement": "Apt 789", + "addressNeighborhood": "Brás", + "addressCity": "São Paulo", + "state": "SP", + "companyName": "ABC Corp", + "cnpj": "12345678000195", + "idExternalShipperCustomer": "EXT123456", + "phoneAreaCode": "11", + "phoneNumber": "987654321" + }, + "invoiceOrderOfService": "INV123456", + "invoiceOrderOfServiceSerie": "A12", + "description": "Delivery of electronics from warehouse to customer.", + "sender": "John Doe", + "cnpjShipperPartner": "12345678000195", + "orderNumber": "987654321", + "deliveryServiceHighLighter": "HIGHLIGHT1", + "latitude": -23.55052, + "longitude": -46.633308, + "deliveryServiceScheduling": { + "shipperCustomerSchedulingDateTime": "2024-07-15T10:30:00Z", + "shipperSchedulingDateTime": "2024-07-14T08:00:00Z", + "morningPeriod": true, + "afternoonPeriod": false, + "nightPeriod": false, + "origin": 123 + }, + "cnpjcarrier": "04816548000197", + "cnpjbranch": "05314972000174", + "idExternal": "987654abc", + "idShippingCompany": 123456, + "packingList": "1 x SKU 12; 3 x SKU 57", + "packingListDateTime": "2024-07-15T15:31:45Z", + "integrationDateTime": "2024-07-15T15:31:45Z" + } + ] + auth: + type: bearer + token: "{{bearerToken}}" + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/services - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a delivery service in your Tracking system. It allows the user to configure the Route Scheduling services, without defining the Delivery Person or Route Date. + + ### Request body example + + ```json + [ + { + "deliveryServiceType": "Entrega", + "shipperCustomer": { + "legalType": "PJ", + "companyName": "COMP. BRAS. DE TECN. PARA E-COMMERCE", + "cnpj": "05314972000174", + "addressStreet": "Rua Praia de Botafogo", + "addressNumber": "300", + "addressComplement": "SL", + "addressNeighborhood": "Botafogo", + "addressCity": "Rio de Janeiro", + "postalCode": "22250040", + "state": "RJ", + "phoneAreaCode": "21", + "phoneNumber": "999999999" + }, + "invoiceOrderOfService": "123456", + "invoiceOrderOfServiceSerie": "2", + "orderNumber": "987654321" + }, + { + "deliveryServiceType": "Entrega", + "shipperCustomer": { + "legalType": "PF", + "firstName": "Pedro", + "lastName": "Silva", + "cpf": "90498365778", + "addressStreet": "Rua Praia de Botafogo", + "addressNumber": "300", + "addressComplement": "SL", + "addressNeighborhood": "Botafogo", + "addressCity": "Rio de Janeiro", + "postalCode": "22250040", + "state": "RJ", + "phoneAreaCode": "21", + "phoneNumber": "999999999" + }, + "invoiceOrderOfService": "123457", + "invoiceOrderOfServiceSerie": "2", + "orderNumber": "987654322" + } + ] + ``` + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/Remove packing list.yml b/BrunoCollections/VTEX - Tracking/Delivery services/Remove packing list.yml new file mode 100644 index 0000000000..c749903623 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/Remove packing list.yml @@ -0,0 +1,55 @@ +info: + name: Remove packing list + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/services" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + [ + { + "invoice": "string", + "serie": "string" + }, + { + "invoice": "string", + "serie": "string" + } + ] + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/services - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes Packing List on your VTEX Tracking configuration. Your request body must contain the invoice and serie fields. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - Tracking/Delivery services/folder.yml b/BrunoCollections/VTEX - Tracking/Delivery services/folder.yml new file mode 100644 index 0000000000..78a00827dc --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/Delivery services/folder.yml @@ -0,0 +1,4 @@ +info: + name: Delivery services + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - Tracking/environments/VTEX.yml b/BrunoCollections/VTEX - Tracking/environments/VTEX.yml new file mode 100644 index 0000000000..1a6d9d2516 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: https://api.vtextracking.com/receiver + - secret: true + name: bearerToken diff --git a/BrunoCollections/VTEX - Tracking/opencollection.yml b/BrunoCollections/VTEX - Tracking/opencollection.yml new file mode 100644 index 0000000000..f3ff8b43d0 --- /dev/null +++ b/BrunoCollections/VTEX - Tracking/opencollection.yml @@ -0,0 +1,49 @@ +opencollection: 1.0.0 + +info: + name: VTEX - Tracking + +docs: + content: |- + This API allows consulting and registering services in the [VTEX Tracking](https://help.vtex.com/en/tutorial/vtex-tracking-overview--1uDRquVudbPuoK05MtbZGh) system. Its use is exclusive to VTEX Tracking customers and is only available for Brazilian operations. + + > We have unified our VTEX Tracking API endpoints into a single version, so it's no longer necessary to specify the version on the URL. We have also translated all paths to english. Check out our [release notes](https://developers.vtex.com/updates/release-notes/vtex-tracking-api-changes-in-all-paths) to know more about the changes. The previous paths were not deprecated, and are still being maintained by the VTEX Tracking team. If your business' integration was built with the previous `v1` and `v1.1` endpoints, it will still run smoothly. No changes in your integrations should be done during critical periods. We will communicate any updates, and deprecation of endpoints in the future. + + >⚠️ We recommend that customers call our GET endpoints only once in every 6 hours. We do not recommend, and consider as a bad practice, to retrieve data from the same endpoint more than once during a 6-hour window. This represents a major load to our API that will slow down the overall usage of our systems. + + ## VTEX Tracking APIs Index + + ### Authentication + + - `POST` [Asynchronous Login](https://developers.vtex.com/docs/api-reference/tracking#post-/auth) + + ### Delivery Services + + - `PUT` [Remove Packing List](https://developers.vtex.com/docs/api-reference/tracking#put-/services) + - `POST` [Post Delivery Service](https://developers.vtex.com/docs/api-reference/tracking#post-/services) + - `GET` [Get Delivery Services List](https://developers.vtex.com/docs/api-reference/tracking#get-/services) + - `GET` [Get Delivery Service by ID](https://developers.vtex.com/docs/api-reference/tracking#get-/services/-idDeliveryService-) + - `POST` [Post Delivery Service With Route Scheduling](https://developers.vtex.com/docs/api-reference/tracking#post-/services/routes) + - `GET` [Get Delivery Services List by Route](https://developers.vtex.com/docs/api-reference/tracking#get-/services/routes) + - `GET` [Get Delivery Service by Invoice](https://developers.vtex.com/docs/api-reference/tracking#get-/services/invoice) + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + + Contact Support: + Name: VTEX Tracking + Email: suportetracking@vtex.com.br + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/Erase customer data.yml b/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/Erase customer data.yml new file mode 100644 index 0000000000..f4932e1b92 --- /dev/null +++ b/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/Erase customer data.yml @@ -0,0 +1,113 @@ +info: + name: Erase customer data + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/user-rights/createAndProcessDeleteUserData?an=mystore" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: mystore + type: query + body: + type: json + data: |- + { + "email": "john@mail.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Schema is valid", function () { + const schema = {"type":"object","properties":{"uuid":{"type":"string","description":"User data rights request unique identifier in [UUID](https://www.uuidtools.com/what-is-uuid) format."},"requestType":{"type":"string","description":"Type of user data rights request."},"email":{"type":"string","description":"Client email."},"status":{"type":"string","description":"Status of the user data rights request."},"dataResponse":{"type":"string","description":"Escaped JSON containing information about the status of data deletion on each VTEX system that stores client data."},"requestTime":{"type":"string","description":"Date of the user data rights request in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)format."},"applications":{"type":"array","description":"Array containing an object for each VTEX application that stores client data.","items":{"type":"object","description":"Object containing information about user data status in each VTEX application that stores client data.","properties":{"application":{"type":"string","description":"Abbreviated name of the application, which can be `chk` (Checkout), `orders` (Order Management System), `profileSystemV2` (PII Profile System) or `vid` (VTEX ID)."},"status":{"type":"string","description":"Status of client data in the given application. The possible values are:\n\r- `Completed` - Processing completed successfully.\n\r- `Error` - An unexpected error occurred during the process. You must make a new request.\n\r- `PendingCheck` - Pending validation. Unable to perform validation on one or more services.\n\r- `Blocked` - Pending validation. One or more services are unable to fulfill the deletion request. You need to wait and make a new request in the future.\n\r- `PendingDeletion` - It was not possible to delete data in one or more services. You must make a new request."},"errorDetail":{"type":"string","description":"In case of error, this field contains an explanatory error message. Otherwise, this field is an empty string."},"updateAt":{"type":"string","description":"Date of the latest update in client data in the given application, in UTC format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes a given customer's data collected in your store by Checkout, Orders, VTEX ID and Profile System. + + >⚠️ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + >⚠️ Only orders with `invoiced` or `canceled` status are erased in this request. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + + ## Example response (`200`) + + ```json + { + "uuid": "3e2f53dc-b099-4dc8-9727-581b2a97f39c", + "requestType": "Removal", + "email": "pedido2@vtexchallenge.com", + "status": "Completed", + "dataResponse": "{\r\n \"VTEX Checkout\": [],\r\n \"orders\": {\r\n \"dataStatus\": {\r\n \"status\": \"anonymized\",\r\n \"reason\": \"Sensitive information was anonymized rather than deleted to preserve the store metrics.\",\r\n \"evidence\": \"Anonymized [0] orders\",\r\n \"dryRun\": true\r\n },\r\n \"orders\": []\r\n },\r\n \"Profile System PII API\": {},\r\n \"VTEX ID\": {\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.4\",\r\n \"title\": \"Not Found\",\r\n \"status\": 404,\r\n \"traceId\": \"00-65d5abf9263b07eb185beee49e2075dc-b67b373e2e93dcf8-00\"\r\n }\r\n}", + "requestTime": "2023-09-05T17:19:33.1969022-03:00", + "applications": [ + { + "application": "chk", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:23" + }, + { + "application": "orders", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:25" + }, + { + "application": "profileSystemV2", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:26" + }, + { + "application": "vid", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:29" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/folder.yml b/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/folder.yml new file mode 100644 index 0000000000..6859224839 --- /dev/null +++ b/BrunoCollections/VTEX - User Data Rights API/Data Subject Rights/folder.yml @@ -0,0 +1,4 @@ +info: + name: Data Subject Rights + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - User Data Rights API/environments/VTEX.yml b/BrunoCollections/VTEX - User Data Rights API/environments/VTEX.yml new file mode 100644 index 0000000000..05d498023d --- /dev/null +++ b/BrunoCollections/VTEX - User Data Rights API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: http://api.vtex.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - User Data Rights API/opencollection.yml b/BrunoCollections/VTEX - User Data Rights API/opencollection.yml new file mode 100644 index 0000000000..98058a2db9 --- /dev/null +++ b/BrunoCollections/VTEX - User Data Rights API/opencollection.yml @@ -0,0 +1,28 @@ +opencollection: 1.0.0 + +info: + name: VTEX - User Data Rights API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + According to data protection policies, such as [GDPR and LGPD](https://vtex.com/us-en/privacy-and-agreements/vtex-commitment/), companies using customer personal data are required to delete collected information upon the customer's request. Data Subject Rights API allows stores using the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture) to erase user data collected by Checkout, Orders, VTEX ID and Profile System, without depending on the VTEX Support flow described in the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide. + + >⚠️ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + ## Index + + - `POST` [Delete user data](https://developers.vtex.com/docs/api-reference/user-data-rights-api#post-/api/user-rights/createAndProcessDeleteUserData) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - User Rights API/Data erasure/Create data erasure job.yml b/BrunoCollections/VTEX - User Rights API/Data erasure/Create data erasure job.yml new file mode 100644 index 0000000000..f7a35bf8a3 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights API/Data erasure/Create data erasure job.yml @@ -0,0 +1,83 @@ +info: + name: Create data erasure job + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/user-rights/forget/jobs" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "email": "user@example.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/user-rights/forget/jobs - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/user-rights/forget/jobs - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/user-rights/forget/jobs - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/user-rights/forget/jobs - Schema is valid", function () { + const schema = {"type":"object","required":["jobId"],"properties":{"jobId":{"type":"string","format":"uuid","description":"Unique identifier of the data erasure job. Use this ID to poll the job status via the [Get data erasure job status](https://developers.vtex.com/docs/api-reference/user-rights-api#get-/api/user-rights/forget/jobs/-jobId-) endpoint."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint is in **closed beta** and currently available for selected accounts only. + + Creates a job to delete a user's personal data across VTEX applications ("Right to be Forgotten"). The request receives the user's email and returns a job ID that can be used to track the deletion progress via the [Get data erasure job status](https://developers.vtex.com/docs/api-reference/user-rights-api#get-/api/user-rights/forget/jobs/-jobId-) endpoint. + + > ⚠️ This data erasure flow applies only to non-corporate shoppers. It doesn't apply to B2B buyers or Admin users. + + >ℹ️ If no data is found for the given email, the job completes with `Success` status. + + >ℹ️ The system automatically retries failed operations up to 10 times before marking the job as `Failed`. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "jobId": "550e8400-e29b-41d4-a716-446655440000" + } + ``` diff --git a/BrunoCollections/VTEX - User Rights API/Data erasure/Get data erasure job status.yml b/BrunoCollections/VTEX - User Rights API/Data erasure/Get data erasure job status.yml new file mode 100644 index 0000000000..8523293a8d --- /dev/null +++ b/BrunoCollections/VTEX - User Rights API/Data erasure/Get data erasure job status.yml @@ -0,0 +1,82 @@ +info: + name: Get data erasure job status + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/user-rights/forget/jobs/:jobId" + headers: + - name: Accept + value: application/json + params: + - name: jobId + value: urn:uuid:a68f086c-8cbe-29bd-3135-85464b16de20 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/user-rights/forget/jobs/:jobId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/user-rights/forget/jobs/:jobId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/user-rights/forget/jobs/:jobId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/user-rights/forget/jobs/:jobId - Schema is valid", function () { + const schema = {"type":"object","required":["status","message"],"properties":{"status":{"type":"string","description":"Current state of the data erasure job. Possible values: `InProgress`, `Success`, or `Failed`.","enum":["InProgress","Success","Failed"]},"message":{"type":"string","description":"Human-readable description of the current job state."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + > ⚠️ This endpoint is in **closed beta** and currently available for selected accounts only. + + Retrieves the current status of a data erasure job created via the [Create data erasure job](https://developers.vtex.com/docs/api-reference/user-rights-api#post-/api/user-rights/forget/jobs) endpoint. + + Possible `status` values: + + - `InProgress`: The deletion is still being processed. Keep polling. + - `Success`: The user's data has been deleted. + - `Failed`: The deletion could not be completed. See the `message` field for details. + + >ℹ️ We recommend polling this endpoint with a frequency no higher than every 30 seconds. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `jobId` | path | (Required) Unique identifier of the data erasure job, returned by the [Create data erasure job](https://developers.vtex.com/docs/api-reference/user-rights-api#post-/api/user-rights/forget/jobs) endpoint. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "status": "InProgress", + "message": "Processing deletion request." + } + ``` diff --git a/BrunoCollections/VTEX - User Rights API/Data erasure/folder.yml b/BrunoCollections/VTEX - User Rights API/Data erasure/folder.yml new file mode 100644 index 0000000000..66ea87ff03 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights API/Data erasure/folder.yml @@ -0,0 +1,4 @@ +info: + name: Data erasure + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - User Rights API/environments/VTEX.yml b/BrunoCollections/VTEX - User Rights API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - User Rights API/opencollection.yml b/BrunoCollections/VTEX - User Rights API/opencollection.yml new file mode 100644 index 0000000000..958ea756c3 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights API/opencollection.yml @@ -0,0 +1,36 @@ +opencollection: 1.0.0 + +info: + name: VTEX - User Rights API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + > ⚠️ This API is in **closed beta** and currently available for selected accounts only. + + The User Rights API allows you to request the deletion of a user's personal data across VTEX applications, in compliance with "Right to be Forgotten" regulations. + + This API provides an automated workflow for handling data erasure requests. You submit a user's email, receive a job ID, and poll that ID until the deletion is complete. + + > ⚠️ The user rights flows available in this API apply only to non-corporate shoppers. They don't apply to B2B buyers or Admin users. + + >ℹ️ For personal data stored in Master Data custom entities, follow the existing data erasure process described in [Erasing customer data](https://help.vtex.com/docs/tutorials/erasing-customer-data). + + ## Operational behavior + + - **Automatic retries:** If something fails internally, the system retries up to 10 times before marking the job as `Failed`. You don't need to retry on your end. + - **Non-existent emails:** If no data is found for the given email, the job completes with `Success`. + - **Polling interval:** We recommend polling with a frequency no higher than every 30 seconds. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - User Rights Data API/User Data Rights/Delete user data.yml b/BrunoCollections/VTEX - User Rights Data API/User Data Rights/Delete user data.yml new file mode 100644 index 0000000000..1922b8c733 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights Data API/User Data Rights/Delete user data.yml @@ -0,0 +1,111 @@ +info: + name: Delete user data + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/user-rights/createAndProcessDeleteUserData?an=mystore" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: mystore + type: query + body: + type: json + data: |- + { + "email": "john@mail.com" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/user-rights/createAndProcessDeleteUserData - Schema is valid", function () { + const schema = {"type":"object","properties":{"uuid":{"type":"string","description":"User data rights request unique identifier in [UUID](https://www.uuidtools.com/what-is-uuid) format."},"requestType":{"type":"string","description":"Type of user data rights request."},"email":{"type":"string","description":"User email."},"status":{"type":"string","description":"Status of the user data rights request."},"dataResponse":{"type":"string","description":"Escaped JSON containing information about the status of data deletion on each VTEX system that stores user data."},"requestTime":{"type":"string","description":"Date of the user data rights request in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)format."},"applications":{"type":"array","description":"Array containing an object for each VTEX application that stores user data.","items":{"type":"object","description":"Object containing information about user data status in each VTEX application that stores user data.","properties":{"application":{"type":"string","description":"Abbreviated name of the application, which can be `chk` (Checkout), `orders` (Order Management System), `profileSystemV2` (PII Profile System) or `vid` (VTEX ID)."},"status":{"type":"string","description":"Status of user data in the given application."},"errorDetail":{"type":"string","description":"In case of error, this field contains an explanatory error message. Otherwise, this field is an empty string."},"updateAt":{"type":"string","description":"Date of the latest update in user data in the given application, in UTC format."}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Erases a given user's data collected from your store's customers by Checkout, Orders, VTEX ID and Profile System. + + >⚠️ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + + ## Example response (`200`) + + ```json + { + "uuid": "3e2f53dc-b099-4dc8-9727-581b2a97f39c", + "requestType": "Removal", + "email": "pedido2@vtexchallenge.com", + "status": "Completed", + "dataResponse": "{\r\n \"VTEX Checkout\": [],\r\n \"orders\": {\r\n \"dataStatus\": {\r\n \"status\": \"anonymized\",\r\n \"reason\": \"Sensitive information was anonymized rather than deleted to preserve the store metrics.\",\r\n \"evidence\": \"Anonymized [0] orders\",\r\n \"dryRun\": true\r\n },\r\n \"orders\": []\r\n },\r\n \"Profile System PII API\": {},\r\n \"VTEX ID\": {\r\n \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.4\",\r\n \"title\": \"Not Found\",\r\n \"status\": 404,\r\n \"traceId\": \"00-65d5abf9263b07eb185beee49e2075dc-b67b373e2e93dcf8-00\"\r\n }\r\n}", + "requestTime": "2023-09-05T17:19:33.1969022-03:00", + "applications": [ + { + "application": "chk", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:23" + }, + { + "application": "orders", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:25" + }, + { + "application": "profileSystemV2", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:26" + }, + { + "application": "vid", + "status": "Deleted", + "errorDetail": "", + "updateAt": "2023-09-05T20:20:29" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - User Rights Data API/User Data Rights/folder.yml b/BrunoCollections/VTEX - User Rights Data API/User Data Rights/folder.yml new file mode 100644 index 0000000000..30deccef06 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights Data API/User Data Rights/folder.yml @@ -0,0 +1,4 @@ +info: + name: User Data Rights + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - User Rights Data API/environments/VTEX.yml b/BrunoCollections/VTEX - User Rights Data API/environments/VTEX.yml new file mode 100644 index 0000000000..838d9e2071 --- /dev/null +++ b/BrunoCollections/VTEX - User Rights Data API/environments/VTEX.yml @@ -0,0 +1,6 @@ +name: VTEX +variables: + - name: baseUrl + value: http://api.vtexinternal.com + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - User Rights Data API/opencollection.yml b/BrunoCollections/VTEX - User Rights Data API/opencollection.yml new file mode 100644 index 0000000000..e337c0f05b --- /dev/null +++ b/BrunoCollections/VTEX - User Rights Data API/opencollection.yml @@ -0,0 +1,28 @@ +opencollection: 1.0.0 + +info: + name: VTEX - User Rights Data API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + According to data protection policies, such as [GDPR and LGPD](https://vtex.com/us-en/privacy-and-agreements/vtex-commitment/), companies using customer personal data are required to delete collected information upon the customer's request. User Data Rights API allows merchants to erase user data collected from your store's customers by Checkout, Orders, VTEX ID and Profile System, without depending on the VTEX Support flow described in the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide. + + >⚠️ This API is currently in closed alpha testing stage, which means that only specific customers can access it now. Do not share this documentation with people outside of your company. If you do not have access yet, please refer to the [Erasing customer data](https://help.vtex.com/en/tutorial/erasing-customer-data--1R9Fn7A06Ifj4R9YD4JTKU) guide instead. + + ## Index + + - `POST` [Delete user data](https://developers.vtex.com/docs/api-reference/user-data-rights-api#post-/api/user-rights/createAndProcessDeleteUserData) + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - VTEX Do API/Note/Create note.yml b/BrunoCollections/VTEX - VTEX Do API/Note/Create note.yml new file mode 100644 index 0000000000..fcca02f86e --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Note/Create note.yml @@ -0,0 +1,111 @@ +info: + name: Create note + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/notes" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "target": { + "id": "v964735bdev-01", + "type": "order", + "url": "https://basedevmkp.environment.com/admin/checkout/#/orders/v964741bdev-01" + }, + "domain": "oms", + "description": "Order ID in the marketplace is 786-09.", + "createdBy": { + "id": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "name": "Mario Smith" + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/notes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/notes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/notes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/notes - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Note ID."},"domain":{"type":"string","description":"VTEX module `oms`."},"owner":{"type":"string","description":"Owner ID."},"target":{"type":"object","description":"Target object information.","properties":{"id":{"type":"string","description":"Order ID."},"type":{"type":"string","description":"Target type."},"url":{"type":"string","description":"Target URL."}}},"description":{"type":"string","description":"Note description."},"creationDate":{"type":"string","description":"Creation date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"lastUpdate":{"type":"string","description":"Last update date in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`."},"createdBy":{"type":["object","null"],"description":"Identification of the user who created the note.","properties":{"id":{"type":"string","description":"User ID."},"name":{"type":"string","description":"User name."},"email":{"type":"string","description":"User email."},"key":{"type":["string","null"],"description":"Authentication key used."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new note in [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu). Be aware of the following limitations: + + + - The maximum number of notes for an order is 30. + + + - The maximum number of characters in a note's description is 2000. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "id": "A08CDB2519AC4FA49EB6099CF72C3642", + "domain": "oms", + "owner": "c97ef6c8491a439f927cf9918644329f", + "target": { + "id": "v964735bdev-01", + "type": "order", + "url": "https://basedevmkp.environment.com.br/admin/checkout/#/orders/v964741bdev-01" + }, + "description": "Order ID in the marketplace is 786-09.", + "creationDate": "2024-03-11T15:49:17.8785392Z", + "lastUpdate": "2024-05-11T15:49:17.8785392Z", + "createdBy": { + "id": "fb542e51-5488-4c34-8d17-ed8fcf597a94", + "name": "Mario Smith", + "email": "mario.smith@store.com", + "key": "appkey-appvtex" + } + } + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Note/Get notes by order ID.yml b/BrunoCollections/VTEX - VTEX Do API/Note/Get notes by order ID.yml new file mode 100644 index 0000000000..77c31c7586 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Note/Get notes by order ID.yml @@ -0,0 +1,91 @@ +info: + name: Get notes by order ID + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/notes?target.id=1172452900788-01" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: target.id + value: 1172452900788-01 + type: query + - name: perPage + value: "20" + type: query + disabled: true + - name: page + value: "3" + type: query + disabled: true + - name: reason + value: data-validation + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/notes - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/notes - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/notes - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/notes - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves notes related to a specific order ID. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `target.id` | query | (Required) Order ID. | + | `perPage` | query | Number of notes per page. Maximum: 30. | + | `page` | query | Number of the page to be retrieved. | + | `reason` | query | This parameter is relevant only for accounts using [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus). When sending requests to this endpoint, accounts with the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) can use this parameter to declare the reason for requesting unmasked data. Otherwise, this endpoint will return masked PII data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Note/Retrieve note.yml b/BrunoCollections/VTEX - VTEX Do API/Note/Retrieve note.yml new file mode 100644 index 0000000000..125a78c73e --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Note/Retrieve note.yml @@ -0,0 +1,81 @@ +info: + name: Retrieve note + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/notes/:noteId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: reason + value: data-validation + type: query + disabled: true + - name: noteId + value: 654321cba + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/notes/:noteId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/notes/:noteId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/notes/:noteId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/notes/:noteId - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a given note in [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu), filtering by note ID. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `noteId` | path | (Required) Note ID. | + | `reason` | query | This parameter is relevant only for accounts using [Data Protection Plus](https://developers.vtex.com/docs/guides/data-protection-plus). When sending requests to this endpoint, accounts with the [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) can use this parameter to declare the reason for requesting unmasked data. Otherwise, this endpoint will return masked PII data. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Note/folder.yml b/BrunoCollections/VTEX - VTEX Do API/Note/folder.yml new file mode 100644 index 0000000000..aa11534d1f --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Note/folder.yml @@ -0,0 +1,4 @@ +info: + name: Note + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/Add comment on a task.yml b/BrunoCollections/VTEX - VTEX Do API/Task/Add comment on a task.yml new file mode 100644 index 0000000000..88c70c569d --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/Add comment on a task.yml @@ -0,0 +1,82 @@ +info: + name: Add comment on a task + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/tasks/:taskId/comments" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: taskId + value: 123456abc + type: path + body: + type: json + data: |- + { + "text": "write your comment here" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/tasks/:taskId/comments - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/tasks/:taskId/comments - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/tasks/:taskId/comments - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/tasks/:taskId/comments - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Adds a comment to a [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu) task, filtering by task ID. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `taskId` | path | (Required) Task ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/Create task.yml b/BrunoCollections/VTEX - VTEX Do API/Task/Create task.yml new file mode 100644 index 0000000000..95c2b0c22b --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/Create task.yml @@ -0,0 +1,113 @@ +info: + name: Create task + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/tasks" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: json + data: |- + { + "target": [ + { + "id": "v964735bdev-01", + "type": "order", + "url": "https://basedevmkp.environment.com.br/admin/checkout/#/orders/v964741bdev-01" + }, + { + "id": "v964735bdev-01", + "type": "order", + "url": "https://basedevmkp.environment.com.br/admin/checkout/#/orders/v964741bdev-01" + } + ], + "domain": "oms", + "context": "Marketplace", + "name": "pricing", + "priority": "Critical", + "surrogateKey": "5052243-0", + "dueDate": "2024-05-01", + "assignee": { + "email": "blake.smith@email.com", + "id": null, + "name": "Blake Smith" + }, + "followers": [ + { + "email": "celaena.sardothien@email.com", + "id": null, + "name": "Celaena Sardothien" + }, + { + "email": "celaena.sardothien@email.com", + "id": null, + "name": "Celaena Sardothien" + } + ], + "description": "This task is important", + "parentTaskId": null + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/tasks - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/tasks - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/tasks - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/tasks - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new task in [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu). + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/List tasks.yml b/BrunoCollections/VTEX - VTEX Do API/Task/List tasks.yml new file mode 100644 index 0000000000..84c1c321f7 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/List tasks.yml @@ -0,0 +1,158 @@ +info: + name: List tasks + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/tasks" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: assignee.email + value: assigneeName@email.com + type: query + disabled: true + - name: target.id + value: "{{targetId}}" + type: query + disabled: true + - name: context + value: page + type: query + disabled: true + - name: page + value: "{{page}}" + type: query + disabled: true + - name: perPage + value: "{{desired number per page}}" + type: query + disabled: true + - name: status + value: open + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/tasks - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/tasks - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/tasks - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/tasks - Schema is valid", function () { + const schema = {"type":"object","properties":{"piiHidden":{"type":"boolean","description":"If the VTEX account uses [PII data architecture](https://developers.vtex.com/docs/guides/pii-data-architecture-specifications) (`true`), or not (`false`)."},"items":{"type":"array","description":"Task items array.","items":{"type":"object","description":"Task item object.","properties":{"comments":{"type":["array","null"],"description":"Task item comments list.","items":{"type":"string","description":"Task item comment."}},"id":{"type":["string","null"],"description":"Task item ID."},"surrogateKey":{"type":"string","description":"[Surrogate key](https://www.ibm.com/docs/en/ida/9.1?topic=keys-surrogate) unique identifier of the task item."},"domain":{"type":"string","description":"Task item domain in the VTEX environment."},"target":{"type":"array","description":"Task item target array.","items":{"type":"object","description":"Task item target details.","properties":{"id":{"type":"string","description":"Task item target ID."},"type":{"type":"string","description":"Task item target type."},"url":{"type":"string","description":"Task item target URL."}}}},"name":{"type":"string","description":"Task item name."},"translateMapping":{"type":"object","description":"Task item translate mapping.","properties":{"ar":{"type":"string","description":"Task item Arabic translation."},"bg":{"type":"string","description":"Task item Bulgarian translation."},"en":{"type":"string","description":"Task item English translation."},"es":{"type":"string","description":"Task item Spanish translation."},"fr":{"type":"string","description":"Task item French translation."},"it":{"type":"string","description":"Task item Italian translation."},"ja":{"type":"string","description":"Task item Japanese translation."},"ko":{"type":"string","description":"Task item Korean translation."},"nl":{"type":"string","description":"Task item Dutch translation."},"pt":{"type":"string","description":"Task item Portuguese translation."},"ro":{"type":"string","description":"Task item Romanian translation."},"th":{"type":"string","description":"Task item Thai translation."}}},"context":{"type":"string","description":"Task item context."},"priority":{"type":"string","description":"Task item level of priority."},"status":{"type":"string","description":"Task item status."},"creationDate":{"type":"string","description":"Task item creation date and time in in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DD hh:mm:ss[.nnnnnnn]Z`."},"assignee":{"type":["object","null"],"description":"Task item assignee.","properties":{"id":{"type":["string","null"],"description":"Task item assignee ID."},"name":{"type":"string","description":"Task item assignee name."},"email":{"type":"string","description":"Task item assignee email."},"key":{"type":["string","null"],"description":"Task item assignee key."}}}}}},"paging":{"type":"object","description":"Object with information about pagination.","properties":{"page":{"type":"integer","description":"Task item page number."},"perPage":{"type":"integer","description":"Task items per page."},"total":{"type":"integer","description":"Total task items."},"pages":{"type":"integer","description":"Total task pages."}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint allows you to filter [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu) tasks. You can choose between the following filtering options: + + - **Assignees:** using `assignee.email` and `status`. Example: `https://{{accountName}}.{{environment}}.com.br/api/do/tasks?assignee.email={{person@email.com}}&status={{open}}`. + + - **Targets:** using `targetId` and `status`. Example: `https://{{accountName}}.{{environment}}.com.br/api/do/tasks?target.id={{name}}&status={{open}}`. + + - **Paged tasks:** using `page`, `perPage` and `status`. Example: `https://{{accountName}}.{{environment}}.com.br/api/do/tasks?page={{1}}&perPage={{10}}&status=;{{-Closed}}`. + + - **Context:** using `context`, `page`, `perPage` and `status`. Example: `https://{{accountName}}.{{environment}}.com.br/api/do/tasks?context={{context}}&page={{1}}&perPage={{10}}&status={{-Closed}}`. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `assignee.email` | query | If you wish to list tasks by assignee, insert the desired assignee's email and status. | + | `target.id` | query | If you wish to list tasks by target, insert the desired `targetId` and `status`. | + | `context` | query | If you wish to list tasks by context, insert the desired context, `page`, `perPage` and `status`. | + | `page` | query | If you wish to list tasks by context, also insert the desired `page`. | + | `perPage` | query | If you wish to list tasks by context, also insert the desired `perPage` value. | + | `status` | query | If you wish to list tasks by context, also insert the desired `status`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "piiHidden": false, + "items": [ + { + "comments": [], + "id": "E599F4EC87084366BDB40DD4EC6F1626", + "surrogateKey": "AV-1457-0", + "domain": "gtw", + "target": [ + { + "id": "AV-1457-0", + "type": "payment", + "url": "/admin/pci-gateway#/transactions/B87AEE1124CA48C99B47F88142F95F04" + } + ], + "name": "gtw.cancelManualPayment", + "translateMapping": { + "ar": "مراجعة الدفع قصد للإلغاء", + "bg": "Разгледайте плащането за отказ", + "en": "Review payment to cancel", + "es": "Revisar pago para cancelar", + "fr": "Revoir le paiement pour l'annuler", + "it": "Rivedi il pagamento per annullarlo", + "ja": "キャンセルする支払いをレビュー", + "ko": "취소하려면 지불 검토", + "nl": "Betaling herzien om te annuleren", + "pt": "Revisar pagamento para cancelar", + "ro": "Revizuiește plata pentru a o anula", + "th": "ทบทวนการชำระเงินที่จะยกเลิก" + }, + "context": "Marketplace", + "priority": "Normal", + "status": "Open", + "creationDate": "2024-04-17T15:51:08.6980189", + "assignee": { + "id": null, + "name": "Blake Smith", + "email": "blake.smith@email.com", + "key": null + } + } + ], + "paging": { + "page": 1, + "perPage": 10, + "total": 840, + "pages": 84 + } + } + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/Retrieve task.yml b/BrunoCollections/VTEX - VTEX Do API/Task/Retrieve task.yml new file mode 100644 index 0000000000..af5bc64853 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/Retrieve task.yml @@ -0,0 +1,76 @@ +info: + name: Retrieve task + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/tasks/:taskId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: taskId + value: 123456abc + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/tasks/:taskId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/tasks/:taskId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/tasks/:taskId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/tasks/:taskId - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves a given [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu) task, filtering by task ID. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `taskId` | path | (Required) Task ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/Update task.yml b/BrunoCollections/VTEX - VTEX Do API/Task/Update task.yml new file mode 100644 index 0000000000..fbc8255151 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/Update task.yml @@ -0,0 +1,82 @@ +info: + name: Update task + type: http + seq: 4 + +http: + method: PUT + url: "{{baseUrl}}/tasks/:taskId" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: taskId + value: 123456abc + type: path + body: + type: json + data: |- + { + "status": "InProgress" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PUT]::/tasks/:taskId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PUT]::/tasks/:taskId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PUT]::/tasks/:taskId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PUT]::/tasks/:taskId - Schema is valid", function () { + const schema = {}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Updates the status of a [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu) task, filtering by task ID. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `taskId` | path | (Required) Task ID. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + {} + ``` diff --git a/BrunoCollections/VTEX - VTEX Do API/Task/folder.yml b/BrunoCollections/VTEX - VTEX Do API/Task/folder.yml new file mode 100644 index 0000000000..bc7a29a6ed --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/Task/folder.yml @@ -0,0 +1,4 @@ +info: + name: Task + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - VTEX Do API/environments/VTEX.yml b/BrunoCollections/VTEX - VTEX Do API/environments/VTEX.yml new file mode 100644 index 0000000000..b1ab7c7719 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br/api/do + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - VTEX Do API/opencollection.yml b/BrunoCollections/VTEX - VTEX Do API/opencollection.yml new file mode 100644 index 0000000000..25cdd844ed --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Do API/opencollection.yml @@ -0,0 +1,48 @@ +opencollection: 1.0.0 + +info: + name: VTEX - VTEX Do API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [VTEX DO](https://help.vtex.com/en/tutorial/vtex-do--7KMbRL4OslN8DTX9oiuCiu) is a task management system for authorized [users](https://help.vtex.com/en/tutorial/how-to-manage-users--tutorials_512) to process VTEX store orders. The functionality allows you to control notes, and create, update, list, and retrieve tasks. + + ## VTEX DO API Index + + ### Note + + - `POST` [Create Note](https://developers.vtex.com/docs/api-reference/vtex-do-api#post-/notes) + - `GET` [Get Notes by orderId](https://developers.vtex.com/docs/api-reference/vtex-do-api#get-/notes) + - `GET` [Retrieve Note](https://developers.vtex.com/docs/api-reference/vtex-do-api#get-/notes/-noteId-) + + ### Task + + - `POST` [Create Task](https://developers.vtex.com/docs/api-reference/vtex-do-api#post-/tasks) + - `GET` [List tasks](https://developers.vtex.com/docs/api-reference/vtex-do-api#get-/tasks) + - `GET` [Retrieve Task](https://developers.vtex.com/docs/api-reference/vtex-do-api#get-/tasks/-taskId-) + - `PUT` [Update Task](https://developers.vtex.com/docs/api-reference/vtex-do-api#put-/tasks/-taskId-) + - `POST` [Add Comment on a Task](https://developers.vtex.com/docs/api-reference/vtex-do-api#post-/tasks/-taskId-/comments) + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Check authenticated user.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Check authenticated user.yml new file mode 100644 index 0000000000..bd83cd019b --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Check authenticated user.yml @@ -0,0 +1,94 @@ +info: + name: Check authenticated user + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/credential/validate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/credential/validate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/credential/validate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/credential/validate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/credential/validate - Schema is valid", function () { + const schema = {"type":"object","properties":{"authStatus":{"type":"string","description":"Authentication status."},"id":{"type":"string","description":"Unique identifier of the user within VTEX services."},"user":{"type":"string","description":"User email."},"account":{"type":"string","description":"VTEX account name."},"audience":{"type":"string","description":"Type of user."},"tokenType":{"type":"string","description":"Type of token."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves information about the user who is currently authenticated in your store, given an user token. If the user is not authenticated, the response for this API will be `401 (Unauthorized)`. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `environment` | path | (Required) Environment to be used in the request. | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authStatus": "Success", + "id": "1f6c17e5-06f9-44a9-a459-b3686e03fa9d", + "user": "john@mail.com", + "account": "apiexamples", + "audience": "admin", + "tokenType": "user" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Enable or disable repeated passwords.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Enable or disable repeated passwords.yml new file mode 100644 index 0000000000..388addae90 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Enable or disable repeated passwords.yml @@ -0,0 +1,64 @@ +info: + name: Enable or disable repeated passwords + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/pub/providers/setup/password/webstore/password" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + body: + type: json + data: |- + { + "isActive": true, + "allowRepeated": false + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/vtexid/pub/providers/setup/password/webstore/password - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Defines if user passwords can be repeated in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | VTEX ID | Identity Providers | **Write Identity Providers** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Exchange OAuth access token for VTEX credential.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Exchange OAuth access token for VTEX credential.yml new file mode 100644 index 0000000000..b606372e92 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Exchange OAuth access token for VTEX credential.yml @@ -0,0 +1,93 @@ +info: + name: Exchange OAuth access token for VTEX credential + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/audience/webstore/provider/oauth/exchange" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + body: + type: json + data: |- + { + "providerId": "custom-oauth-provider", + "accessToken": "dsfDShdgfhDFI1NiIsIrtyZCI6IjFBRjI5MUUwRDY0MERENTlEQTkzRTg0REMxNjQyNjA3ODZEQjY3ODAiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJ2dGV4YXBwa2V5LXZ0ZXhoZWxwLVdWQ0FCVCIsImFjY291bdg465DATU4GVscCIsImF1MBllbmNlIjoiYWRtaW4iLCJleHAiOjE2Njk3NzA3MzcsInVzZXJJZCI6IjM5MjNhMmUy5khmMTctNGNiYy04YzU3LWQ3OGFkNmUxYTU2NiIsImlhdCI6MTY2OTc0OTEzNywiaXNzIjoidG9rZW4tZW1HgoRlciIsImp0aSI6IjNiNjAxODA2LTExMzEtNDcwYS05MWJjLTVhM2JhOThiYWQyNiJ9.Q7N8MFa1FMJsQUpxBY29oije4aa-654fgjLFLl6LUY3Wei3MRUVUMRQWkey6Kug8iFPonZ1L-PaFmwfzSz3TCQ", + "duration": 90 + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/audience/webstore/provider/oauth/exchange - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/audience/webstore/provider/oauth/exchange - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/audience/webstore/provider/oauth/exchange - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/audience/webstore/provider/oauth/exchange - Schema is valid", function () { + const schema = {"type":"object","properties":{"authToken":{"type":"string","description":"Authentication token. Use this token to authenticate your requests to VTEX APIs."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + If your store uses a headless frontend, you can authenticate users via OAuth and use this endpoint to exchange the OAuth access token for a VTEX authentication token. This VTEX token can be used to authenticate your frontend requests to VTEX APIs. + + + Learn more about how to implement [headless authentication](https://developers.vtex.com/docs/guides/headless-authentication) in your store. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of your VTEX account. | + | `environment` | path | (Required) Environment to be used in the request. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authToken": "eyJhbGciOiJFUzI1NiIsIrtyZCI6IjFBRjI5MUUwRDY0MERENTlEQTkzRTg0REMxNjQyNjA3ODZEQjY3ODAiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJ2dGV4YXBwa2V5LXZ0ZXhoZWxwLVdWQ0FCVCIsImFjY291bnQiOiJwerV4aGVscCIsImF1MBllbmNlIjoiYWRtaW4iLCJleHAiOjE2Njk3NzA3MzcsInVzZXJJZCI6IjM5MjNhMmUy5khmMTctNGNiYy04YzU3LWQ3OGFkNmUxYTU2NiIsImlhdCI6MTY2OTc0OTEzNywiaXNzIjoidG9rZW4tZW1HgoRlciIsImp0aSI6IjNiNjAxODA2LTExMzEtNDcwYS05MWJjLTVhM2JhOThiYWQyNiJ9.Q7N8MFa1FMJsQUpxBY29oije4aa-Jf463lwgLFLl6LUY3Wei3MRUVUMRQWkey6Kug8iFPonZ1L-PaFmwfzSz3TCQ" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Expire user password.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Expire user password.yml new file mode 100644 index 0000000000..c5d8fc0e86 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Expire user password.yml @@ -0,0 +1,65 @@ +info: + name: Expire user password + type: http + seq: 5 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/password/expire?email=email@email.com" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: email@email.com + type: query + - name: accountName + value: apiexamples + type: path + - name: environment + value: vtexcommercestable + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/vtexid/password/expire - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Expires an user's password in your store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | VTEX ID | User Management | **Expire User Password** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | (Required) Name of your VTEX account. | + | `environment` | path | (Required) Environment to be used in the request. | + | `email` | query | (Required) User email. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Generate authentication token.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Generate authentication token.yml new file mode 100644 index 0000000000..10e91a16c1 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Generate authentication token.yml @@ -0,0 +1,94 @@ +info: + name: Generate authentication token + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/apptoken/login" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: an + value: exampleAccount + type: query + disabled: true + body: + type: json + data: |- + { + "appkey": "vtexappkey-example-YSWQFZ", + "apptoken": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjA1MTZFN0IwMDNFODMxRTg0QkFDOTg2NzBCNUM2QTRERTlBN0RFNkUiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJwZWRyby5jb3N0YUB2dGV4LmNvbS5iciIsImFjY291bnQiOiJhcHBsaWFuY2V0aGVtZSIsImF1ZGllbmNlIjoiYWRtaW4iLCJzZXNzIjoiZjU3YjMyMGItMWE3YS00YzlkLWJkNDMtZTE4NDdhYmE1MTE1IiwiZXhwIjoxNjE2NzY3Mjc4LCJ1c2VySWQiOiJmYjU0MmU1MS01NDg4LTRjMzQtOGQxNy1lZDhmY2Y1OTdhOTQiLCJpYXQiOjE2MwerY2ODA4NzgsImlzcyI6InRva2VuLWVtaXR0ZXIiLCJqdGkiOiJmYTI0YWJiOC03Y2E5LTQ3NjUtYmYzNC1kMmvU5YTgzYjYxZmUifQ.23rn-2dEdAAYXJX2exrxDEdbieyKWsVKABeSUNeFWyhz7xRd7d5EcxwiMLjM3bRaBOKrAA9Op7ocn89c45qQ" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/apptoken/login - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/apptoken/login - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/apptoken/login - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/apptoken/login - Schema is valid", function () { + const schema = {"type":"object","properties":{"authStatus":{"type":"string","description":"Authentication status."},"token":{"type":"string","description":"Authentication token."},"expires":{"type":"integer","description":"Token expiration Unix timestamp in seconds."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Generate a [token](https://developers.vtex.com/vtex-rest-api/docs/getting-started-authentication#user-token) from a given [app key and app token](https://help.vtex.com/en/tutorial/api-keys--2iffYzlvvz4BDMr6WGUtet) pair. You can use this token to authenticate requests to VTEX APIs by sending it as a header named `VtexIdclientAutCookie`. The token's permissions are the same as [defined to the credential pair](https://help.vtex.com/en/tutorial/api-keys--2iffYzlvvz4BDMr6WGUtet#managing-app-key-permissions). + + + > Since you are sending the credentials on the request body, there is no need to send authentication headers. + + + > It is also possible to make this request using the `https://api.vtexcommercestable.com.br/api/vtexid/apptoken/login?an={accountName}` route, replacing `{accountName}` with your VTEX account name. This is the only case where you need to use the `an` query parameter. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `an` | query | Name of your VTEX account. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authStatus": "Success", + "token": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjFBRjI5MUUwRDY0MERENTlEQTkzRTg0REMxNjQyNjA3ODZEQjY3ODAiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJ2dGV4YXBwa2V5LXZ0ZXhoZWxwLVdWQ0FCVCIsImFjY291bnQiOiJwerV4aGVscCIsImF1ZGllbmNlIjoiYWRtaW4iLCJleHAiOjE2Njk3NzA3MzcsInVzZXJJZCI6IjM5MjNhMmUy5khmMTctNGNiYy04YzU3LWQ3OGFkNmUxYTU2NiIsImlhdCI6MTY2OTc0OTEzNywiaXNzIjoidG9rZW4tZW1HgoRlciIsImp0aSI6IjNiNjAxODA2LTExMzEtNDcwYS05MWJjLTVhM2JhOThiYWQyNiJ9.Q7N8MFa1FMJsQUpxBY29oije4aa-Jf29wgLFLl6LUY3Wei3MRUVUMRQWkey6Kug8iFPonZ1L-PaFmwfzSz3TCQ", + "expires": 1669770737 + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/Get user ID by email.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/Get user ID by email.yml new file mode 100644 index 0000000000..d49e1b8779 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/Get user ID by email.yml @@ -0,0 +1,82 @@ +info: + name: Get user ID by email + type: http + seq: 6 + +http: + method: GET + url: "{{baseUrl}}/api/vtexid/pvt/user/id?usuario=john%40mail.com" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: usuario + value: john%40mail.com + type: query + auth: + type: apikey + key: VtexIdclientAutCookie + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vtexid/pvt/user/id - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vtexid/pvt/user/id - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vtexid/pvt/user/id - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vtexid/pvt/user/id - Schema is valid", function () { + const schema = {"type":"string","description":"User ID.","nullable":true}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Retrieves the unique user ID for a given email address. + + ## Permissions + + This endpoint does not require [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). However, it does require a valid user token (`VtexIdclientAutCookie`) to be included in the request headers. + + To learn more about user authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#user-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `usuario` | query | (Required) User email address. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + 1f6c17e5-06f9-44a9-a459-b3686e03fa9d + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Authentication/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Authentication/folder.yml new file mode 100644 index 0000000000..3f929f49d6 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Authentication + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Delete organization unit authentication setting.yml b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Delete organization unit authentication setting.yml new file mode 100644 index 0000000000..5bc965f473 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Delete organization unit authentication setting.yml @@ -0,0 +1,81 @@ +info: + name: Delete organization unit authentication setting + type: http + seq: 4 + +http: + method: DELETE + url: "{{baseUrl}}/api/vtexid/organization-units/:unitId/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: unitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "settings": [ + { + "type": "OAuth" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/vtexid/organization-units/:unitId/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/vtexid/organization-units/:unitId/settings - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Deletes only the authentication configuration entries listed in the request body `settings` array (each entry is identified by `type`, for example `OAuth`). Other organization unit authentication configuration is not removed. Use with care when deleting unit-specific SSO configuration. + + >⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/en/docs/tutorials/b2b-buyer-portal), which is currently available to select accounts. + + >ℹ️ These endpoints configure authentication methods for an organization unit (for example password or SSO). To manage unit hierarchy and membership, use the [Organization Units API](https://developers.vtex.com/docs/api-reference/organization-units-api). For more information about organization units, see [Organization units](https://help.vtex.com/docs/tutorials/organizational-units). Send the `VtexIdclientAutCookie` user token header, or the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier (GUID) of the organization unit from which the listed authentication settings will be deleted. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Get organization unit authentication settings.yml b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Get organization unit authentication settings.yml new file mode 100644 index 0000000000..2b4b48a03c --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Get organization unit authentication settings.yml @@ -0,0 +1,104 @@ +info: + name: Get organization unit authentication settings + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/vtexid/organization-units/:unitId/settings" + headers: + - name: Accept + value: application/json + params: + - name: unitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vtexid/organization-units/:unitId/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vtexid/organization-units/:unitId/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vtexid/organization-units/:unitId/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vtexid/organization-units/:unitId/settings - Schema is valid", function () { + const schema = {"type":"object","description":"Authentication settings for the organization unit.","required":["authenticationMethods"],"properties":{"authenticationMethods":{"type":"array","description":"List of authentication methods available for the organization unit.","items":{"type":"object","description":"Single authentication method entry.","required":["type","name","status"],"properties":{"type":{"type":"string","description":"Machine-readable authentication method type: `Password` for password login or `OAuth` for SSO through an external identity provider.","enum":["Password","OAuth"]},"name":{"type":"string","description":"Human-readable label of the method, such as the configured identity provider name."},"status":{"type":"string","description":"Whether the method is enabled for this organization unit.","enum":["Enabled","Disabled"]}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns the authentication methods configured for an organization unit, such as password login and external identity provider (SSO), including whether each method is enabled. + + >⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/en/docs/tutorials/b2b-buyer-portal), which is currently available to select accounts. + + >ℹ️ These endpoints configure authentication methods for an organization unit (for example password or SSO). To manage unit hierarchy and membership, use the [Organization Units API](https://developers.vtex.com/docs/api-reference/organization-units-api). For more information about organization units, see [Organization units](https://help.vtex.com/docs/tutorials/organizational-units). Send the `VtexIdclientAutCookie` user token header, or the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **View_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier (GUID) of the organization unit whose authentication settings are being read. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authenticationMethods": [ + { + "type": "Password", + "name": "Password", + "status": "Enabled" + }, + { + "type": "OAuth", + "name": "PingFederate", + "status": "Enabled" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Set organization unit authentication settings.yml b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Set organization unit authentication settings.yml new file mode 100644 index 0000000000..558801ec9a --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Set organization unit authentication settings.yml @@ -0,0 +1,115 @@ +info: + name: Set organization unit authentication settings + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/organization-units/:unitId/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: unitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "settings": [ + { + "type": "OAuth", + "name": "PingFederate", + "status": "Disabled" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/organization-units/:unitId/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/organization-units/:unitId/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/organization-units/:unitId/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/organization-units/:unitId/settings - Schema is valid", function () { + const schema = {"type":"object","description":"Acknowledgement of a successful update.","properties":{"success":{"type":"boolean","description":"Indicates that the update completed without errors."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Defines authentication settings for an organization unit, for example enabling or disabling SSO for a configured external identity provider. Send each method to change using its display `name` and desired `status`. + + >⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/en/docs/tutorials/b2b-buyer-portal), which is currently available to select accounts. + + >ℹ️ These endpoints configure authentication methods for an organization unit (for example password or SSO). To manage unit hierarchy and membership, use the [Organization Units API](https://developers.vtex.com/docs/api-reference/organization-units-api). For more information about organization units, see [Organization units](https://help.vtex.com/docs/tutorials/organizational-units). Send the `VtexIdclientAutCookie` user token header, or the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers. + + ## Prerequisites + + Before enabling login via external IdP, ensure the following requirements are met: + + - The identity provider must be previously configured in the VTEX Admin. Learn more in [Login (SSO)](https://developers.vtex.com/docs/guides/login-integration-guide) and [Webstore (OAuth 2.0)](https://developers.vtex.com/docs/guides/login-integration-guide-webstore-oauth2). + - The [vtex.login-alternative-key](https://developers.vtex.com/docs/apps/vtex.login-alternative-key) app must be installed in the store. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier (GUID) of the organization unit whose authentication settings are being updated. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "success": true + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Update organization unit authentication settings.yml b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Update organization unit authentication settings.yml new file mode 100644 index 0000000000..307e89da2f --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/Update organization unit authentication settings.yml @@ -0,0 +1,120 @@ +info: + name: Update organization unit authentication settings + type: http + seq: 3 + +http: + method: PATCH + url: "{{baseUrl}}/api/vtexid/organization-units/:unitId/settings" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: unitId + value: 8d8b68e2-89e1-4d9f-b7c3-3a7f2c8e9d1a + type: path + body: + type: json + data: |- + { + "settings": [ + { + "type": "OAuth", + "status": "Disabled" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/vtexid/organization-units/:unitId/settings - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/vtexid/organization-units/:unitId/settings - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/vtexid/organization-units/:unitId/settings - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/vtexid/organization-units/:unitId/settings - Schema is valid", function () { + const schema = {"type":"object","description":"Authentication settings for the organization unit.","required":["authenticationMethods"],"properties":{"authenticationMethods":{"type":"array","description":"List of authentication methods available for the organization unit.","items":{"type":"object","description":"Single authentication method entry.","required":["type","name","status"],"properties":{"type":{"type":"string","description":"Machine-readable authentication method type: `Password` for password login or `OAuth` for SSO through an external identity provider.","enum":["Password","OAuth"]},"name":{"type":"string","description":"Human-readable label of the method, such as the configured identity provider name."},"status":{"type":"string","description":"Whether the method is enabled for this organization unit.","enum":["Enabled","Disabled"]}}}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Partially updates authentication configurations that already exist for the organization unit (for example changing `status`). This endpoint doesn't create new authentication methods; use `POST` [Set organization unit authentication settings](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/vtexid/organization-units/-unitId-/settings) to define or add them. + + Send a `settings` array in which each object specifies the configuration `type` (for example `OAuth`) and the desired `status` for that existing configuration. + + >⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/en/docs/tutorials/b2b-buyer-portal), which is currently available to select accounts. + + >ℹ️ These endpoints configure authentication methods for an organization unit (for example password or SSO). To manage unit hierarchy and membership, use the [Organization Units API](https://developers.vtex.com/docs/api-reference/organization-units-api). For more information about organization units, see [Organization units](https://help.vtex.com/docs/tutorials/organizational-units). Send the `VtexIdclientAutCookie` user token header, or the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Organization Units | units | **Edit_Organization_Unit** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `unitId` | path | (Required) Unique identifier (GUID) of the organization unit whose authentication settings are being patched. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authenticationMethods": [ + { + "type": "Password", + "name": "Password", + "status": "Enabled" + }, + { + "type": "OAuth", + "name": "PingFederate", + "status": "Enabled" + } + ] + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/folder.yml new file mode 100644 index 0000000000..608d93ff20 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Organization account authentication/folder.yml @@ -0,0 +1,4 @@ +info: + name: Organization account authentication + type: folder + seq: 6 diff --git a/BrunoCollections/VTEX - VTEX ID API/Password migration/Delete password migration configuration.yml b/BrunoCollections/VTEX - VTEX ID API/Password migration/Delete password migration configuration.yml new file mode 100644 index 0000000000..6ebfe8c25e --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Password migration/Delete password migration configuration.yml @@ -0,0 +1,54 @@ +info: + name: Delete password migration configuration + type: http + seq: 3 + +http: + method: DELETE + url: "{{baseUrl}}/api/authenticator/v1/tenants/features/:name" + headers: + - name: Accept + value: application/json + params: + - name: name + value: PasswordMigration + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/authenticator/v1/tenants/features/:name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[DELETE]::/api/authenticator/v1/tenants/features/:name - Response has empty Body", function () { + const data = res.getBody(); + expect(data === undefined || data === null || data === "").to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Removes the B2B password migration configuration from your account entirely, including all middleware endpoint settings and HMAC credentials. After deletion, legacy password validation will no longer be available. + + For more information, see the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + > ⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/docs/tutorials/b2b-buyer-portal), which is currently available to selected accounts. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `name` | path | (Required) Feature name for password migration. Must be `PasswordMigration`. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Password migration/Enable or disable password migration.yml b/BrunoCollections/VTEX - VTEX ID API/Password migration/Enable or disable password migration.yml new file mode 100644 index 0000000000..4165fdfd4c --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Password migration/Enable or disable password migration.yml @@ -0,0 +1,58 @@ +info: + name: Enable or disable password migration + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/authenticator/v1/tenants/features/:name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: name + value: PasswordMigration + type: path + body: + type: json + data: |- + { + "enabled": true + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PATCH]::/api/authenticator/v1/tenants/features/:name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Enables or disables the B2B password migration feature for your account without removing the configuration. When disabled, legacy password validation will not be performed, even for users with `isLegacyPassword=true`. + + For more information, see the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + > ⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/docs/tutorials/b2b-buyer-portal), which is currently available to selected accounts. + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `name` | path | (Required) Feature name for password migration. Must be `PasswordMigration`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Password migration/Upsert password migration configuration.yml b/BrunoCollections/VTEX - VTEX ID API/Password migration/Upsert password migration configuration.yml new file mode 100644 index 0000000000..3d2ac23bf5 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Password migration/Upsert password migration configuration.yml @@ -0,0 +1,70 @@ +info: + name: Upsert password migration configuration + type: http + seq: 1 + +http: + method: PUT + url: "{{baseUrl}}/api/authenticator/v1/tenants/features/:name" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: name + value: PasswordMigration + type: path + body: + type: json + data: |- + { + "clientId": "vtex-b2b-store", + "idpEndpoint": "https://auth-middleware.example.com/authentication", + "secret": "aGlnaC1lbnRyb3B5LXNlY3JldC1rZXktZXhhbXBsZQ==" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[PUT]::/api/authenticator/v1/tenants/features/:name - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Configures or updates the external authentication middleware settings for B2B password migration. This endpoint registers the middleware URL and HMAC credentials that VTEX will use to validate legacy user credentials during their first login. + + Once configured, users with the `isLegacyPassword` flag set to `true` will have their credentials validated against the configured middleware endpoint on their first login attempt. + + For more information, see the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration). + + > ⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/docs/tutorials/b2b-buyer-portal), which is currently available to selected accounts. + + ## Notes and limitations + + - The middleware endpoint must be accessible via HTTPS with a valid TLS certificate. + - The middleware must respond within 3 seconds (p95 ≤ 1s, p99 ≤ 2.5s recommended). + - The `clientId` and `secret` are used for HMAC-SHA256 request signing. + - The `secret` is treated as a sensitive credential and should not be logged or shared. + - Don't reuse secrets across environments (for example, staging vs. production). + + ## Permissions + + This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `name` | path | (Required) Feature name for password migration. Must be `PasswordMigration`. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Password migration/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Password migration/folder.yml new file mode 100644 index 0000000000..2b52e5a979 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Password migration/folder.yml @@ -0,0 +1,4 @@ +info: + name: Password migration + type: folder + seq: 5 diff --git a/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Refresh token.yml b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Refresh token.yml new file mode 100644 index 0000000000..1feffab232 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Refresh token.yml @@ -0,0 +1,84 @@ +info: + name: Refresh token + type: http + seq: 4 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/refreshtoken/webstore" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + - name: Host + value: apiexamples.myvtex.com + body: + type: json + data: |- + { + "fingerprint": "12345" + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/refreshtoken/webstore - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/refreshtoken/webstore - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/refreshtoken/webstore - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/refreshtoken/webstore - Schema is valid", function () { + const schema = {"type":"object","description":"Refresh token response object.","properties":{"status":{"type":"string","description":"Status of the operation. Possible values: \r\n- `Success`: Token refresh was successful. \r\n- `InvalidSession`: The session is invalid or expired. \r\n- `InvalidToken`: The token is invalid. \r\n- `InvalidEmail`: The email associated with the token is invalid. \r\n- `InvalidScope`: The scope is invalid.","enum":["Success","InvalidSession","InvalidToken","InvalidEmail","InvalidScope"]},"userId":{"type":"string","description":"Unique identifier assigned to the authenticated user."},"refreshAfter":{"type":"string","format":"date-time","description":"The timestamp indicating when the session should be refreshed, in ISO 8601 format (`YYYY-MM-DDTHH:mm:ss±HH:MM`)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Returns a valid refresh token and authentication token (`VtexIdclientAutCookie`) as cookies. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + | `Host` | header | (Required) Host address. | + + ## Example response (`200`) + + ```json + { + "status": "Success", + "userId": "1f6c17e5-06f9-44a9-a459-b3686e03fa9d", + "refreshAfter": "2025-03-27T02:36:30+00:00" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Send access key.yml b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Send access key.yml new file mode 100644 index 0000000000..3b87c47791 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Send access key.yml @@ -0,0 +1,48 @@ +info: + name: Send access key + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/pub/authentication/accesskey/send?email=jane@mail.com" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: email + value: jane@mail.com + type: query + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/vtexid/pub/authentication/accesskey/send - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Sends an access key to the user's email address, if the response is empty with 200 OK. The access key is used to authenticate the user in your store. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `email` | query | (Required) User email. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Start authentication.yml b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Start authentication.yml new file mode 100644 index 0000000000..e482c3cecb --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Start authentication.yml @@ -0,0 +1,102 @@ +info: + name: Start authentication + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/api/vtexid/pub/authentication/start?scope=accountName" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: scope + value: accountName + type: query + - name: fingerprint + value: "12345" + type: query + disabled: true + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vtexid/pub/authentication/start - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vtexid/pub/authentication/start - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vtexid/pub/authentication/start - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vtexid/pub/authentication/start - Schema is valid", function () { + const schema = {"type":"object","properties":{"authenticationToken":{"type":"string","description":"Authentication token provided to the user, valid for 24 hours."},"oauthProviders":{"type":"array","description":"List of available OAuth providers.","items":{"type":"object","description":"OAuth provider information.","properties":{"providerName":{"type":"string","description":"Name of the OAuth provider."},"className":{"type":"string","description":"Class name associated with the provider."},"expectedContext":{"type":"array","description":"Additional context expected by the provider.","items":{"type":"string","description":"Additional context."}}}}},"showClassicAuthentication":{"type":"boolean","description":"Indicates whether classic authentication is enabled (`true`) or not (`false`)."},"showAccessKeyAuthentication":{"type":"boolean","description":"Indicates whether access key authentication is enabled (`true`) or not (`false`)."},"showPasskeyAuthentication":{"type":"boolean","description":"Indicates whether passkey authentication is enabled (`true`) or not (`false`)."},"authCookie":{"type":["string","null"],"description":"Authentication cookie if available."},"isAuthenticated":{"type":"boolean","description":"Indicates whether the user is authenticated."},"selectedProvider":{"type":["string","null"],"description":"Currently selected authentication provider, if any."},"samlProviders":{"type":"array","description":"List of available SAML providers.","items":{"type":"string","description":"SAML provider."}}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Starts the authentication flow for a user in your store. This endpoint returns an authentication token valid for 24 hours. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `scope` | query | (Required) Account name. | + | `fingerprint` | query | Optional device fingerprint for enhanced security. Generated client-side using JavaScript libraries that collect anonymized device and browser parameters to create a unique identifier. When submitted in this request, it must later be provided when making a request to [refresh token](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/vtexid/refreshtoken/webstore). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authenticationToken": "C17BCD635B637E66BF2BBE07CEED0B1B7425387FB8D6E42FE68EBCE7A49193F2", + "oauthProviders": [ + { + "providerName": "Google", + "className": "google-plus", + "expectedContext": [] + }, + { + "providerName": "Facebook", + "className": "facebook", + "expectedContext": [] + } + ], + "showClassicAuthentication": true, + "showAccessKeyAuthentication": true, + "showPasskeyAuthentication": false, + "authCookie": null, + "isAuthenticated": false, + "selectedProvider": null, + "samlProviders": [] + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Validate session.yml b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Validate session.yml new file mode 100644 index 0000000000..b6973817ea --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/Validate session.yml @@ -0,0 +1,99 @@ +info: + name: Validate session + type: http + seq: 3 + +http: + method: POST + url: "{{baseUrl}}/api/vtexid/pub/authentication/accesskey/validate" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + body: + type: multipart-form + data: + - name: accessKey + type: text + value: id sit Lorem sed + - name: login + type: text + value: dolore in id Duis + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/vtexid/pub/authentication/accesskey/validate - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/vtexid/pub/authentication/accesskey/validate - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/vtexid/pub/authentication/accesskey/validate - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/vtexid/pub/authentication/accesskey/validate - Schema is valid", function () { + const schema = {"type":"object","description":"Validate session response object.","properties":{"authStatus":{"type":"string","description":"Authentication status of the user, which can be: \n\n* `Success`: when authentication is completed successfully.\n* `InvalidEmail`: When the email informed is not valid.\n* `InvalidToken`: When the token is malformed, expired, or has an invalid signature.\n* `WrongCredentials`: When the informed credentials are not valid.","enum":["Success","InvalidEmail","InvalidToken","WrongCredentials"]},"promptMFA":{"type":"boolean","description":"Indicates whether multi-factor authentication is required."},"lastAttemptAvailable":{"type":["integer","null"],"description":"Last authentication attempt available."},"clientToken":{"type":["string","null"],"description":"Client token."},"authCookie":{"type":["object","null"],"description":"Authentication cookie.","properties":{"Name":{"type":"string","description":"Name of the cookie."},"Value":{"type":"string","description":"Value of the cookie."}}},"accountAuthCookie":{"type":["object","null"],"description":"Cookie specific to account authentication.","properties":{"Name":{"type":"string","description":"Name of the cookie."},"Value":{"type":"string","description":"Value of the cookie."}}},"expiresIn":{"type":"integer","description":"Time in seconds until authentication expires."},"userId":{"type":["string","null"],"description":"Unique identifier for the authenticated user."},"phoneNumber":{"type":["string","null"],"description":"User's phone number associated with the account."},"scope":{"type":["string","null"],"description":"Authentication scope granted."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Validates the user session using the access key sent to the user through the [Send access key](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/vtexid/pub/authentication/accesskey/send) endpoint. + + The refresh token (`vid_rt`) is returned in the `Set-Cookie` header. This token is required for the [Refresh token](https://developers.vtex.com/docs/api-reference/vtex-id-api#post-/api/vtexid/refreshtoken/webstore) request. + + ## Permissions + + This endpoint does not require [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "authStatus": "Success", + "promptMFA": false, + "lastAttemptAvailable": null, + "clientToken": null, + "authCookie": { + "Name": "VtexIdclientAutCookie_apiexamples", + "Value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accountAuthCookie": { + "Name": "VtexIdclientAutCookie_a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "Value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "expiresIn": 86399, + "userId": "1f6c17e5-06f9-44a9-a459-b3686e03fa9d", + "phoneNumber": null, + "scope": null + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/folder.yml new file mode 100644 index 0000000000..040fa87ff3 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Refresh token headless/folder.yml @@ -0,0 +1,4 @@ +info: + name: Refresh token headless + type: folder + seq: 3 diff --git a/BrunoCollections/VTEX - VTEX ID API/Storefront users/Create storefront user.yml b/BrunoCollections/VTEX - VTEX ID API/Storefront users/Create storefront user.yml new file mode 100644 index 0000000000..ca714481ec --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Storefront users/Create storefront user.yml @@ -0,0 +1,122 @@ +info: + name: Create storefront user + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/authenticator/v1/storefront/users" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: isLegacyPassword + value: "true" + type: query + disabled: true + body: + type: json + data: |- + { + "identifiers": [ + { + "type": "username", + "value": "beneson_test_21" + }, + { + "type": "email", + "value": "beneson2010@gmail.com" + }, + { + "type": "phoneNumber", + "value": "415-602-8838" + } + ] + } + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[POST]::/api/authenticator/v1/storefront/users - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/authenticator/v1/storefront/users - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[POST]::/api/authenticator/v1/storefront/users - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[POST]::/api/authenticator/v1/storefront/users - Schema is valid", function () { + const schema = {"type":"object","properties":{"userId":{"type":"string","description":"Unique user identifier (GUID)."},"identifier":{"type":"string","description":"Primary identifier used for the user (typically the first one provided in the request)."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Creates a new storefront user in VTEX ID with one or more authentication identifiers (username, email, or phone number). + + The created user is not linked to any Organization Unit and does not have storefront permissions. For more information on how to provision B2B users, see the [B2B user provisioning guide](https://developers.vtex.com/docs/guides/b2b-user-provisioning). + + > ⚠️ This feature is only available for stores using [B2B Buyer Portal](https://help.vtex.com/docs/tutorials/b2b-buyer-portal), which is currently available to selected accounts. + + ## Notes and limitations + + - There are currently **no APIs for updating authentication identifiers**. For update-related needs, contact our [Support](https://support.vtex.com/hc/en-us/). + - Although `phoneNumber` can be registered and used for authentication, it is **not yet supported for password recovery**. + - Once a storefront user is added, authentication identifiers cannot be edited or removed. If incorrect data is uploaded, you must create a new user. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | VTEX ID | User Management | **Create User** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `isLegacyPassword` | query | Flag indicating whether the user's password should be validated against an external legacy authentication system on their first login. Set to `true` for B2B password migration scenarios where users are being migrated from a legacy platform. When `true`, the user's first login will trigger validation against the configured middleware endpoint. Set to `false` (default) for standard user creation where users will need to define a new password. See the [B2B password migration guide](https://developers.vtex.com/docs/guides/b2b-password-migration) for more information. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`201`) + + ```json + { + "userId": "f0a15a42-f7fc-4b09-a9ab-fabc76d9f332", + "identifier": "beneson_test_21" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Storefront users/Get storefront user by identifier.yml b/BrunoCollections/VTEX - VTEX ID API/Storefront users/Get storefront user by identifier.yml new file mode 100644 index 0000000000..c8897e0665 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Storefront users/Get storefront user by identifier.yml @@ -0,0 +1,95 @@ +info: + name: Get storefront user by identifier + type: http + seq: 2 + +http: + method: GET + url: "{{baseUrl}}/api/vtexid/pvt/user/info?user=john.doe_2025" + headers: + - name: Content-Type + value: application/json + - name: Accept + value: application/json + params: + - name: user + value: john.doe_2025 + type: query + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/api/vtexid/pvt/user/info - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/api/vtexid/pvt/user/info - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/api/vtexid/pvt/user/info - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/api/vtexid/pvt/user/info - Schema is valid", function () { + const schema = {"type":"object","description":"Storefront user information.","properties":{"userId":{"type":"string","description":"Storefront user unique identifier."},"user":{"type":"string","description":"Storefront user email."},"name":{"type":"string","description":"Storefront user full name."},"accountId":{"type":"string","description":"VTEX account ID."},"accountName":{"type":"string","description":"VTEX VTEX account name."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Fetches a storefront user by their identifier (username or email). The identifier must be provided as a URL-encoded query parameter. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | VTEX ID | User Management | **View User** | + + There 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `user` | query | (Required) URL-encoded storefront user identifier (username or email). | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```json + { + "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "user": "john.doe@example.com", + "name": "John Doe", + "accountId": "12345", + "accountName": "mystore" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Storefront users/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Storefront users/folder.yml new file mode 100644 index 0000000000..8d106c6617 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Storefront users/folder.yml @@ -0,0 +1,4 @@ +info: + name: Storefront users + type: folder + seq: 4 diff --git a/BrunoCollections/VTEX - VTEX ID API/Token renewal/Complete token renewal.yml b/BrunoCollections/VTEX - VTEX ID API/Token renewal/Complete token renewal.yml new file mode 100644 index 0000000000..71cded5d77 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Token renewal/Complete token renewal.yml @@ -0,0 +1,90 @@ +info: + name: Complete token renewal + type: http + seq: 2 + +http: + method: PATCH + url: "{{baseUrl}}/api/vtexid/apikey/:apiKey/apitoken/finish-renewal" + headers: + - name: Accept + value: application/json + params: + - name: apiKey + value: application/json + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/finish-renewal - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/finish-renewal - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/finish-renewal - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/finish-renewal - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the API token."},"creationDateToken":{"type":"string","description":"ISO 8601 timestamp indicating when the current token was created."},"creationDateNewToken":{"type":["string","null"],"description":"Creation date of the new token. Always `null` after the token creation process is completed."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Finalizes the API token renewal process, deactivating the old token. After this step, the old token can no longer be used, ensuring security by enforcing a controlled rotation. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | API Key Management | **Renew API Token** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | **Renew API Token** | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `apiKey` | path | (Required) API Key name. | + + ## Example response (`200`) + + ```json + { + "id": "1f6c17e5-06f9-44a9-a459-b3686e03fa9d", + "creationDateToken": "2025-02-18T15:30:00Z", + "creationDateNewToken": null + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Token renewal/Initiate token renewal.yml b/BrunoCollections/VTEX - VTEX ID API/Token renewal/Initiate token renewal.yml new file mode 100644 index 0000000000..467446282e --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Token renewal/Initiate token renewal.yml @@ -0,0 +1,95 @@ +info: + name: Initiate token renewal + type: http + seq: 1 + +http: + method: PATCH + url: "{{baseUrl}}/api/vtexid/apikey/:apiKey/apitoken/renew" + headers: + - name: Accept + value: application/json + params: + - name: apiKey + value: application/json + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/renew - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/renew - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/renew - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[PATCH]::/api/vtexid/apikey/:apiKey/apitoken/renew - Schema is valid", function () { + const schema = {"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the API token."},"keyName":{"type":"string","description":"Name assigned to the API key."},"creationDateToken":{"type":"string","description":"ISO 8601 timestamp indicating when the current token was created."},"creationDateNewToken":{"type":"string","description":"ISO 8601 timestamp indicating when the new token was generated."},"expirationPeriod":{"type":"number","description":"Number of days the token remains valid before expiration."},"newToken":{"type":"string","description":"New API token value."}}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + Starts the API token renewal process by generating a new token while keeping the current token active. This ensures a smooth transition without service disruption. + + The previous token and the new token are both valid until the renewal process is completed by making a request to `PATCH` [Complete token renewal](https://developers.vtex.com/docs/api-reference/vtex-id-api#patch-/api/vtexid/apikey/-apiKey-/apitoken/finish-renewal). + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | License Manager | API Key Management | **Renew API Token** | + + You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + + | **Role** | **Resource** | + | --------------- | ----------------- | + | User Administrator - RESTRICTED | **Renew API Token** | + + >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm). + + To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication-overview#machine-authentication). + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `apiKey` | path | (Required) API Key name. | + + ## Example response (`200`) + + ```json + { + "id": "1f6c17e5-06f9-44a9-a459-b3686e03fa9d", + "keyName": "my-api-key", + "creationDateToken": "2025-02-18T12:00:00Z", + "creationDateNewToken": "2025-02-25T12:00:00Z", + "expirationPeriod": 30, + "newToken": "abc123xyz789" + } + ``` diff --git a/BrunoCollections/VTEX - VTEX ID API/Token renewal/folder.yml b/BrunoCollections/VTEX - VTEX ID API/Token renewal/folder.yml new file mode 100644 index 0000000000..7a13ffac1a --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/Token renewal/folder.yml @@ -0,0 +1,4 @@ +info: + name: Token renewal + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - VTEX ID API/environments/VTEX.yml b/BrunoCollections/VTEX - VTEX ID API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - VTEX ID API/opencollection.yml b/BrunoCollections/VTEX - VTEX ID API/opencollection.yml new file mode 100644 index 0000000000..543f15fcea --- /dev/null +++ b/BrunoCollections/VTEX - VTEX ID API/opencollection.yml @@ -0,0 +1,21 @@ +opencollection: 1.0.0 + +info: + name: VTEX - VTEX ID API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: VTEX ID API provides endpoints to manage user authentication in your VTEX store. Check the [Authentication](https://developers.vtex.com/docs/guides/authentication) guide for more information. + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/Notify carrier with app.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/Notify carrier with app.yml new file mode 100644 index 0000000000..1e3ac26625 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/Notify carrier with app.yml @@ -0,0 +1,162 @@ +info: + name: Notify carrier with app + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/:app_name/v{{app_version}}/:account/:workspace/notify" + headers: + - name: Content-Type + value: application/json + params: + - name: app_name + value: "{{app name}}" + type: path + - name: account + value: VTEX Store example + type: path + - name: workspace + value: master + type: path + body: + type: json + data: |- + { + "account": { + "name": "Ltda", + "accountName": "{{account}}", + "isOperating": true, + "defaultUrl": null, + "district": null, + "country": "Brasil", + "complement": null, + "companyName": "LTDA", + "cnpj": "00000000000000", + "city": null, + "address": null, + "number": null, + "postalCode": null, + "state": null, + "telephone": null, + "tradingName": "tradingName" + }, + "email": "email", + "dispatchOrder": { + "id": "653560c2-7965-4614-a730-8e45c89bf284", + "packageIds": [ + "6529cd28-6fd1-4b95-8397-5fad0a79d41c" + ], + "sender": { + "cnpj": "00000000000000", + "fantasyName": null, + "stateRegistration": null, + "id": null, + "name": "LTDA", + "address": { + "postalCode": "03475015", + "country": { + "code": "BRA", + "name": "Brasil" + }, + "subregion1": { + "code": "SP", + "name": "São Paulo" + }, + "subregion2": { + "code": "São Paulo", + "name": "São Paulo" + }, + "subregion3": { + "code": "Vila Antonieta", + "name": "Vila Antonieta" + }, + "street": "Rua Exemplo", + "number": "01", + "complement": "", + "location": null + }, + "email": null, + "phone": "999999999" + }, + "carrier": { + "cnpj": "00000000000000", + "fantasyName": "carrier", + "stateRegistration": "096/3624636", + "id": "vtexlog_exemplo", + "name": "Carrier LTDA.", + "address": { + "postalCode": "90200001", + "country": { + "code": "BRA", + "name": "Brasil" + }, + "subregion1": { + "code": "RS", + "name": "Rio Grande do Sul" + }, + "subregion2": { + "code": "Porto_Alegre", + "name": "Porto Alegre" + }, + "subregion3": { + "code": "Anchieta", + "name": "Anchieta" + }, + "street": "Rua Exemplo", + "number": "01", + "complement": "Pavilhão 6", + "location": null + }, + "email": "email", + "phone": "+5511111111111" + } + } + } + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/:app_name/v{{app_version}}/:account/:workspace/notify - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint notifies the carrier about a dispatch order by calling the `vtex.carrier-notifier app`. When the call is made, the following data is sent: + + - Dispatched packages information. + + - Fiscal information about the carrier notified. + + - Carrier's contact email. + + The call's response includes all tracking data and each package's ID generated by the notification made to the carrier. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Transportation read only** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `app_name` | path | (Required) Name of the app developed by the carrier's integration. | + | `account` | path | (Required) VTEX account dispatching the package. | + | `workspace` | path | (Required) Workspace used in VTEX IO. | diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/folder.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/folder.yml new file mode 100644 index 0000000000..8971faa199 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/Notification/folder.yml @@ -0,0 +1,4 @@ +info: + name: Notification + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/Tracking events with app.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/Tracking events with app.yml new file mode 100644 index 0000000000..2c706d5edc --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/Tracking events with app.yml @@ -0,0 +1,68 @@ +info: + name: Tracking events with app + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/:app_name/v{{app_version}}/:account/:workspace/tracking" + headers: + - name: Content-Type + value: application/json + params: + - name: app_name + value: "{{app name}}" + type: path + - name: account + value: VTEX Store example + type: path + - name: workspace + value: master + type: path + body: + type: json + data: |- + [ + { + "trackingNumber": "BR000000000" + } + ] + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/:app_name/v{{app_version}}/:account/:workspace/tracking - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + This endpoint is called by the hub to obtain the tracking events of a series of tracking numbers. This call's request updates the events of a list of tracking codes, for packages that are still pending delivery. The expected response is an object contaning the tracking information and the package's notification ID for every `packageID`. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | Logistics | Logistics access | **Transportation read only** | + + There 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). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `app_name` | path | (Required) Name of the app developed by the carrier's integration. | + | `account` | path | (Required) VTEX account dispatching the package. | + | `workspace` | path | (Required) Workspace used in VTEX IO. | diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/folder.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/folder.yml new file mode 100644 index 0000000000..a883ff8b69 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/Tracking/folder.yml @@ -0,0 +1,4 @@ +info: + name: Tracking + type: folder + seq: 2 diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/environments/VTEX.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/environments/VTEX.yml new file mode 100644 index 0000000000..7c69582221 --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: baseUrl + value: https://app.io.vtex.com + - name: app_version + value: "{{version}}" + - name: account + value: "" + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - VTEX Shipping Network API/opencollection.yml b/BrunoCollections/VTEX - VTEX Shipping Network API/opencollection.yml new file mode 100644 index 0000000000..9365bb0b4d --- /dev/null +++ b/BrunoCollections/VTEX - VTEX Shipping Network API/opencollection.yml @@ -0,0 +1,52 @@ +opencollection: 1.0.0 + +info: + name: VTEX - VTEX Shipping Network API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + [VTEX Shipping Network](https://vtex.com/br-pt/shipping-network/) is a solution that connects carriers and merchants for deliveries at better freight costs and smarter logistics operations. + + >ℹ️ **VTEX Shipping Network** is exclusive to Brazil. + + The tracking process has two main parts: + - **Notification:** The [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) is notified that a package is being dispatched. + - **Tracking:** The package being delivered by the carrier is tracked from the beginning of the delivery until its final location. + + The carrier's apps have to integrate with the hub, which is connected to other VTEX systems. The carrier is required to develop [VTEX IO](https://developers.vtex.com/docs/guides/vtex-io-documentation-what-is-vtex-io) apps and associate them with specific endpoints. + + >ℹ️ To learn more, see our [integration guide](https://developers.vtex.com/docs/guides/vtex-shipping-network). + + ## VTEX Shipping Network API Index + + ### Notification + + - `POST` [Notify carrier with app](https://developers.vtex.com/docs/api-reference/vtex-shipping-network-api#post-/-app_name-/v-app_version-/-account-/-workspace-/notify) + + ### Tracking + + - `POST` [Tracking events with app](https://developers.vtex.com/docs/api-reference/vtex-shipping-network-api#post-/-app_name-/v-app_version-/-account-/-workspace-/tracking) + + ## Common parameters + + | **Parameter name** | **Description** | **Type** | + | :---: | :--- | :--- | + | `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. | + | `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX - mTLS API/Certificate management/Revoke certificate.yml b/BrunoCollections/VTEX - mTLS API/Certificate management/Revoke certificate.yml new file mode 100644 index 0000000000..18bf6b8fb1 --- /dev/null +++ b/BrunoCollections/VTEX - mTLS API/Certificate management/Revoke certificate.yml @@ -0,0 +1,62 @@ +info: + name: Revoke certificate + type: http + seq: 2 + +http: + method: DELETE + url: "{{baseUrl}}/api/edge/private-certificates/:serialNumber" + headers: + - name: Content-Type + value: text/plain + - name: Accept + value: text/plain + params: + - name: serialNumber + value: 4D0A0A39360B2E1254DDB6CE57DBC940 + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[DELETE]::/api/edge/private-certificates/:serialNumber - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >ℹ️ This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you're already a VTEX client and would like to adopt VTEX Shield for your business, contact our [Commercial Support](https://help.vtex.com/es/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you're not a VTEX client yet but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + Revokes a previously issued certificate based on its serial number. The serial number can be obtained from the certificate using OpenSSL. + + >ℹ️ See our [mTLS implementation guide](https://developers.vtex.com/docs/guides/implementing-mtls#revoking-certificates) for detailed instructions on obtaining the certificate's serial number and revoking certificates. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have the appropriate [License Manager resource](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. This is the applicable resource for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CDN API | Certificate management | **Update certificate** | + + There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add the resource 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `serialNumber` | path | (Required) The serial number of the certificate to be revoked. Both formats are accepted: with (4d:0a:0a:39:36:0b:2e:12:54:dd:b6:ce:57:db:c9:40) or without (4D0A0A39360B2E1254DDB6CE57DBC940) colons. | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | diff --git a/BrunoCollections/VTEX - mTLS API/Certificate management/Sign certificate.yml b/BrunoCollections/VTEX - mTLS API/Certificate management/Sign certificate.yml new file mode 100644 index 0000000000..27f1720ccd --- /dev/null +++ b/BrunoCollections/VTEX - mTLS API/Certificate management/Sign certificate.yml @@ -0,0 +1,77 @@ +info: + name: Sign certificate + type: http + seq: 1 + +http: + method: POST + url: "{{baseUrl}}/api/edge/private-certificates/sign" + headers: + - name: Content-Type + value: text/plain + - name: Accept + value: text/plain + body: + type: text + data: |- + -----BEGIN CERTIFICATE REQUEST----- + ... + -----END CERTIFICATE REQUEST----- + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/api/edge/private-certificates/sign - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[POST]::/api/edge/private-certificates/sign - Content-Type is text/plain", function () { + expect(String(res.getHeader("content-type"))).to.include("text/plain"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + >ℹ️ This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you're already a VTEX client and would like to adopt VTEX Shield for your business, contact our [Commercial Support](https://help.vtex.com/es/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you're not a VTEX client yet but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + Requests a certificate signed by VTEX's Certificate Authority (CA). The request must include a valid Certificate Signing Request (CSR) generated with OpenSSL version 3.0.0 or higher. + + >ℹ️ See our [mTLS implementation guide](https://developers.vtex.com/docs/guides/implementing-mtls#generating-csr) for detailed instructions on generating a valid CSR. + + >❗ The account making the request must match the `OU` field in the CSR. + + ## Permissions + + Any user or [API key](https://developers.vtex.com/docs/guides/authentication-overview#api-keys) must have the appropriate [License Manager resource](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. This is the applicable resource for this endpoint: + + | **Product** | **Category** | **Resource** | + | --------------- | ----------------- | ----------------- | + | CDN API | Certificate management | **Update certificate** | + + There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add the resource 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-overview#machine-authentication). + + >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `Content-Type` | header | (Required) Type of the content being sent. | + | `Accept` | header | (Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand. | + + ## Example response (`200`) + + ```text + -----BEGIN CERTIFICATE----- + ... + -----END CERTIFICATE----- + ``` diff --git a/BrunoCollections/VTEX - mTLS API/Certificate management/folder.yml b/BrunoCollections/VTEX - mTLS API/Certificate management/folder.yml new file mode 100644 index 0000000000..2e9e345386 --- /dev/null +++ b/BrunoCollections/VTEX - mTLS API/Certificate management/folder.yml @@ -0,0 +1,4 @@ +info: + name: Certificate management + type: folder + seq: 1 diff --git a/BrunoCollections/VTEX - mTLS API/environments/VTEX.yml b/BrunoCollections/VTEX - mTLS API/environments/VTEX.yml new file mode 100644 index 0000000000..089a12d218 --- /dev/null +++ b/BrunoCollections/VTEX - mTLS API/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: apiexamples + - name: environment + value: vtexcommercestable + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX - mTLS API/opencollection.yml b/BrunoCollections/VTEX - mTLS API/opencollection.yml new file mode 100644 index 0000000000..caa05c212f --- /dev/null +++ b/BrunoCollections/VTEX - mTLS API/opencollection.yml @@ -0,0 +1,40 @@ +opencollection: 1.0.0 + +info: + name: VTEX - mTLS API + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header + +docs: + content: |- + >ℹ️ This feature is part of [VTEX Shield](https://help.vtex.com/en/tutorial/vtex-shield--2CVk6H9eY2CBtHjtDI7BFh). If you're already a VTEX client and would like to adopt VTEX Shield for your business, contact our [Commercial Support](https://help.vtex.com/en/tracks/support-at-vtex--4AXsGdGHqExp9ZkiNq9eMy/3KQWGgkPOwbFTPfBxL7YwZ). Additional fees may apply. If you're not a VTEX client yet but are interested in this solution, please complete our [contact form](https://vtex.com/us-en/contact/). + + The [Mutual Transport Layer Security (mTLS)](https://help.vtex.com/en/tutorial/mutual-transport-layer-security-mtls--6YR3SoynJMfeEKGlY1Cqlo) API enables merchants to manage SSL certificates for mutual TLS authentication with VTEX services. This API supports the creation and revocation of certificates signed by VTEX's internal Certificate Authority (CA). + + With this API you can: + - Generate signed certificates for merchant applications. + - Revoke certificates that are no longer needed or have been compromised. + + >ℹ️ Start here: Check out our [complete guide to implementing mTLS](https://developers.vtex.com/docs/guides/implementing-mtls). + + ## Common parameters + + | Parameter name | Description | Type | + |-|-|-| + | `{accountName}` | Name of the VTEX account. Used as part of the URL. | Server variable | + | `{environment}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable | + | `X-VTEX-API-AppKey` | Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header | + | `X-VTEX-API-AppToken` | Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys). | Authentication header | + | `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header | + type: text/markdown +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX_TEMPLATE/environments/VTEX.yml b/BrunoCollections/VTEX_TEMPLATE/environments/VTEX.yml new file mode 100644 index 0000000000..9f8c78424a --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/environments/VTEX.yml @@ -0,0 +1,10 @@ +name: VTEX +variables: + - name: accountName + value: "{accountName}" + - name: environment + value: "{environment}" + - name: baseUrl + value: https://{{accountName}}.{{environment}}.com.br + - secret: true + name: apiKey diff --git a/BrunoCollections/VTEX_TEMPLATE/opencollection.yml b/BrunoCollections/VTEX_TEMPLATE/opencollection.yml new file mode 100644 index 0000000000..a8ddfd2e93 --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/opencollection.yml @@ -0,0 +1,17 @@ +opencollection: 1.0.0 + +info: + name: VTEX_TEMPLATE + +request: + auth: + type: apikey + key: X-VTEX-API-AppKey + value: "{{apiKey}}" + placement: header +bundled: false +extensions: + bruno: + ignore: + - node_modules + - .git diff --git a/BrunoCollections/VTEX_TEMPLATE/pets/Create a pet.yml b/BrunoCollections/VTEX_TEMPLATE/pets/Create a pet.yml new file mode 100644 index 0000000000..ed595c74ca --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/pets/Create a pet.yml @@ -0,0 +1,42 @@ +info: + name: Create a pet + type: http + seq: 2 + +http: + method: POST + url: "{{baseUrl}}/pets" + headers: + - name: Accept + value: application/json + params: + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + test("[POST]::/pets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Your VTEX account name | + | `environment` | path | (This can only be one of vtexcommercestable,myvtex) | diff --git a/BrunoCollections/VTEX_TEMPLATE/pets/Info for a specific pet.yml b/BrunoCollections/VTEX_TEMPLATE/pets/Info for a specific pet.yml new file mode 100644 index 0000000000..e11a42fe4a --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/pets/Info for a specific pet.yml @@ -0,0 +1,85 @@ +info: + name: Info for a specific pet + type: http + seq: 3 + +http: + method: GET + url: "{{baseUrl}}/pets/:petId" + headers: + - name: Accept + value: application/json + params: + - name: petId + value: laboris do nulla nostrud + type: path + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pets/:petId - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pets/:petId - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/pets/:petId - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pets/:petId - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["id","name"],"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"tag":{"type":"string"}},"type":"object"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `petId` | path | (Required) The id of the pet to retrieve | + | `accountName` | path | Your VTEX account name | + | `environment` | path | (This can only be one of vtexcommercestable,myvtex) | + + ## Example response (`200`) + + ```json + [ + { + "id": -86040679, + "name": "ad", + "tag": "consequat do veniam in sed" + }, + { + "id": -84888534, + "name": "quis culpa reprehenderit", + "tag": "in" + } + ] + ``` diff --git a/BrunoCollections/VTEX_TEMPLATE/pets/List all pets.yml b/BrunoCollections/VTEX_TEMPLATE/pets/List all pets.yml new file mode 100644 index 0000000000..092b43a28a --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/pets/List all pets.yml @@ -0,0 +1,89 @@ +info: + name: List all pets + type: http + seq: 1 + +http: + method: GET + url: "{{baseUrl}}/pets?limit=-80109204" + headers: + - name: Accept + value: application/json + params: + - name: limit + value: "-80109204" + type: query + - name: accountName + value: "{{accountName}}" + type: path + - name: environment + value: "{{environment}}" + type: path + auth: inherit + +runtime: + scripts: + - type: tests + code: |- + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const ajv = new Ajv({ allErrors: true, strict: false }); + addFormats(ajv); + + test("[GET]::/pets - Status code is 2xx", function () { + expect(res.getStatus()).to.be.at.least(200); + expect(res.getStatus()).to.be.below(300); + }); + + test("[GET]::/pets - Content-Type is application/json", function () { + expect(String(res.getHeader("content-type"))).to.include("application/json"); + }); + + test("[GET]::/pets - Response has JSON Body", function () { + const data = res.getBody(); + expect(data).to.not.be.undefined; + expect(data).to.not.be.null; + }); + + test("[GET]::/pets - Schema is valid", function () { + const schema = {"type":"array","items":{"required":["id","name"],"properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"tag":{"type":"string"}},"type":"object"}}; + const validate = ajv.compile(schema); + const valid = validate(res.getBody()); + expect(valid, JSON.stringify(validate.errors)).to.be.true; + }); + + test("[GET]::/pets - Response header x-next is present", function () { + expect(res.getHeaders()).to.have.property("x-next"); + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Parameters + + | Name | In | Description | + | --- | --- | --- | + | `accountName` | path | Your VTEX account name | + | `environment` | path | (This can only be one of vtexcommercestable,myvtex) | + | `limit` | query | How many items to return at one time (max 100) | + + ## Example response (`200`) + + ```json + [ + { + "id": 84417126, + "name": "culpa ullamco non", + "tag": "ad proident commodo" + }, + { + "id": 27895740, + "name": "voluptate pariatur ut ea id", + "tag": "Duis" + } + ] + ``` diff --git a/BrunoCollections/VTEX_TEMPLATE/pets/folder.yml b/BrunoCollections/VTEX_TEMPLATE/pets/folder.yml new file mode 100644 index 0000000000..186f846949 --- /dev/null +++ b/BrunoCollections/VTEX_TEMPLATE/pets/folder.yml @@ -0,0 +1,4 @@ +info: + name: pets + type: folder + seq: 1 diff --git a/BrunoCollections/_tools/.gitignore b/BrunoCollections/_tools/.gitignore new file mode 100644 index 0000000000..c2658d7d1b --- /dev/null +++ b/BrunoCollections/_tools/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/BrunoCollections/_tools/bru-to-opencollection.js b/BrunoCollections/_tools/bru-to-opencollection.js new file mode 100755 index 0000000000..432f2bca9b --- /dev/null +++ b/BrunoCollections/_tools/bru-to-opencollection.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node +/* + * Stage 2: convert a tree of Bruno .bru collections into the OpenCollection (.yml) + * format. + * + * The serialisation is delegated to @usebruno/filestore -- the same package the + * Bruno app and the bru CLI use to write these files -- so the output tracks the + * spec rather than a hand-rolled approximation of it. + * + * node bru-to-opencollection.js + */ +const fs = require('fs'); +const path = require('path'); +const store = require('@usebruno/filestore'); + +const SRC = process.argv[2]; +const DST = process.argv[3]; + +if (!SRC || !DST) { + console.error('usage: node bru-to-opencollection.js '); + process.exit(1); +} + +const stats = { collections: 0, folders: 0, requests: 0, environments: 0 }; +const errors = []; + +const write = (file, content) => { + fs.mkdirSync(path.dirname(file), { recursive: true }); + fs.writeFileSync(file, content.endsWith('\n') ? content : content + '\n'); +}; + +const convertDir = (srcDir, dstDir) => { + for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) { + const src = path.join(srcDir, entry.name); + + if (entry.isDirectory()) { + convertDir(src, path.join(dstDir, entry.name)); + continue; + } + if (!entry.name.endsWith('.bru')) continue; + + const raw = fs.readFileSync(src, 'utf8'); + try { + if (entry.name === 'collection.bru') { + // bruno.json and collection.bru collapse into a single opencollection.yml. + const config = JSON.parse(fs.readFileSync(path.join(srcDir, 'bruno.json'), 'utf8')); + delete config.version; + const root = store.parseCollection(raw, { format: 'bru' }); + write(path.join(dstDir, 'opencollection.yml'), store.stringifyCollection(root, config, { format: 'yml' })); + stats.collections++; + } else if (entry.name === 'folder.bru') { + const root = store.parseFolder(raw, { format: 'bru' }); + // The bru parser hands back `auth: {}` with no mode, which stringifyFolder reads + // as "has auth" and turns into a stray empty `request: {}`. Spelling the mode out + // as none keeps the folder file to its info block, while leaving a folder that + // really does define auth untouched. + root.request = root.request || {}; + root.request.auth = root.request.auth || {}; + root.request.auth.mode = root.request.auth.mode || 'none'; + write(path.join(dstDir, 'folder.yml'), store.stringifyFolder(root, { format: 'yml' })); + stats.folders++; + } else if (path.basename(srcDir) === 'environments') { + const env = store.parseEnvironment(raw, { format: 'bru' }); + // A .bru environment takes its name from the filename; the yml format stores + // the name in the file, so carry it across explicitly. + env.name = entry.name.replace(/\.bru$/, ''); + write(path.join(dstDir, env.name + '.yml'), store.stringifyEnvironment(env, { format: 'yml' })); + stats.environments++; + } else { + const item = store.parseRequest(raw, { format: 'bru' }); + write(path.join(dstDir, entry.name.replace(/\.bru$/, '.yml')), store.stringifyRequest(item, { format: 'yml' })); + stats.requests++; + } + } catch (err) { + errors.push(src + ' :: ' + err.message); + } + } +}; + +for (const name of fs.readdirSync(SRC)) { + const dir = path.join(SRC, name); + if (fs.statSync(dir).isDirectory()) convertDir(dir, path.join(DST, name)); +} + +console.log('converted ' + JSON.stringify(stats)); +if (errors.length) { + console.error('errors: ' + errors.length); + errors.forEach((e) => console.error(' ' + e)); + process.exit(1); +} diff --git a/BrunoCollections/_tools/convert.sh b/BrunoCollections/_tools/convert.sh new file mode 100755 index 0000000000..fd4818ea8d --- /dev/null +++ b/BrunoCollections/_tools/convert.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# Regenerates BrunoCollections/ from PostmanCollections/. +# +# Stage 1 (python) turns the Postman v2.1 JSON into Bruno .bru files in a scratch +# directory; stage 2 (node) rewrites those into the OpenCollection .yml format that +# actually ships. The .bru tree is an intermediate and is discarded. +# +# ./_tools/convert.sh # regenerate in place +# ./_tools/convert.sh /some/dir # regenerate into another directory +set -euo pipefail + +TOOLS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +OUT="${1:-$(cd "$TOOLS/.." && pwd)}" + +if [ ! -d "$TOOLS/node_modules" ]; then + echo "==> installing converter dependencies" + (cd "$TOOLS" && npm install --silent) +fi + +STAGE="$(mktemp -d)" +trap 'rm -rf "$STAGE"' EXIT + +echo "==> stage 1: Postman -> .bru" +python3 "$TOOLS/postman-to-bruno.py" "$STAGE" + +echo "==> stage 2: .bru -> OpenCollection .yml" +mkdir -p "$OUT" +# Drop the previously generated collections but keep README.md and _tools/. +find "$OUT" -mindepth 1 -maxdepth 1 -type d ! -name '_*' -exec rm -rf {} + +node "$TOOLS/bru-to-opencollection.js" "$STAGE" "$OUT" + +echo "==> stage 3: workspace file linking the collections" +node "$TOOLS/make-workspace.js" "$OUT" + +echo "==> done: $OUT" diff --git a/BrunoCollections/_tools/make-workspace.js b/BrunoCollections/_tools/make-workspace.js new file mode 100644 index 0000000000..ba8bb35e5a --- /dev/null +++ b/BrunoCollections/_tools/make-workspace.js @@ -0,0 +1,49 @@ +/** + * Generate the Bruno workspace file that links every collection in BrunoCollections/. + * + * A workspace is an OpenCollection document (`info.type: workspace`) holding a list of + * {name, path} entries pointing at collection directories. Opening it in Bruno loads all + * of them at once, instead of picking each API folder by hand. + * + * The emitter below mirrors generateYamlContent() in Bruno's own utils/workspace-config, + * so regenerating here produces the same bytes the app writes when it edits the workspace. + * Pass the workspace directory as the first argument; it defaults to BrunoCollections/. + */ +const fs = require('fs'); +const path = require('path'); +const { parseCollection } = require('@usebruno/filestore'); + +const WORKSPACE_NAME = 'VTEX API Collections'; +const DIR = path.resolve(process.argv[2] || path.join(__dirname, '..')); + +// Same escaping rule as the app: always double-quote, backslashes and quotes escaped. +const quote = (value) => { + if (typeof value !== 'string') return `"${String(value)}"`; + if (value === '') return '""'; + return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`; +}; + +const collections = fs + .readdirSync(DIR, { withFileTypes: true }) + .filter((e) => e.isDirectory() && !e.name.startsWith('_')) + .filter((e) => fs.existsSync(path.join(DIR, e.name, 'opencollection.yml'))) + .sort((a, b) => a.name.localeCompare(b.name)) + .map((e) => { + // Take the display name from the collection itself rather than the directory name, + // so a renamed collection keeps a truthful label in the workspace. + const raw = fs.readFileSync(path.join(DIR, e.name, 'opencollection.yml'), 'utf8'); + const { brunoConfig } = parseCollection(raw, { format: 'yml' }); + // Paths are stored relative to the workspace, posix-style, so the file stays portable. + return { name: brunoConfig.name || e.name, path: e.name }; + }); + +const lines = [`opencollection: 1.0.0`, 'info:', ` name: ${quote(WORKSPACE_NAME)}`, ` type: workspace`, '']; +lines.push('collections:'); +for (const c of collections) { + lines.push(` - name: ${quote(c.name)}`); + lines.push(` path: ${quote(c.path)}`); +} +lines.push('', 'specs:', '', "docs: ''", ''); + +fs.writeFileSync(path.join(DIR, 'workspace.yml'), lines.join('\n')); +console.log(`workspace.yml -> ${collections.length} collections linked`); diff --git a/BrunoCollections/_tools/package-lock.json b/BrunoCollections/_tools/package-lock.json new file mode 100644 index 0000000000..5fb68c495e --- /dev/null +++ b/BrunoCollections/_tools/package-lock.json @@ -0,0 +1,208 @@ +{ + "name": "vtex-bruno-collection-tools", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vtex-bruno-collection-tools", + "dependencies": { + "@usebruno/filestore": "^0.11.0", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", + "nanoid": "3.3.8" + } + }, + "node_modules/@types/nanoid": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/nanoid/-/nanoid-2.1.0.tgz", + "integrity": "sha512-xdkn/oRTA0GSNPLIKZgHWqDTWZsVrieKomxJBOQUK9YDD+zfSgmwD5t4WJYra5S7XyhTw7tfvwznW+pFexaepQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "26.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz", + "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/@usebruno/common": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@usebruno/common/-/common-0.24.0.tgz", + "integrity": "sha512-f7AWktc6G69Y2IyXDYx5RUuiOj55W0AheYjUWykasBt0/7++7Ab8y8cCXopvrVPfdSyah24RdYQ5PAJu1yhgHw==", + "license": "MIT" + }, + "node_modules/@usebruno/filestore": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@usebruno/filestore/-/filestore-0.11.0.tgz", + "integrity": "sha512-WvIjg2Vh5UUZtXqFv1AVVEnzXKT71hTxzQM4BkKpVUXfo17bT6dGqyiD9y3+SEZXED+S/0Xh1qJmsjSEIVsY/g==", + "license": "MIT", + "dependencies": { + "@types/nanoid": "^2.1.0", + "@usebruno/common": "0.24.0", + "@usebruno/lang": "0.38.0", + "ajv": "^8.17.1", + "lodash": "4.18.1", + "yaml": "^2.3.4" + } + }, + "node_modules/@usebruno/lang": { + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@usebruno/lang/-/lang-0.38.0.tgz", + "integrity": "sha512-kVUh9CXPkvGMmyr0lbfpNWePx1JlmM74AUSdgeIQszLSBeeb+zdgxyZ8iY/vg3B2SFAyHdVuXR+HIokqMlBBGQ==", + "license": "MIT", + "dependencies": { + "arcsecond": "^5.0.0", + "dotenv": "^16.3.1", + "lodash": "4.18.1", + "ohm-js": "^16.6.0" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/arcsecond": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/arcsecond/-/arcsecond-5.0.0.tgz", + "integrity": "sha512-J/fHdyadnsIencRsM6oUSsraCKG+Ni9Udcgr/eusxjTzX3SEQtCUQSpP0YtImFPfIK6DdT1nqwN0ng4FqNmwgA==", + "license": "MIT" + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz", + "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/ohm-js": { + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/ohm-js/-/ohm-js-16.6.0.tgz", + "integrity": "sha512-X9P4koSGa7swgVQ0gt71UCYtkAQGOjciJPJAz74kDxWt8nXbH5HrDOQG6qBDH7SR40ktNv4x61BwpTDE9q4lRA==", + "license": "MIT", + "engines": { + "node": ">=0.12.1" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "license": "MIT" + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + } + } +} diff --git a/BrunoCollections/_tools/package.json b/BrunoCollections/_tools/package.json new file mode 100644 index 0000000000..e9f60e79b8 --- /dev/null +++ b/BrunoCollections/_tools/package.json @@ -0,0 +1,11 @@ +{ + "name": "vtex-bruno-collection-tools", + "private": true, + "description": "Pipeline that regenerates BrunoCollections/ from PostmanCollections/", + "dependencies": { + "@usebruno/filestore": "^0.11.0", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", + "nanoid": "3.3.8" + } +} diff --git a/BrunoCollections/_tools/postman-to-bruno.py b/BrunoCollections/_tools/postman-to-bruno.py new file mode 100755 index 0000000000..da1a2a868c --- /dev/null +++ b/BrunoCollections/_tools/postman-to-bruno.py @@ -0,0 +1,496 @@ +#!/usr/bin/env python3 +"""Convert VTEX Postman v2.1 collections (PostmanCollections/) into Bruno .bru collections. + +This is stage 1 of the pipeline driven by convert.sh; stage 2 (bru-to-opencollection.js) +turns the .bru output into the OpenCollection .yml format that ships in BrunoCollections/. +Pass an output directory as the first argument; it defaults to BrunoCollections/. +""" +import json, os, re, sys, glob, shutil, collections + +# This script lives at BrunoCollections/_tools/, so the repo root is two levels up. +# Resolving from __file__ keeps it runnable from any working directory. +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +SRC = os.path.join(ROOT, "PostmanCollections") +DST = os.path.abspath(sys.argv[1]) if len(sys.argv) > 1 else os.path.join(ROOT, "BrunoCollections") + +# ---------------------------------------------------------------- bru writing + +def esc_block(text): + """Indent a multi-line value for a Bruno text block (2 spaces per line).""" + lines = text.replace("\r\n", "\n").replace("\r", "\n").split("\n") + return "\n".join((" " + l) if l.strip() else "" for l in lines) + +def text_block(name, content): + if content is None or content == "": + return "" + return "%s {\n%s\n}\n\n" % (name, esc_block(content)) + +def one_line(v): + return re.sub(r"\s*\n\s*", " ", str(v)).strip() + +def dict_block(name, pairs): + """pairs: list of (key, value, enabled).""" + if not pairs: + return "" + out = ["%s {" % name] + for k, v, enabled in pairs: + prefix = "" if enabled else "~" + out.append(" %s%s: %s" % (prefix, one_line(k), one_line(v))) + out.append("}\n") + return "\n".join(out) + "\n" + +def list_block(name, values): + if not values: + return "" + return "%s [\n%s\n]\n\n" % (name, ",\n".join(" " + v for v in values)) + +# ---------------------------------------------------------------- postman bits + +def desc_text(d): + if d is None: + return "" + if isinstance(d, str): + return d + if isinstance(d, dict): + return d.get("content", "") or "" + return "" + +def kv_list(entries): + """Postman key/value entries -> (key, value, enabled) tuples.""" + out = [] + for e in entries or []: + if not isinstance(e, dict) or "key" not in e: + continue + out.append((e["key"], e.get("value", "") or "", not e.get("disabled", False))) + return out + +def dedupe(pairs): + seen, out = set(), [] + for k, v, en in pairs: + if k in seen: + continue + seen.add(k) + out.append((k, v, en)) + return out + +def build_url(u): + if isinstance(u, str): + return u + if not isinstance(u, dict): + return "" + host = u.get("host") or [] + if isinstance(host, str): + host = [host] + host = ".".join(host) + protocol = u.get("protocol") + if protocol and not host.startswith("{{"): + host = "%s://%s" % (protocol, host) + port = u.get("port") + if port: + host = "%s:%s" % (host, port) + path = u.get("path") or [] + if isinstance(path, str): + path = [p for p in path.split("/") if p != ""] + url = host + if path: + url = host.rstrip("/") + "/" + "/".join(str(p) for p in path) + enabled_q = [(k, v) for k, v, en in kv_list(u.get("query")) if en] + if enabled_q: + url += "?" + "&".join("%s=%s" % (k, v) for k, v in enabled_q) + return url + +BODY_LANG = {"json": "json", "xml": "xml", "html": "text", "text": "text", "javascript": "text"} + +def body_blocks(body): + """-> (body_mode_for_meta, block_text)""" + if not body or not isinstance(body, dict): + return "none", "" + mode = body.get("mode") + if mode == "raw": + raw = body.get("raw", "") + lang = (body.get("options", {}).get("raw", {}) or {}).get("language", "text") + btype = BODY_LANG.get(lang, "text") + if not raw: + return "none", "" + return btype, text_block("body:%s" % btype, raw) + if mode == "urlencoded": + pairs = kv_list(body.get("urlencoded")) + return "formUrlEncoded", dict_block("body:form-urlencoded", pairs) + if mode == "formdata": + rows = [] + for e in body.get("formdata") or []: + key = e.get("key") + if key is None: + continue + enabled = not e.get("disabled", False) + if e.get("type") == "file": + src = e.get("src") + if isinstance(src, list): + src = src[0] if src else None + rows.append((key, "@file(%s)" % (src or ""), enabled)) + else: + rows.append((key, e.get("value", "") or "", enabled)) + return "multipartForm", dict_block("body:multipart-form", rows) + if mode == "file": + src = (body.get("file") or {}).get("src") + if src: + return "file", dict_block("body:file", [("file", "@file(%s)" % src, True)]) + return "file", "" + if mode == "graphql": + gq = body.get("graphql") or {} + blk = text_block("body:graphql", gq.get("query", "")) + if gq.get("variables"): + blk += text_block("body:graphql:vars", gq["variables"]) + return "graphql", blk + return "none", "" + +def auth_blocks(auth): + """Postman auth -> (bruno mode, block text). None if absent/noauth.""" + if not auth or not isinstance(auth, dict): + return None, "" + t = auth.get("type") + if t in (None, "noauth"): + return "none", "" + params = {} + for e in auth.get(t) or []: + if isinstance(e, dict) and "key" in e: + params[e["key"]] = e.get("value", "") + if t == "apikey": + placement = params.get("in", "header") + return "apikey", dict_block("auth:apikey", [ + ("key", params.get("key", ""), True), + ("value", params.get("value", ""), True), + ("placement", placement, True), + ]) + if t == "bearer": + return "bearer", dict_block("auth:bearer", [("token", params.get("token", ""), True)]) + if t == "basic": + return "basic", dict_block("auth:basic", [ + ("username", params.get("username", ""), True), + ("password", params.get("password", ""), True), + ]) + return "none", "" + +# ---------------------------------------------------------------- test translation + +TEST_RE = re.compile(r'pm\.test\(\s*("(?:[^"\\]|\\.)*")\s*,\s*function\s*\(\s*\)\s*\{(.*?)\n\s*\}\s*\)\s*;', re.S) +SCHEMA_RE = re.compile(r'^\s*const schema\s*=\s*(.+?)\s*$', re.M) +CT_RE = re.compile(r'headers\.get\(\s*"([^"]+)"\s*\)\s*\)\s*\.to\.include\(\s*"([^"]+)"\s*\)') +HDR_RE = re.compile(r'to\.have\.header\(\s*"([^"]+)"\s*\)') + +def js_str(s): + return json.dumps(s) + +def translate_tests(events): + """portman pm.* scripts -> Bruno test() blocks. Returns body text or ''.""" + src = "" + for e in events or []: + if e.get("listen") != "test": + continue + exec_ = (e.get("script") or {}).get("exec") or [] + src += "".join(exec_) if isinstance(exec_, list) else str(exec_) + if not src.strip(): + return "" + + schemas = SCHEMA_RE.findall(src) + schema_i = 0 + out, needs_ajv = [], False + + for name_lit, body in TEST_RE.findall(src): + try: + name = json.loads(name_lit) + except Exception: + name = name_lit.strip('"') + name = js_str(name) + + if "to.be.success" in body: + out.append( + 'test(%s, function () {\n' + ' expect(res.getStatus()).to.be.at.least(200);\n' + ' expect(res.getStatus()).to.be.below(300);\n' + '});' % name) + elif "to.be.error" in body: + out.append( + 'test(%s, function () {\n' + ' expect(res.getStatus()).to.be.at.least(400);\n' + ' expect(res.getStatus()).to.be.below(500);\n' + '});' % name) + elif CT_RE.search(body): + hdr, val = CT_RE.search(body).groups() + out.append( + 'test(%s, function () {\n' + ' expect(String(res.getHeader(%s))).to.include(%s);\n' + '});' % (name, js_str(hdr.lower()), js_str(val))) + elif "jsonBody()" in body: + out.append( + 'test(%s, function () {\n' + ' const data = res.getBody();\n' + ' expect(data).to.not.be.undefined;\n' + ' expect(data).to.not.be.null;\n' + '});' % name) + elif "jsonSchema(" in body: + schema = schemas[schema_i] if schema_i < len(schemas) else "{}" + schema_i += 1 + needs_ajv = True + out.append( + 'test(%s, function () {\n' + ' const schema = %s;\n' + ' const validate = ajv.compile(schema);\n' + ' const valid = validate(res.getBody());\n' + ' expect(valid, JSON.stringify(validate.errors)).to.be.true;\n' + '});' % (name, schema)) + elif "to.not.be.withBody" in body: + out.append( + 'test(%s, function () {\n' + ' const data = res.getBody();\n' + ' expect(data === undefined || data === null || data === "").to.be.true;\n' + '});' % name) + elif HDR_RE.search(body): + hdr = HDR_RE.search(body).group(1) + out.append( + 'test(%s, function () {\n' + ' expect(res.getHeaders()).to.have.property(%s);\n' + '});' % (name, js_str(hdr.lower()))) + + if not out: + return "" + prelude = "" + if needs_ajv: + prelude = ( + 'const Ajv = require("ajv");\n' + 'const addFormats = require("ajv-formats");\n' + 'const ajv = new Ajv({ allErrors: true, strict: false });\n' + 'addFormats(ajv);\n\n') + return prelude + "\n\n".join(out) + +# ---------------------------------------------------------------- docs + +def params_table(rows): + if not rows: + return "" + out = ["| Name | In | Description |", "| --- | --- | --- |"] + for name, loc, d in rows: + out.append("| `%s` | %s | %s |" % (name, loc, one_line(d).replace("|", "\\|"))) + return "\n".join(out) + +def request_docs(item, req, example): + parts = [] + d = desc_text(req.get("description")) or desc_text(item.get("description")) + if d.strip(): + parts.append(d.strip()) + + rows = [] + u = req.get("url") + if isinstance(u, dict): + for e in u.get("variable") or []: + if e.get("key"): + rows.append((e["key"], "path", desc_text(e.get("description")))) + for e in u.get("query") or []: + if e.get("key"): + rows.append((e["key"], "query", desc_text(e.get("description")))) + seen = set() + for e in req.get("header") or []: + k = e.get("key") + if k and k not in seen: + seen.add(k) + rows.append((k, "header", desc_text(e.get("description")))) + rows = [r for r in rows if r[2].strip()] + if rows: + parts.append("## Parameters\n\n" + params_table(rows)) + + if example: + parts.append(example) + return "\n\n".join(parts) + +def example_section(responses): + """First 2xx response example, if compact enough to inline.""" + for r in responses or []: + code = r.get("code") + if not isinstance(code, int) or not (200 <= code < 300): + continue + body = r.get("body") + if not body or not str(body).strip(): + continue + body = str(body) + lang = (r.get("_", {}) or {}).get("postman_previewlanguage", "json") + if len(body) > 4000: + return "## Example response (`%s`)\n\n_Omitted here: %d KB. See `%s` in PostmanCollections._" % ( + code, len(body) // 1024, r.get("name", "example")) + return "## Example response (`%s`)\n\n```%s\n%s\n```" % (code, lang if lang else "", body) + return "" + +# ---------------------------------------------------------------- emit + +def safe_name(name): + n = re.sub(r'[<>:"/\\|?*\x00-\x1f]', "-", name).strip().rstrip(".") + return n[:120] or "unnamed" + +def unique_name(base, used): + """Folders and request files share a directory, and macOS/Windows are + case-insensitive, so reserve names case-insensitively.""" + name, n = base, 1 + while name.lower() in used: + n += 1 + name = "%s (%d)" % (base, n) + used.add(name.lower()) + return name + +def write(path, content): + with open(path, "w", encoding="utf-8") as f: + f.write(content) + +def emit_request(item, directory, seq, used, collection_has_auth): + req = item.get("request") + if isinstance(req, str): + req = {"method": "GET", "url": req} + method = (req.get("method") or "GET").lower() + url = build_url(req.get("url")) + + body_mode, body_text = body_blocks(req.get("body")) + auth_mode, auth_text = auth_blocks(req.get("auth")) + if auth_mode is None: + auth_mode = "inherit" if collection_has_auth else "none" + auth_text = "" + + out = "meta {\n name: %s\n type: http\n seq: %d\n}\n\n" % (one_line(item["name"]), seq) + out += "%s {\n url: %s\n body: %s\n auth: %s\n}\n\n" % (method, url, body_mode, auth_mode) + + u = req.get("url") + if isinstance(u, dict): + out += dict_block("params:query", dedupe(kv_list(u.get("query")))) + out += dict_block("params:path", dedupe(kv_list(u.get("variable")))) + out += dict_block("headers", dedupe(kv_list(req.get("header")))) + out += auth_text + out += body_text + + tests = translate_tests(item.get("event")) + if tests: + out += text_block("tests", tests) + + docs = request_docs(item, req, example_section(item.get("response"))) + if docs.strip(): + out += text_block("docs", docs) + + fname = unique_name(safe_name(item["name"]), used) + write(os.path.join(directory, fname + ".bru"), out) + return 1 + +def emit_folder(item, directory, seq, collection_has_auth, used): + name = unique_name(safe_name(item["name"]), used) + path = os.path.join(directory, name) + os.makedirs(path, exist_ok=True) + out = "meta {\n name: %s\n seq: %d\n}\n" % (one_line(item["name"]), seq) + d = desc_text(item.get("description")) + if d.strip(): + out += "\n" + text_block("docs", d.strip()).rstrip("\n") + "\n" + write(os.path.join(path, "folder.bru"), out) + return emit_items(item.get("item") or [], path, collection_has_auth) + +def emit_items(items, directory, collection_has_auth): + used = set() + count = 0 + for i, it in enumerate(items, start=1): + if "item" in it: + count += emit_folder(it, directory, i, collection_has_auth, used) + elif "request" in it: + count += emit_request(it, directory, i, used, collection_has_auth) + return count + +VAR_RE = re.compile(r"\{\{([A-Za-z0-9_\-]+)\}\}") + +def emit_collection(src_path, dst_root): + doc = json.load(open(src_path, encoding="utf-8")) + info = doc.get("info") or {} + coll_name = os.path.splitext(os.path.basename(src_path))[0] + root = os.path.join(dst_root, safe_name(coll_name)) + os.makedirs(root, exist_ok=True) + + write(os.path.join(root, "bruno.json"), json.dumps({ + "version": "1", + "name": coll_name, + "type": "collection", + "ignore": ["node_modules", ".git"], + }, indent=2) + "\n") + + auth_mode, auth_text = auth_blocks(doc.get("auth")) + has_auth = auth_mode not in (None, "none") + + cbru = "meta {\n name: %s\n}\n\n" % one_line(coll_name) + cbru += "auth {\n mode: %s\n}\n\n" % (auth_mode if has_auth else "none") + cbru += auth_text + cdesc = desc_text(info.get("description")) + if cdesc.strip(): + cbru += text_block("docs", cdesc.strip()) + write(os.path.join(root, "collection.bru"), cbru) + + n = emit_items(doc.get("item") or [], root, has_auth) + + # environment: collection variables + any undefined {{vars}} referenced anywhere + defined = collections.OrderedDict() + for v in doc.get("variable") or []: + if v.get("key"): + defined[v["key"]] = v.get("value", "") or "" + referenced = set() + + def scan_auth(a): + if isinstance(a, dict) and a.get("type"): + for e in a.get(a["type"]) or []: + if isinstance(e, dict): + referenced.update(VAR_RE.findall(str(e.get("value", "")))) + + def scan_items(items): + for it in items: + if "item" in it: + scan_items(it.get("item") or []) + continue + r = it.get("request") + if isinstance(r, str): + referenced.update(VAR_RE.findall(r)) + continue + if not isinstance(r, dict): + continue + referenced.update(VAR_RE.findall(build_url(r.get("url")))) + for e in r.get("header") or []: + referenced.update(VAR_RE.findall(str(e.get("value", "")))) + b = r.get("body") or {} + if b.get("mode") == "raw": + referenced.update(VAR_RE.findall(b.get("raw") or "")) + scan_auth(r.get("auth")) + + scan_auth(doc.get("auth")) + scan_items(doc.get("item") or []) + secrets = sorted(r for r in referenced if r not in defined) + + secret_re = re.compile(r"key|token|password|secret|cookie|auth", re.I) + creds = [v for v in secrets if secret_re.search(v)] + plain = [v for v in secrets if not secret_re.search(v)] + + os.makedirs(os.path.join(root, "environments"), exist_ok=True) + rows = [(k, v, True) for k, v in defined.items()] + rows += [(k, "", True) for k in plain] + env = dict_block("vars", rows) + if creds: + env += list_block("vars:secret", creds) + write(os.path.join(root, "environments", "VTEX.bru"), env) + return n, secrets + +def main(): + # Clear only the generated collection directories, so the README and the + # _tools/ directory living alongside them survive a regeneration. + os.makedirs(DST, exist_ok=True) + for entry in os.listdir(DST): + sub = os.path.join(DST, entry) + if os.path.isdir(sub) and not entry.startswith("_"): + shutil.rmtree(sub) + total, colls = 0, 0 + allsecrets = collections.Counter() + for f in sorted(glob.glob(os.path.join(SRC, "*.json"))): + n, secrets = emit_collection(f, DST) + allsecrets.update(secrets) + total += n + colls += 1 + print("collections: %d requests: %d" % (colls, total)) + print("secret/undefined vars:", dict(allsecrets)) + +if __name__ == "__main__": + main() diff --git a/BrunoCollections/workspace.yml b/BrunoCollections/workspace.yml new file mode 100644 index 0000000000..99cbef78a2 --- /dev/null +++ b/BrunoCollections/workspace.yml @@ -0,0 +1,194 @@ +opencollection: 1.0.0 +info: + name: "VTEX API Collections" + type: workspace + +collections: + - name: "VTEX - Ads API" + path: "VTEX - Ads API" + - name: "VTEX - Antifraud Provider API" + path: "VTEX - Antifraud Provider API" + - name: "VTEX - Audience API" + path: "VTEX - Audience API" + - name: "VTEX - B2B Addresses API" + path: "VTEX - B2B Addresses API" + - name: "VTEX - B2B Buyer Data API" + path: "VTEX - B2B Buyer Data API" + - name: "VTEX - B2B Contact Information API" + path: "VTEX - B2B Contact Information API" + - name: "VTEX - B2B Contracts API" + path: "VTEX - B2B Contracts API" + - name: "VTEX - B2B Password Migration Protocol" + path: "VTEX - B2B Password Migration Protocol" + - name: "VTEX - B2B Recipients API" + path: "VTEX - B2B Recipients API" + - name: "VTEX - Budgets API" + path: "VTEX - Budgets API" + - name: "VTEX - Bulk Pricing API" + path: "VTEX - Bulk Pricing API" + - name: "VTEX - Buyer Organizations" + path: "VTEX - Buyer Organizations" + - name: "VTEX - Buying Policies API" + path: "VTEX - Buying Policies API" + - name: "VTEX - Card Token Vault API" + path: "VTEX - Card Token Vault API" + - name: "VTEX - Catalog API" + path: "VTEX - Catalog API" + - name: "VTEX - Catalog API Seller Portal" + path: "VTEX - Catalog API Seller Portal" + - name: "VTEX - Checkout API" + path: "VTEX - Checkout API" + - name: "VTEX - Checkout Configuration API" + path: "VTEX - Checkout Configuration API" + - name: "VTEX - Checkout Custom Card Payment API" + path: "VTEX - Checkout Custom Card Payment API" + - name: "VTEX - CMS API" + path: "VTEX - CMS API" + - name: "VTEX - Custom Fields API" + path: "VTEX - Custom Fields API" + - name: "VTEX - Customer Credit API" + path: "VTEX - Customer Credit API" + - name: "VTEX - Data Subject Rights" + path: "VTEX - Data Subject Rights" + - name: "VTEX - Default Values API" + path: "VTEX - Default Values API" + - name: "VTEX - Delivery Promise Notification API" + path: "VTEX - Delivery Promise Notification API" + - name: "VTEX - Delivery Promise Suggestions API" + path: "VTEX - Delivery Promise Suggestions API" + - name: "VTEX - Document Contracts API" + path: "VTEX - Document Contracts API" + - name: "VTEX - External Promotions Protocol API" + path: "VTEX - External Promotions Protocol API" + - name: "VTEX - Giftcard API" + path: "VTEX - Giftcard API" + - name: "VTEX - GiftCard Hub API" + path: "VTEX - GiftCard Hub API" + - name: "VTEX - Giftcard Provider Protocol" + path: "VTEX - Giftcard Provider Protocol" + - name: "VTEX - Headless CMS API" + path: "VTEX - Headless CMS API" + - name: "VTEX - Intelligent Search API" + path: "VTEX - Intelligent Search API" + - name: "VTEX - Intelligent Search API - v1" + path: "VTEX - Intelligent Search API - v1" + - name: "VTEX - Intelligent Search Events API - Headless" + path: "VTEX - Intelligent Search Events API - Headless" + - name: "VTEX - Legacy CMS Portal API" + path: "VTEX - Legacy CMS Portal API" + - name: "VTEX - License Manager API" + path: "VTEX - License Manager API" + - name: "VTEX - Logistics API" + path: "VTEX - Logistics API" + - name: "VTEX - Marketplace APIs" + path: "VTEX - Marketplace APIs" + - name: "VTEX - Marketplace APIs - Sent Offers" + path: "VTEX - Marketplace APIs - Sent Offers" + - name: "VTEX - Marketplace APIs - Suggestions" + path: "VTEX - Marketplace APIs - Suggestions" + - name: "VTEX - Marketplace Protocol - External Marketplace Mapper" + path: "VTEX - Marketplace Protocol - External Marketplace Mapper" + - name: "VTEX - Marketplace Protocol - External Marketplace Orders" + path: "VTEX - Marketplace Protocol - External Marketplace Orders" + - name: "VTEX - Marketplace Protocol - External Seller Fulfillment" + path: "VTEX - Marketplace Protocol - External Seller Fulfillment" + - name: "VTEX - Marketplace Protocol - External Seller Marketplace" + path: "VTEX - Marketplace Protocol - External Seller Marketplace" + - name: "VTEX - Master Data API - v2" + path: "VTEX - Master Data API - v2" + - name: "VTEX - MasterData API - v10.2" + path: "VTEX - MasterData API - v10.2" + - name: "VTEX - Message Center API" + path: "VTEX - Message Center API" + - name: "VTEX - mTLS API" + path: "VTEX - mTLS API" + - name: "VTEX - Operational Capacity API" + path: "VTEX - Operational Capacity API" + - name: "VTEX - Orders API" + path: "VTEX - Orders API" + - name: "VTEX - Orders API (PII version)" + path: "VTEX - Orders API (PII version)" + - name: "VTEX - Orders API PII version" + path: "VTEX - Orders API PII version" + - name: "VTEX - Organization Units API" + path: "VTEX - Organization Units API" + - name: "VTEX - Payment Policies API" + path: "VTEX - Payment Policies API" + - name: "VTEX - Payment Provider Protocol" + path: "VTEX - Payment Provider Protocol" + - name: "VTEX - Payments Gateway API" + path: "VTEX - Payments Gateway API" + - name: "VTEX - Pick and Pack API" + path: "VTEX - Pick and Pack API" + - name: "VTEX - Pick and Pack Changes API" + path: "VTEX - Pick and Pack Changes API" + - name: "VTEX - Pick and Pack Last Mile Protocol API" + path: "VTEX - Pick and Pack Last Mile Protocol API" + - name: "VTEX - Pick and Pack Order Changes API" + path: "VTEX - Pick and Pack Order Changes API" + - name: "VTEX - Pick and Pack Protocol API" + path: "VTEX - Pick and Pack Protocol API" + - name: "VTEX - Policies System API" + path: "VTEX - Policies System API" + - name: "VTEX - Pricing API" + path: "VTEX - Pricing API" + - name: "VTEX - Pricing Hub" + path: "VTEX - Pricing Hub" + - name: "VTEX - Profile System" + path: "VTEX - Profile System" + - name: "VTEX - Promotions & Taxes API" + path: "VTEX - Promotions & Taxes API" + - name: "VTEX - Promotions & Taxes API - v2" + path: "VTEX - Promotions & Taxes API - v2" + - name: "VTEX - Punchout API" + path: "VTEX - Punchout API" + - name: "VTEX - Recommendations BFF API" + path: "VTEX - Recommendations BFF API" + - name: "VTEX - Recurrence (v1 - deprecated)" + path: "VTEX - Recurrence (v1 - deprecated)" + - name: "VTEX - Reviews and Ratings API" + path: "VTEX - Reviews and Ratings API" + - name: "VTEX - Search API" + path: "VTEX - Search API" + - name: "VTEX - Session Manager API" + path: "VTEX - Session Manager API" + - name: "VTEX - Shopee Integration API" + path: "VTEX - Shopee Integration API" + - name: "VTEX - Shopper Data API" + path: "VTEX - Shopper Data API" + - name: "VTEX - SKU Bindings API" + path: "VTEX - SKU Bindings API" + - name: "VTEX - SSL Certificates API" + path: "VTEX - SSL Certificates API" + - name: "VTEX - Storefront Permissions API" + path: "VTEX - Storefront Permissions API" + - name: "VTEX - Storefront Roles API" + path: "VTEX - Storefront Roles API" + - name: "VTEX - Subscriptions API (v2)" + path: "VTEX - Subscriptions API (v2)" + - name: "VTEX - Subscriptions API (v3)" + path: "VTEX - Subscriptions API (v3)" + - name: "VTEX - Subscriptions API v3" + path: "VTEX - Subscriptions API v3" + - name: "VTEX - Template openAPI" + path: "VTEX - Template openAPI" + - name: "VTEX - Tracking" + path: "VTEX - Tracking" + - name: "VTEX - User Data Rights API" + path: "VTEX - User Data Rights API" + - name: "VTEX - User Rights API" + path: "VTEX - User Rights API" + - name: "VTEX - User Rights Data API" + path: "VTEX - User Rights Data API" + - name: "VTEX - VTEX Do API" + path: "VTEX - VTEX Do API" + - name: "VTEX - VTEX ID API" + path: "VTEX - VTEX ID API" + - name: "VTEX - VTEX Shipping Network API" + path: "VTEX - VTEX Shipping Network API" + - name: "VTEX_TEMPLATE" + path: "VTEX_TEMPLATE" + +specs: + +docs: ''