• Resolved dansvv

    (@dansvv)


    We are intermittently getting the following error: [INVALID_REQUEST] Request is not well-formed, further on, it states INVALID_STRING_LENGTH. This does not happen for all transactions, just a select few.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @dansvv,

    Are there any emojis in any of your products descriptions? This could be a potential cause for this issue.
    To learn more about these orders, we would be interested in your plugin log files. These log files are only written when “Logging” is enabled in the plugin settings.
    If enabled, then every transaction will create a log entry that can be accessed from here:
    WooCommerce > Status > Logs > select “woocommerce-paypal-payments-[…]” in the dropdown and click on view.?

    If “Logging” was not yet enabled, could you please enable it and then try to create an order so that the error message is saved?
    You can share the log either here in the forums or privately with us from here:
    https://paypal.inpsyde.com/docs/request-support/
    If you choose the latter, please include a link to this thread.
    Thanks!

    Kind regards,
    Niklas

    Thread Starter dansvv

    (@dansvv)

    Hi @niklasinpsyde, there are indeed emojis in the description! I’ll remove them for now, but is there a workaround as quite keen to keep them if possible? As I said previously, it wasn’t all Paypap transactions that failed, just some. Here’s an example from the logs of one of these transactions:

    2021-12-03T19:41:18+00:00 WARNING Failed to create order. PayPal API response: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    2021-12-03T19:41:18+00:00 ERROR Order creation failed: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    2021-12-03T19:41:18+00:00 ERROR Order creation failed: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH`

    Obviously, I’ve omitted the next bit (request body) due to customer details being visible. Hope this is enough!

    Thanks for your response and prompt reply,

    Daniel

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @dansvv,

    The response body should contain more information about what’s causing this error in particular.
    But generally, the plugin sends the first 127 characters of the product description to PayPal but doesn’t appear to handle the string length of emojis properly, as an emoji normally counts as more than one character.
    When the emojis are in the description after the first 127 characters, then they will not be sent to PayPal and it should not result in this API response. Otherwise, if you have a very short product description, emojis can work as long as the character limit is not reached.

    But anyway we are working with PayPal to resolve this issue so that you can add as many emojis as you want to the product description.

    Kind regards,
    Niklas

    I got nearly the same message. See below. Is this the same reason? I do not have any Emojes or soemthing like this in the product description.
    The desription is “Gutschein – 75 €”

    Following is the log:

    2022-01-30T12:21:33+00:00 WARNING Failed to create order. PayPal API response: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    2022-01-30T12:21:33+00:00 ERROR Order creation failed: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    2022-01-30T12:21:33+00:00 ERROR Order creation failed: [INVALID_REQUEST] Request is not well-formed, syntactically incorrect, or violates schema. https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    2022-01-30T12:21:38+00:00 DEBUG POST https://api.sandbox.paypal.com/v1/billing-agreements/agreement-tokens
    Request Body: {"description":"Checking if reference transactions are enabled","payer":{"payment_method":"PAYPAL"},"plan":{"type":"MERCHANT_INITIATED_BILLING","merchant_preferences":{"return_url":"https:\/\/example.com\/return","cancel_url":"https:\/\/example.com\/cancel","skip_shipping_address":true}}}
    Response Debug ID: 7871ad97693b9
    • This reply was modified 3 years, 1 month ago by campkom852.

    Hello WordPress Team,

    we are facing the same problem. We are having Emojis in the product description in the first 127 characters an we get failed orders and error messages with INVALID_REQUEST and INVALID_STRING_LENGTH.

    Response Body: {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"e86ef51515750","details":[{"field":"/items/0/description","value":"\uD83C\uDF32 Wie verwendet man das Zirben?l?\r\nDer Duft des Zirbenholzes kann durch das Tropfen von ?l aufgefrischt und intensiviert werden","location":"body","issue":"INVALID_STRING_LENGTH","description":"The value of a field is either too short or too long."},{"field":"/items/1/description","value":"\uD83C\uDF32 Wie verwendet man das Zirben?l?\r\nDer Duft des Zirbenholzes kann durch das Tropfen von ?l aufgefrischt und intensiviert werden","location":"body","issue":"INVALID_STRING_LENGTH","description":"The value of a field is either too short or too long."}],"links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH","rel":"information_link","encType":"application/json"}]}

    We can probably fix this by removing the emojis but for sure that’s of a error that needs to be fixed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[INVALID_REQUEST] Request is not well-formed’ is closed to new replies.