I am trying to create a payment using the REST API. I am generating a valid JSON however PayPal responds to my request with
{"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":"2cfe09ef6f5db"}
This is the JSON request
{
"intent":"sale",
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"reference_id":"",
"amount":{
"currency":"EUR",
"total":"10",
"details":{
"subtotal":"",
"shipping":"",
"tax":"",
"handling_fee":"",
"shipping_discount":"",
"insurance":"",
"gift_wrap":""
}
},
"description":"gopaypal create payment test",
"note_to_payee":"",
"custom":"gopaypal-test",
"invoice_number":"",
"soft_descriptor":"",
"payment_options":{
"allowed_payment_method":""
},
"item_list":{
"items":[
{
"sku":"",
"name":"Item test",
"description":"",
"quantity":"",
"price":"10",
"currency":"EUR",
"tax":"",
"url":""
}
],
"shipping_method":"",
"shipping_phone_number":""
},
"notify_url":"",
"order_url":""
}
],
"redirect_urls":{
"return_url":"http://dev.tudescontento.es/paypal/return",
"cancel_url":"http://dev.tudescontento.es/paypal/return"
}
}
The request is made without problems. My problem is the JSON I am passing to my request.
Looking at the docs my request seems to fit perfectly what PayPal expects