Menu
Feedback
Start here

Known issues

Known issues
Pricing API Allows Negative Values
Catalog
ID: 774548
Backlog
Published on3/20/2023
Last updated on3/20/2023
1 min read

Summary

Currently, the PUT Price API allows the input of negative values via PUT API Payload, if you set the markup and baseprice to negative values, you'll set the product as unavailable.

Simulation

On the API https://api.vtex.com/account/pricing/prices/1

Set the following price:

{   "itemId": "1",   "listPrice": null,   "costPrice": 11.9,   "markup": -100,   "basePrice": null,   "fixedPrices": [ ] }

The response will be:

{"base64":"  ","img":{"width":344,"height":176,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":7881,"url":"https://raw.githubusercontent.com/vtexdocs/known-issues/refs/heads/main/docs/en/known-issues/Catalog/pricing-api-allows-negative-values_1.png"}}

Which breaks the pricing logic and makes the product unavailable, since the checkout and catalog applications aren't able to deal with negative price values.

Workaround

n/a

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback