Incoming JSON request does not map to API request

charliedidonato
Contributor
Contributor

I am having an issue creating a payment.

I get an access token via "/v1/oauth2/token"

 

I include the token in the subsequent Http POST to 

"/v1/payments/payment"

 

Here is the JSON for Create Payment

https://togaquikpics.com/json.txt

 

The POST returns

Response Status Line:HTTP/1.1 400 Bad Request
{"name":"MALFORMED_REQUEST","message":"Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"db69f2ad74eb..."}

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Justin
Moderator
Moderator
Hello,

The JSON request cannot be accessed as the site is unavailable. If you're receiving a "malformed request" response, part of your JSON request is invalid.

Here is simple payment creation request. Start here and make very small changes as you move through modifying the request, that way if you experience another issue like this one, you'll know which changed caused the issue and be able to revert it.

{
"intent":"sale",
"redirect_urls":{
"return_url":"https://www.paypal.com",
"cancel_url":"https://www.paypal.com"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
}
}
]
}


Was my post helpful? If so, please give me a kudos!

View solution in original post

Login to Me Too
1 REPLY 1
Solved

MTS_Justin
Moderator
Moderator
Hello,

The JSON request cannot be accessed as the site is unavailable. If you're receiving a "malformed request" response, part of your JSON request is invalid.

Here is simple payment creation request. Start here and make very small changes as you move through modifying the request, that way if you experience another issue like this one, you'll know which changed caused the issue and be able to revert it.

{
"intent":"sale",
"redirect_urls":{
"return_url":"https://www.paypal.com",
"cancel_url":"https://www.paypal.com"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
}
}
]
}


Was my post helpful? If so, please give me a kudos!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.