Documentation
Feedback
Guides
API Reference

Guides
Getting Started

Integration Guides




Payments

Orders

Fulfillment

VTEX inStore

UI Customization

Message Center

Pricing

Promotions

Infrastructure

Conversational Commerce

Search

VTEX Session

CheckoutConfiguration
Clear orderForm message field from cart

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 important to the processing of the order: order items, client's personal data, delivery address, freight information, among others.

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 shown by 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:

{}

After sending the request, the endpoint will return the response body containing the shopping cart information and the messages field empty, as shown in the example below:

"messages": [],

For more information about the meaning of each of the fields available in the shopping cart, access the orderForm overview.

Error codes

The following errors may appear as a message 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.
{ "fields": {}, "error": { "code": "001", "message": "Bad request", "exception": null }, "operationId": "91b68251-1a60-4716-b846-c7c9c31fa565" }
  • Message error example (code ORD002): "Carrinho inválido" (Invalid Cart). This message indicates that the orderFormId used in the request does not exist or is incorrect.
{ "fields": {}, "error": { "code": "ORD002", "message": "Carrinho inválido", "exception": null }, "operationId": "5d37a185-bfe6-4686-9d92-aac9482cc63d" }

404 - Not Found

  • Message error example: "The requested URL was not found on the server": check that the URL data is correct.
<body> <h1>404 Not Found</h1> <p>The requested URL was not found on this server.</p> </body>
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Get and update the seller exchange window
Fulfillment
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page