Request is not well-formed, syntactically incorrect, or violates schema.
deb1231
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Apr-04-2020
12:09 PM
var createOrder = {
method : "POST",
headers : {
"Accept" : "application/json",
"Content-Type" : "application/json",
"Authorization" : "Bearer <Access Token>"
},
data :{
"intent": "CAPTURE",
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": "14.4",
}
}
]
}
}
request(createOrder,function(error,response,body){
response.body;
})
I am using the above parameters to create a order in node js.
But i always get a same error like :-
But i always get a same error like :-
{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "94dec6f54ac7b",
"details": [
{
"field": "/intent",
"value": "",
"location": "body",
"issue": "MISSING_REQUIRED_PARAMETER",
"description": "A required field / parameter is missing."
},
{
"field": "/purchase_units",
"value": "",
"location": "body",
"issue": "MISSING_REQUIRED_PARAMETER",
"description": "A required field / parameter is missing."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-MISSING_REQUIRED_PARAMETER",
"rel": "information_link",
"encType": "application/json"
}
]
}
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "94dec6f54ac7b",
"details": [
{
"field": "/intent",
"value": "",
"location": "body",
"issue": "MISSING_REQUIRED_PARAMETER",
"description": "A required field / parameter is missing."
},
{
"field": "/purchase_units",
"value": "",
"location": "body",
"issue": "MISSING_REQUIRED_PARAMETER",
"description": "A required field / parameter is missing."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-MISSING_REQUIRED_PARAMETER",
"rel": "information_link",
"encType": "application/json"
}
]
}
I don't know where i am wrong and where i am missing the structure of JSON
Tried all possible ways please need help
Tried all possible ways please need help
Labels:
Login to Me Too
- Labels:
-
Payments REST APIs
2 REPLIES 2
gonzaDG
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun-08-2020
07:06 PM
allabpow
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul-20-2020
05:10 AM
I have the same problem and make the request from the server.
Here is my \PayPalCheckoutSdk\Orders\OrdersCreateRequest Object:
PayPalCheckoutSdk\Orders\OrdersCreateRequest::__set_state(array(
'path' => '/v2/checkout/orders?',
'body' =>
array (
'intent' => 'CAPTURE',
'application_context' =>
array (
'brand_name' => 'foo',
'locale' => 'de-DE',
'landing_page' => 'BILLING',
'shipping_preferences' => 'foo',
'user_action' => 'PAY_NOW',
'return_url' => 'http://foo.lan/paypalcheckout-requestreturn',
'cancel_url' => 'http://foo.lan/paypalcheckout-requestcancel',
),
'purchase_units' =>
array (
0 =>
array (
'reference_id' =[Removed. Phone #s not permitted]db83e9619fb',
'description' => 'foo',
'amount' =>
array (
'currency_code' => 'EUR',
'value' => 34.71740740740741,
'breakdown' =>
array (
'item_total' =>
array (
'currency_code' => 'EUR',
'value' => 23.55740740740741,
),
'shipping' =>
array (
'currency_code' => 'EUR',
'value' => 11.16,
),
'tax_total' =>
array (
'currency_code' => 'EUR',
'value' => 3,
),
),
),
'items' =>
array (
0 =>
array (
'name' => 'foo 1000 Ø18,0mm',
'sku' => 'CP00083',
'unit_amount' =>
array (
'currency_code' => 'EUR',
'value' => '20.466667',
),
'tax' =>
array (
'currency_code' => 'EUR',
'value' => '3',
),
'quantity' => 0.16666666666666666,
),
),
'shipping' =>
array (
'method' => 'UPS',
'address' =>
array (
'address_line_1' => 'Somestreet',
'address_line_2' => 'Thename',
'admin_area_2' => 'City',
'postal_code' => '12345',
'country_code' => 'DE',
),
),
),
),
),
'verb' => 'POST',
'headers' =>
array (
'Content-Type' => 'application/json',
'Prefer' => 'return=representation',
),
))

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