Getting error MALFORMED_REQUEST_JSON in update order amount action

JoeyVM
Contributor
Contributor

Working in C#/JSON REST API

I have successfully created an order, as well as have it approved and completed.

I need to update the amount in the CREATED stage.

Here is my request and response that I receive - I believe it has something to do with wither the path value or the entire object I am updating, though I have tried multiple configurations for the object with no success to date:

 

REQUEST DATA:
"{\"op\":\"replace\",\"path\":\"/purchase_units/@reference_id=='default'/amount\",\"value\":{\"currency_code\":\"CAD\",\"value\":\"25.32\"}}"


REQUEST:
{
"additional_properties": "xxxxxx",
"body": {
"op": "xxxxxx",
"path": "xxxxxx",
"value": {
"currency_code": "xxxxxx",
"value": "xxxxxx"
}
},
"header": {
"accept": "application/json",
"accept-encoding": "identity",
"akamai-x-forwarded-for-7": "xxxxxx",
"authorization": "xxxxx",
"client-auth": "xxxxx",
"client_info": "xxxxxx",
"content-length": "121",
"content-type": "application/json; charset=utf-8",
"correlation-id": "1474feb9acb64",
"edge-locator": "xxxxxx",
"edgeid": "xxxxxx",
"host": "api.sandbox.paypal.com",
"paypal-request-id": "f4c72bec-73cd-4d70-9774-43f06c472335",
"paypal-routing-metadata": "xxxxxx",
"pp_client_ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256",
"pp_client_ssl_protocol": "TLSv1.2",
"pp_geo_loc": "CA",
"pp_remote_addr": "156.34.171.36",
"pp_vip": "173.0.93.165",
"user-agent": "Dalvik/2.1.0 (Linux; U; Android 10; SM-G960W Build/QP1A.190711.020)",
"x-forwarded-for": "10.96.34.43",
"x-forwarded-proto": "xxxxxx",
"x-paypal-correlation-id": "1474feb9acb64",
"x-pp-corrid": "1474feb9acb64",
"x-pp-idempotencyid": "1474feb9acb64_1673552825",
"x-pp-slingshot-targetapp": "apiplatformproxyserv",
"x-sigsci-agentresponse": "xxxxxx",
"x-sigsci-mac": "xxxxxx",
"x-sigsci-requestid": "xxxxxx",
"x-slr-orig-script_uri": "https://api.sandbox.paypal.com/v2/checkout/orders/1NW08562723809742"
},
"method": "PATCH"
}

 

 

RESPONSE:
{
"additional_properties": "xxxxxx",
"body": {
"debug_id": "1474feb9acb64",
"details": [
{
"description": "The request JSON is not well formed.",
"field": "/",
"issue": "MALFORMED_REQUEST_JSON",
"location": "body"
}
],
"links": [
{
"encType": "xxxxxx",
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-MALFORMED_REQUEST_JSON",
"rel": "information_link"
}
],
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"name": "INVALID_REQUEST"
},
"duration_time": "xxxxxx",
"header": {
"APPLICATION_ID": "APP-80W284485P519543T",
"BORDER-IP": "xxxxxx",
"CALLER_ACCT_NUM": "GAEWUQHX5X8ZU",
"Date": "Thu, 12 Ja[Removed. Phone #s not permitted]GMT",
"PROCESSING-IP": "xxxxxx",
"SERVER_INFO": "xxxxxx",
"paypal-debug-id": "1474feb9acb64"
},
"status": 400
}

 

Thanks for any help!

Login to Me Too
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.