Hey everyone, good afternoon!
I’m creating a price integration using price tables and I’m using the following endpoint:
/pricing/prices/{SKU} and passing the following body:
I have the following price tables: p1, p4, p5, p6, and p7, and in the "tradePolicyId" I end up passing my tables to store the prices.
{
“costPrice”: 1,
“basePrice”: 100,
“fixedPrices”: [
{
“tradePolicyId”: “p4”,
“value”: 72,
“listPrice”: 72
}
]
}
However, when I update the price for policy p4, it ends up replicating to all policies and I can’t figure out why.
Has anyone run into this issue and knows how to fix it?
Thanks in advance.
@Manzini How’s it going?
The issue you’re experiencing may be related to the way price tables and trade policies are being configured and stored in VTEX.
You can run some reverse tests to identify the problem, for example:
1. Price Table Configuration (Trade Policies):
- Check the Price Policies: Make sure each price table (p1, p4, p5, p6, p7) is correctly configured in the VTEX environment and that they are not linked to each other in a way that shares prices. Each
tradePolicyId should be properly isolated to allow for distinct price specifications.
2. Using the /pricing/prices/{SKU} Endpoint:
- When you pass the
tradePolicyId in the request body, VTEX should store the price only for the specific policy indicated. If changing one table is impacting others, there may be a configuration or cache issue causing this behavior.
3. Possible Causes and Solutions:
- Cache: Check whether there is any active cache that might be replicating changes across all policies. Sometimes, clearing the cache can resolve data synchronization issues.
- Price Fallback: Check if the system is configured to use a base or fallback price that applies to all policies when a specific price is not found for a given policy. This could explain why the change in
p4 is being reflected in the others.
- Pricing Configuration Errors: Make sure the price configuration for each policy is being done independently. Review whether there are any errors in the policy configuration within Master Data or elsewhere in the pricing setup.
4. Testing Recommendation:
- Test Isolation: Try isolating a single policy and running tests with it alone, monitoring whether the change impacts others. This can help pinpoint where the problem lies.
I hope this information gives you a starting point for finding a solution.
Cheers,
Estevão.
@estevao_santos thanks for the help, I managed to solve it as follows:
In the object I’m sending, it’s necessary to include the fixedPrices Array with all the values from the tables. Example:
{
“costPrice”: 1,
“basePrice”: 100,
“fixedPrices”: [
{
“tradePolicyId”: “p4”,
“value”: 72,
“listPrice”: 72
},
{
“tradePolicyId”: “p5”,
“value”: 100,
“listPrice”: 100
}
]
}
The basePrice needs to be the same for all of them — since I was changing it according to my price table, it ended up updating across all tables.