- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm sending the following to the orders endpoint, but the total requested does not include shipping, what do i need to change:
{
"intent": "CAPTURE",
"application_context": {
"return_url": "https://mydomain.localhost/cart/checkout-success",
"cancel_url": "https://mydomain.localhost/cart/checkout-success"
},
"purchase_units": [
{
"items": [
{
"name": "Cubik",
"description": "Lorem ipsum dolor sit ame",
"quantity": 1,
"unit_amount": { "currency_code": "GBP", "value": "10" }
},
{
"name": "product 1",
"description": "Lorem ipsum dolor sit ame",
"quantity": 1,
"unit_amount": { "currency_code": "GBP", "value": "15" }
}
],
"amount": {
"value": 25,
"currency_code": "GBP",
"breakdown": {
"item_total": {
"currency_code": "GBP",
"value": "25",
"shipping": "4.50"
}
}
}
}
]
}
Solved! Go to Solution.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day @icicic,
Thank you for your post and welcome to the Community Forum.
I could see that you have placed the "Shipping" under "item_total" object.
Can you please try placing the "Shipping"object inside "breakdown" object.
Guide link - https://developer.paypal.com/docs/api/orders/v2/#definition-amount_breakdown
Sincerely,
Chiranjeevi
PayPal/Braintree MTS
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, but it fails
'{"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"e7477312020e8","details":[{"field":"\/purchase_units\/0\/amount\/breakdown\/shipping","location":"body","issue":"MALFORMED_REQUEST_JSON","description":"The request JSON is not well formed."}],"links":[{"href":"https:\/\/developer.paypal.com\/docs\/api\/orders\/v2\/#error-MALFORMED_REQUEST_JSON","rel":"information_link","encType":"application\/json"}]}
Array
(
[intent] => CAPTURE
[application_context] => Array
(
[return_url] => https://myhost.localhost/cart/checkout-response1
[cancel_url] => https://myhost.localhost/cart/checkout-response1
)
[purchase_units] => Array
(
[0] => Array
(
[items] => Array
(
[0] => Array
(
[name] => Cubik
[description] => Lorem ipsum dolor sit ame
[quantity] => 1
[unit_amount] => Array
(
[currency_code] => GBP
[value] => 10
)
)
[1] => Array
(
[name] => Lorem ipsum
[description] => Lorem ipsum dolor sit ame
[quantity] => 1
[unit_amount] => Array
(
[currency_code] => GBP
[value] => 15
)
)
)
[amount] => Array
(
[value] => 25
[currency_code] => GBP
[breakdown] => Array
(
[item_total] => Array
(
[currency_code] => GBP
[value] => 29.5
)
[shipping] => 4.50
)
)
)
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Array
(
[intent] => CAPTURE
[application_context] => Array
(
[return_url] => https://myhost.localhost/cart/checkout-response1
[cancel_url] => https://myhost.localhost/cart/checkout-response1
)
[purchase_units] => Array
(
[0] => Array
(
[items] => Array
(
[0] => Array
(
[name] => Lorem
[description] => Lorem ipsum dolor sit ame
[quantity] => 1
[unit_amount] => Array
(
[currency_code] => GBP
[value] => 10
)
)
[1] => Array
(
[name] => Lorem2
[description] => Lorem ipsum dolor sit ame
[quantity] => 1
[unit_amount] => Array
(
[currency_code] => GBP
[value] => 15
)
)
)
[amount] => Array
(
[value] => 29.5
[currency_code] => GBP
[breakdown] => Array
(
[item_total] => Array
(
[currency_code] => GBP
[value] => 25
)
[shipping] => Array
(
[value] => 4.50
[currency_code] => GBP
)
)
)
)
)
)
got it, shipping needs to be an object and include currency_code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Sandbox account collect billing and shipping address in Sandbox Environment
- Should merchant pay for full refund if wrong item was shipped ? in PayPal Reporting
- Shopify PayPal integration, customer authorized multiple times in PayPal Payments Standard
- Selected Shipping Method amount not updating to cart for card payment in SDKs
- Error payment in PayPal Payments Standard