Pass an array of items to purchase_units
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Trying to pass an array of items in array 'tixtopurch'. Array is created as follows:
tixtopurch.push([{"name":PLAYNAME,
"description":SCHEDDATE + ' SEAT: ' + seatInfo.settings.label,
"unit_amount":{"currency_code":"USD","value":seatInfo.data().price},
"quantity":"1"}]);
purchase_units: [{
amount: {
currency_code: "USD",
value: ppFEE.toFixed(2),
breakdown: {
item_total: {
currency_code: "USD",
value: ppFEE.toFixed(2)
}
}
},
items: tixtopurch
Paypal returns a malformed request error. If I enter the items directly in the items then it works. Have not been able to find why it does not like the array.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day @cxxxv1,
Thank you for posting to the PayPal community.
Yes, while performing the "Create Order" API call, merchant(i.e you) should pass the "items" value under "purchase_units" that the customer purchased which contains the name, quantity, description etc.
https://developer.paypal.com/docs/api/orders/v2/#orders_create
https://developer.paypal.com/docs/api/orders/v2/#orders_create!path=purchase_units/items&t=request
If your still facing any issues, please create a MTS ticket via - https://www.paypal-support.com/s/?language=en_US with the detail information and error details.
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.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- permission_denied response in call to patch order when paying by Card in Braintree Client-side Integration (JS, iOS, Android SDKs)
- PayPal integration with Next, Lambda and API Gateway - 400 Invalid Request in Sandbox Environment
- Intermittent error when refunding: [L_LONGMESSAGE0] = Security header is not valid in NVP/SOAP APIs
- Error status PAYER_ACTION_REQUIRED on order capture in REST APIs
- What happens to cart items submitted to orders endpoint in REST APIs