Hello!
I develop external apps and use VTEX’s REST APIs.
I have a client that has special prices based on a rule created like this: Configurar tabelas de preços para usuários específicos
On the website, when the user is logged in, the special prices appear correctly in both search results and checkout.
I use the api/vtexid/pub/authentication/start and api/vtexid/pub/authentication/classic/validate endpoints to authenticate the user and retrieve the authCookie
{
"authStatus": "Success",
"promptMFA": false,
"lastAttemptAvailable": null,
"clientToken": null,
"authCookie": {
"Name": "VtexIdclientAutCookie_vendor",
"Value": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjhCMUZEMjlENzRGMzBEQzhDQzcyQjFDMzAzOTc0OEIzNDQ0REE0OTUiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJpZ29yLm5hc3NpZkBjb3"
},
"accountAuthCookie": {
"Name": "VtexIdclientAutCookie_64c257eb-e3ba-43fe-9ca2-9bc0ffaecb9e",
"Value": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjhCMUZEMjlENzRGMzBEQzhDQzcyQjFDMzAzOTc0OEIzNDQ0REE0OTUiLCJ0eXAiOiJqd3QifQ.eyJzdWIiOiJpZ29yLm5hc3NpZkBjb3JlYml6LmFnIiwiYWNjb3VudCI6InNvcnZvZWMiLCJhdWRpZW5jZSI6IndlYnN0b3JlIiwic2VzcyI6IjI2NzI1YWVlLWRhNTQtNDVmNi04Yzk3LTYwZjdiMjI0ZmJmOSIsImV4cCI6MTY4OTY4NTkyNS"
},
"expiresIn": 86399,
"userId": "e7e45e20-055f-4a41-bd3b-e91e",
"phoneNumber": null,
"scope": null
}
I’m not sure why, but only this endpoint appears in the documentation: VTEX ID. It only generates a token for the appKey and appToken.
When I perform a search using https://{{accountName}}.{{environment}}.com.br/api/catalog_system/pub/products/search, the products are returned with the price from the main price table.
I’ve already tried passing both VtexIdclientAutCookie_vendor and VtexIdclientAutCookie_64c257eb-e3ba-43fe-9ca2-9bc0ffaecb9e in the header, but with no success.
How do I get the API to understand the context of the logged-in user?


