The /_search route of the Gift card system intermittently does not return vouchers when the REST-range header is less than 10.
ID: 770337
Backlog
Published on 3/13/2023
•
Last update on 3/13/2023
Summary
In a scenario where the customer has loyalty vouchers and reaches the checkout, it is expected that the /_search route returns all vouchers linked to that user. However, the checkout passes the header with REST-range = 0-9. In some accounts, this range is not sufficient and the API returns an empty array. When we simulate the call directly to the API with a range greater than 10, we are able to retrieve at least one voucher.
Simulation
To have a store in this situation and make a POST to this route https://developers.vtex.com/docs/api-reference/giftcard-api#post-/giftcards/_search passing the header REST-range=giftcard=0-9.
Workaround
Use a number larger than the range of 0-9. However, the checkout does not customize this field.