question

liju avatar image
liju asked james-cha Deactivated commented

Order Line item creation via REST API failing when note on line item has notes in Spanish

Hello Clover Team,

We're facing an issue when one of our customers entered a note on an order line item in Spanish. The clover rest api is returning a 400 - Bad Request error for the POST api that adds a new line_item to an Order. For reference, the note text inserted by the customer is " Aguacate en rebanadas. Es para comer ahí ".

It works fine as soon as the last word 'ahí' is removed from the note, which seems to be the problem as it has a non-english character í . Is it that the apis will work only with English?

Could you please check why it is failing because of a text note and suggest how to fix this to allow any type of note from users ?

Thanks in advance.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chetan-purohit avatar image chetan-purohit commented ·

@Clover team, I am expecting answer of this question.

0 Likes 0 ·
chetan-purohit avatar image chetan-purohit commented ·

@Clover team, Please answer this question. I am waiting for your response.

0 Likes 0 ·

1 Answer

chetan-purohit avatar image
chetan-purohit answered james-cha Deactivated commented

I got the answer. We just have to set following thing in the header while making POST call:

'Transfer-Encoding' : 'chunked'

It will work if your payload contains non-ASCII characters.

3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

james-cha avatar image james-cha commented ·

Did this answer work for you Chetan Purohit? I tried to reproduce your issue and was not able too.

0 Likes 0 ·
chetan-purohit avatar image chetan-purohit commented ·

Yes James. Actually we have NodeJS server which is middle tier between user and clover server. We are making POST call from our NodeJS server. Previously our header was having only 3 properties:

'Content-Type': 'application/json',
'Content-Length': dataString.length,
'Authorization': 'Bearer ' + authToken

It was giving status code 400 in the response if any field was containing spanish characters.

After setting 'Transfer-Encoding' : 'chunked' it worked for me.

0 Likes 0 ·
chetan-purohit avatar image chetan-purohit commented ·

Yes James. Actually we have our NodeJS server which is middle tier between user and clover server. We are making POST call from our NodeJS server. Previously our header was having only 3 properties:

'Content-Type': 'application/json',
'Content-Length': dataString.length,
'Authorization': 'Bearer ' + authToken

It was giving status code 400 in the response if any field was containing spanish characters.

After setting 'Transfer-Encoding' : 'chunked' it worked for me.

0 Likes 0 ·

Welcome to the
Clover Developer Community