Create order: payment_source > paypal > experience_context: 400 Bad Request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your answer.
The missing PayPal-Request-Id(although marked as optional) caused the error.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- User is asked for shipping address when creating a credit card order in REST APIs
- PAYER_ACTION_REQUIRED returned for Capture intent when calling v2 checkout orders in Sandbox Environment
- Payment not automatically being captured, funds not transferred in Sandbox Environment
- Checkout page language issue in REST APIs
- Can't capture order, loop on action-required in REST APIs