Status 400

pawelbiernacki
Contributor
Contributor

Hi,

 

I wanted to integrate paypal with my website as described on https://developer.paypal.com/docs/checkout/integrate/. I get the following error when using paypal:

Error: /v2/checkout/orders returned status: 400 (Corr ID: 6389c1f0fb5dc)

 

The json I pass to the actions.order.create is:

{
payer: {
"payment_method": "paypal"
},
application_context:{
"locale":"fi-FI",
"brand_name":"PawelBiernackiSklep",
"landing_page":"login",
"shipping_preference":"get_from_file",
"user_action":"commit"
},
purchase_units: [{
"reference_id": "pawel_biernacki_sklep_order_1234",
"description": "PawelBiernackiSklep order-1234",
amount: {
currency: 'EUR',
details: {
"subtotal": "1.09",
"shipping": "0.02",
"tax": "0.33"
},
total: "1.44"
},
items: [{
name: 'wiersze',
sku: 'sku1',
price: '1.09',
currency: 'EUR',
quantity: '1'
}],
"payment_descriptor": "PawelBiernackiSklep"
}],
redirect_urls: {
return_url: "http://www.pawelbiernacki.net/PawelBiernackiSklep/Success",
cancel_url: "http://www.pawelbiernacki.net/PawelBiernackiSklep/Cancel"
}
});
}

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

pawelbiernacki
Contributor
Contributor

I got an answer from the technical support and thought I would share it here. A working JSON in my case is for example:

purchase_units: [{
amount: {
currency_code: "EUR",
value: "110.0",
breakdown: {
item_total: {currency_code:"EUR", value:"100.00"},
tax_total: {currency_code:"EUR", value:"10.00"}
}
},
items: [{name:"wiersze",tax:{currency_code:"EUR", value:"10.00"}, quantity:"1", unit_amount:{currency_code:"EUR", value:"100.00"}}]
}],
redirect_urls: {
return_url: 'http://www.pawelbiernacki.net/PawelBiernackiSklep/Success',
cancel_url: 'http://www.pawelbiernacki.net/PawelBiernackiSklep/Cancel'
}

View solution in original post

Login to Me Too
1 REPLY 1
Solved

pawelbiernacki
Contributor
Contributor

I got an answer from the technical support and thought I would share it here. A working JSON in my case is for example:

purchase_units: [{
amount: {
currency_code: "EUR",
value: "110.0",
breakdown: {
item_total: {currency_code:"EUR", value:"100.00"},
tax_total: {currency_code:"EUR", value:"10.00"}
}
},
items: [{name:"wiersze",tax:{currency_code:"EUR", value:"10.00"}, quantity:"1", unit_amount:{currency_code:"EUR", value:"100.00"}}]
}],
redirect_urls: {
return_url: 'http://www.pawelbiernacki.net/PawelBiernackiSklep/Success',
cancel_url: 'http://www.pawelbiernacki.net/PawelBiernackiSklep/Cancel'
}

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.