Marketplace is the platform where products from different sellers can be offered to customers in one place. After the customer completes a purchase and the order is created, there may be scenarios in which the original seller of the product needs to be modified, for example, when their cancels the order due to an internal unavailability of product fulfillment.
In this situation, VTEX allows the marketplace to have a period of time (window), after the customer completes the purchase, to change sellers and thus avoid an order cancellation. For more information on the process of switching sellers, access the guides in the Help Center and the Developer Portal.
The default window for the change seller is 2 days. However, you can modify the value for up to a maximum period of 30 days.
This guide describes how to get a seller's current exchange window or update this value in a marketplace on your account.
Getting the current window to change seller
To get the window to change seller in a marketplace, you need to use the Get window to change seller endpoint as a GET request. In this request, you must send the accountname
through the URL address, as shown by the example below:
Method: GET
https://{accountName}.{environment.com.br}/api/checkout/pvt/configuration/window-to-change-seller
After sending the request, the endpoint will return the response body showing the maximum current period of time (days after the customer's purchase) allowed to perform the seller exchange:
_10"4"
Updating the window to change seller
To update the seller's exchange window (in days), you need to use a similar request of the Get window to change seller, but as a POST request (Update window to change seller), as shown by the example below:
Method: POST
https://{accountName}.{environment.com.br}/api/checkout/pvt/configuration/window-to-change-seller
See a request body example below (10 days):
_10{_10 "waitingTime": 10_10 }
After sending the request, the endpoint will return code 201 (Created)
and an empty response body.
To confirm that the new window to change seller have been applied to your account, access the Get window to change seller endpoint again as a GET request.
Error codes
The following errors may appear as a message in the response body.
401 - Unauthorized
- Message error example (code ORD062):
"Unauthorized"
. The credentials (Application Key and Application Token) used in this request are incorrect or not authorized to access this type of information.
_10{_10 "fields": {},_10 "error": {_10 "code": "ORD062",_10 "message": "Unauthorized",_10 "exception": null_10 },_10 "operationId": "8ec4b686-435f-42ab-8cfd-89306f888c3c"_10}
404 - Not Found
- Message error example:
"The requested URL was not found on the server"
: check that the URL data is correct.
_10<body>_10 <h1>404 Not Found</h1>_10 <p>The requested URL was not found on this server.</p>_10</body>