Cant work with umlaute ( ä,ö,ü) and Invoice API
olthom
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Oct-29-2023
04:39 AM
Hello!
I am trying to set up a Java Projekt in which i create and send invoices.
Unfortunately it seems, that the APi has problems handling umlaute ( Ä, Ü, Ö) in my requests
This is the response i get if the name contains an umlaut. ( i used Öliver as an example)
"name":"INVALID_REQUEST",
"message":"Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id":"3195c3b15b67e",
"details":[
{
"field":"invoicer/name/given_name",
"location":"body",
"description":"Invalid UTF-8 middle byte 0x6c at line:1, column:338"
This is the part of the Code that creates the invoice
URL invoiceUrl = new URL(invoiceEndpoint);
HttpURLConnection invoiceConn = (HttpURLConnection) invoiceUrl.openConnection();
invoiceConn.setRequestMethod("POST");
invoiceConn.setRequestProperty("Authorization", "Bearer " + accessToken);
invoiceConn.setRequestProperty("Content-Type", "application/json");
invoiceConn.setRequestProperty("Prefer", "return=representation");
invoiceConn.setRequestProperty("charset", "utf-8");
invoiceConn.setDoOutput(true);
OutputStreamWriter invoiceWriter = new OutputStreamWriter(invoiceConn.getOutputStream());
invoiceWriter.write(invoice.toString());
invoiceWriter.flush();
invoiceWriter.close();
Thank you for your help
Labels:
- Labels:
-
Invoicing REST APIs
0 REPLIES 0

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Problem with invoices in REST APIs
- Charge a customer for the remaining balance after a purchase has been made? in REST APIs
- Django-paypal form is not showing "pay with credit or debit card" option in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- Paypal subscription Api in REST APIs
- I'm getting an error when creating an invoice in PayPal Upgrade Community