API call error 400. Request is not well-formed, syntactically incorrect, or violates schema.
bagse2
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jun-23-2023
04:28 PM
I don't understand please help.
below is a copy of my request.
I keep getting the same error 400
"InnerException = {"{\"name\":\"INVALID_REQUEST\",\"message\":\"Request is not well-formed, syntactically incorrect, or violates schema.\",\"debug_id\":\"bd5e1ff1bd5b6\",\"details\":[{\"field\":\"/purchase_units/@reference_id=='1194780236'/items/0/category\",\"value\":\"\",\..."
Many thanks if you can help.
REQUEST
{
"application_context": {
"brand_name": "JustAddFlavour",
"cancel_url": "http://localhost:44325/Cancel.aspx",
"landing_page": "www.JustAddFlavour.com/Home",
"return_url": "http://localhost:44325/CheckOutReceipt.aspx",
"shipping_preference": "postal",
"user_action": "CONTINUE"
},
"intent": "CAPTURE",
"purchase_units": [
{
"amount": {
"breakdown": {
"handling": {
"currency_code": "GBP",
"value": "5.00"
},
"item_total": {
"currency_code": "GBP",
"value": "4.45"
},
"shipping": {
"currency_code": "GBP",
"value": "1.22"
},
"shipping_discount": {
"currency_code": "GBP",
"value": "10.00"
},
"tax_total": {
"currency_code": "GBP",
"value": "0.89"
}
},
"currency_code": "GBP",
"value": "4.45"
},
"custom_id": "235",
"description": "Spice Packs for Recipes",
"items": [
{
"category": "Barbecue",
"description": "BBQ Chicken Kebab",
"name": "BBQ Chicken Kebab",
"quantity": "1",
"sku": "1194776",
"tax": {
"currency_code": "GBP",
"value": "0.89"
},
"unit_amount": {
"currency_code": "GBP",
"value": "4.45"
}
}
],
"reference_id": "1194776 236",
"shipping": {
"address": {
"admin_area_1": ""
},
"name": "xxxxxx"
},
"soft_descriptor": "SoftDescriptor1"
}
]
}
RESPONSE
{
"debug_id": "2dab77701b927",
"details": [
{
"description": "A required field / parameter is missing.",
"field": "/purchase_units/@reference_id=='1194776 236'/shipping/address/country_code",
"issue": "MISSING_REQUIRED_PARAMETER",
"location": "body",
"value": "xxxxxx"
},
{
"description": "The value of a field is invalid.",
"field": "/application_context/landing_page",
"issue": "INVALID_PARAMETER_VALUE",
"location": "body",
"value": "xxxxxx"
},
{
"description": "The value of a field is invalid.",
"field": "/application_context/shipping_preference",
"issue": "INVALID_PARAMETER_VALUE",
"location": "body",
"value": "xxxxxx"
},
{
"description": "The value of a field is invalid.",
"field": "/purchase_units/@reference_id=='1194776 236'/items/0/category",
"issue": "INVALID_PARAMETER_VALUE",
"location": "body",
"value": "xxxxxx"
}
],
"links": [
{
"encType": "xxxxxx",
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_VALUE",
"rel": "information_link"
},
{
"encType": "xxxxxx",
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-MISSING_REQUIRED_PARAMETER",
"rel": "information_link"
}
],
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"name": "INVALID_REQUEST"
}
0 REPLIES 0

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- "issue": "NOT_ENABLED_TO_VAULT_PAYMENT_SOURCE" in REST APIs
- Error payment in PayPal Payments Standard
- Compliance violation. flag based on the account origin ? in Sandbox Environment
- Jotform PayPal Business Integration Questions to Connect are incorrect for non-profit in PayPal Payments Standard
- Paypal Advanced Payment : 3d error in live in Sandbox Environment