The orderForm is the main object processed by VTEX Checkout and one of the most important data structures in the architecture of every VTEX store. It stores a lot of contextual information about the order, which is essential for processing order information, such as order items, customer personal information, delivery address, and shipping information.
This guide will describe how to remove all messages from the messages
field of the orderForm, leaving it empty.
Removing all messages from the orderForm message field
To remove all messages from the orderForm messages
field of the shopping cart, you need to use the Clear orderForm messages endpoint. The orderFormId
information of the shopping cart must be sent through the URL request, as in the example below:
https://{accountname}.{environment.com.br}/api/checkout/pub/orderForm/ede846222cd44046ba6c638442c3505a/messages/clear
Additionally, you need to send the request body containing only two curly brackets, as shown below:
_10{}
After sending the request, the endpoint will return the response body containing the shopping cart information and the messages
field will empty, as in the example below:
_10_10"messages": [],
For more information about the meaning of each field available in the shopping cart, please refer to the orderForm overview.
Error codes
The following errors may appear as messages in the response body:
400 - Bad Request
- Message error example (code 001):
"Bad Request"
. This message indicates that information other than{}
was sent in the request body.
_10{_10 "fields": {},_10 "error": {_10 "code": "001",_10 "message": "Bad request",_10 "exception": null_10 },_10 "operationId": "91b68251-1a60-4716-b846-c7c9c31fa565"_10}
- Message error example (code ORD002):
"Carrinho inválido"
(Invalid Cart). This message indicates that theorderFormId
used in the request does not exist or is incorrect.
_10{_10 "fields": {},_10 "error": {_10 "code": "ORD002",_10 "message": "Carrinho inválido",_10 "exception": null_10 },_10 "operationId": "5d37a185-bfe6-4686-9d92-aac9482cc63d"_10}
404 - Not Found
- Message error example:
"The requested URL was not found on the server"
: check if the URL is correct.
_10<body>_10 <h1>404 Not Found</h1>_10 <p>The requested URL was not found on this server.</p>_10</body>