List orders endpoint with RnB filter not returning correctly

Hey everyone, hope you’re all doing well!

I’m having trouble trying to perform an action on this endpoint — I need to fetch orders where a promotion (RnB) was activated. I have all the information about the promotion: id, name, etc.
When I add the promotion name to the RnB filter, it doesn’t filter correctly, which I believe is due to some special characters. When I try wrapping the name in “” for example, it returns extra orders where the promotion wasn’t active.

Is there any way to work around this, or to filter by the promotion ID instead?

The promotion name is: #0001 - Cupom de desconto de R$10,00 em compras a partir de R$50,00 em produtos de Alimentação - DESCONTO10

Encoding generated by Postman: /api/oms/pvt/orders?page=1&per_page=15&f_RnB=%230001%20-%20Cupom%20de%20desconto%20de%20R$10,00%20em%20compras%20a%20partir%20de%20R$50,00%20em%20produtos%20de%20Alimenta%C3%A7%C3%A3o%20-%20DESCONTO10

I also tried sending it without encoding, replacing spaces with “+”, but also without success.

@thiagofrois all good? I imagine it’s probably the special characters in the name or the spaces (even though that name is more of a description than an actual name lol).

Out of curiosity, try replacing the spaces with +

Ex: #0001±+Discount+coupon+… etc

See if that changes anything for you.

Cheers.

Hello!

It seems like the values (R$10.00 and R$50.00) weren’t “encoded”.

I put the f_RnB text into the VTEX simulator and it returned something slightly different.

Test it and see if it fixes it!

I agree haha! I tried too but it didn’t work, thanks!

Well spotted! I tried both the string with spaces and using “+” in the VTEX simulator, using the text it returned, but still no results.

I think I’ll have to use the coupon usage endpoint after all.
Thanks everyone!