New to the community? Welcome! Please read our Community Rules and Guidelines
Pay, shop, and do even more on the PayPal appGet the App
Dear Helpers,
I try to create a simple (sample) order according to the documentation of the REST APIs:
https://developer.paypal.com/docs/api/orders/v2/
(see Sample Request)
The request with the following simple data works fine:
{
"intent":"CAPTURE",
"purchase_units":[
{"amount":{
"currency_code":"EUR",
"value":100
}
}
]
}
When I try to add the experience_context (https://developer.paypal.com/docs/api/orders/v2/#definition-paypal_wallet_experience_context) according to the Sample Request of the documentation, I get the following answer
The requested URL returned error: 400 Bad Request
This is the data:
{
"intent":"CAPTURE",
"purchase_units":[
{
"amount":{
"currency_code":"EUR",
"value":100
}
}
],
"payment_source":{
"paypal":{
"experience_context":{
"brand_name":"testme"
}
}
}
}
I can't find my mistake. What am I doing wrong?
Good day @no_clue,
Thank you for posting to the PayPal community.
Can you please try now and make sure your passing valid HEADER PARAMETERS and following the steps provided in the below guide links.
https://developer.paypal.com/api/rest/requests/#http-request-headers
https://developer.paypal.com/docs/api/orders/v2/#orders_create
If your still facing issues, please create a MTS ticket via - https://www.paypal-support.com/s/?language=en_US with the 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.
Thank you very much for your answer.
The missing PayPal-Request-Id(although marked as optional) caused the error.
©1999-2023 PayPal, Inc. All rights reserved.