cancel
Showing results for 
Search instead for 
Did you mean: 

Create order: payment_source > paypal > experience_context: 400 Bad Request

Options
no_clue
Contributor
Posted on

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?

2 REPLIES 2

Create order: payment_source > paypal > experience_context: 400 Bad Request

Options
Chiranjeevi_L
PayPal Employee

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.

Create order: payment_source > paypal > experience_context: 400 Bad Request

Options
no_clue
Contributor

@Chiranjeevi_L 

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.