Create Payment rejects my request made with transactions and item_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the client-side (Javascript) Paypal integration within a Vue.js app. I was able to successfully create and receive a completed payment following this Paypal component guide here. However, I need to be able to pass the detailed line items so that (1) my customers know exactly what they are tendering payment for at all stages of the checkout and so that (2) my merchant has access to their history of what was purchased with each Paypal transaction.
I am currently getting this error but my data suggests appears to be what is required per my understanding of this Paypal create payment API reference here. The error I get from my Chrome Developer Tools is this:
Uncaught Error: Error: Request to post https://www.sandbox.paypal.com/v1/payments/payment failed with 400 error. Correlation id: 6cdb868c81733, 6cdb868c81733
{
"name": "VALIDATION_ERROR",
"details": [
{
"field": "transactions.amount",
"issue": "Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"
}
],
"message": "Invalid request - see details",
"information_link": "https://developer.paypal.com/docs/api/payments/#errors",
"debug_id": "6cdb868c81733"
}
at XMLHttpRequest.<anonymous> (https://www.paypalobjects.com/api/checkout.4.0.223.js:14044:39)
In terms of code, my Paypal button is configured as follows:
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"transactions": [
{
"description": "Starwicker Checkout",
"amount": {
"currency": "USD",
"total": 19.94,
"details": {
"subtotal": 15.94,
"tax": 2.01,
"shipping": 1.99
}
},
"item_list": {
"items": [
{
"sku": "DTF060",
"name": "Mars",
"description": "Starwicker Mars",
"quantity": 1,
"price": 15.94,
"tax": 2.01
}
]
}
}
]
}
- Labels:
-
Express Checkout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, any fix to this particular error ? I would like to know if you've done something to make this fix ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're still experiencing this issue, can you please share a new debug_id ?
The existing ones provided appear to have expired.
Thanks !
Was my post helpful? If so, please give me a kudos!
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Paypal payment error analysis and root cause in NVP/SOAP APIs
- Need Help Upgrading to PayPal complete payments in PayPal Upgrade Community
- How to get opening and closing balance with List transactions API request in REST APIs
- Payee account is invalid issue in REST APIs
- ManageRecurringPaymentsProfileStatus method stopped working. in NVP/SOAP APIs