Documentation
Feedback
Guides
API Reference

Guides
CheckoutCart AttachmentsAdding customer profile information to the cart
Adding customer profile information to the cart

The shopping cart gathers information on the products the customer chooses while browsing a store, such as prices, shipping costs, payment methods, delivery methods, etc. This data may include item prices, shipping value, payment, and delivery methods, among others.

This guide will describe how to add customer profile information to the shopping cart via API.

Getting shopping cart information

The first step is to get the orderFormId of the shopping cart to which you want to add the customer preferences information. For more information, read the Getting cart information by ID guide.

Adding customer profile information to the shopping cart

To add customer profile information to the shopping cart, use the Add client profile endpoint. In this request, you must send the orderFormId through the URL address, as shown in the example below:

https://{accountName}.{environment.com.br}/api/checkout/pub/orderForm/ede846222cd44046ba6c638442c3505a/attachments/clientProfileData

Additionally, you need to send the request body containing the following customer information:

  • Required:

    • email: Customer email address.
    • firstName: Customer first name.
    • lastName: Customer last name.
    • documentType: Type of document provided by the customer (e.g., CPF in Brazil, SSN in the U.S.).
    • document: Document number provided by the customer.
  • Recommended (optional):

    • phone: Customer phone number.
  • If the client is a legal entity:

    • corporateName: Company name.
    • tradeName: Trade name.
    • corporateDocument: Corporate document.
    • stateInscription: State document number.
    • corporatePhone: Business phone number.
    • isCorporate: True.

After sending the request, the endpoint will return the response body containing the client information in the shopping cart, as in the example below:


_19
...
_19
"clientProfileData": {
_19
"email": "customer@examplemail.com",
_19
"firstName": "first-name",
_19
"lastName": "last-name",
_19
"document": "123456789",
_19
"documentType": "cpf",
_19
"phone": "+55110988887777",
_19
"corporateName": "company-name",
_19
"tradeName": "trade-name",
_19
"corporateDocument": "12345678000100",
_19
"stateInscription": "12345678",
_19
"corporatePhone": "+551100988887777",
_19
"isCorporate": false,
_19
"profileCompleteOnLoading": false,
_19
"profileErrorOnLoading": false,
_19
"customerClass": null
_19
}
_19
...

️ For more information on each field available in the shopping cart, see the orderForm overview.

Error codes

The following errors may appear as a message in the response body.

400 - Bad Request

  • Message error example (code ORD002): "Invalid order form". The orderFormId information is not valid.

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "ORD002",
_10
"message": "Invalid order form",
_10
"exception": null
_10
},
_10
"operationId": "5d9f54e6-7db4-46d6-bca9-deeb278b8b98"
_10
}

  • Message error example (code ORD007): "The email field in the customer profile attachment is invalid": This message indicates that the email used in the request does not exist or is incorrect.

_10
{
_10
"fields": {},
_10
"error": {
_10
"code": "ORD007",
_10
"message": "The email field in the customer profile attachment is invalid",
_10
"exception": null
_10
},
_10
"operationId": "37fcbaf6-9245-46b2-8735-f5fb304d1ac2"
_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>

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page