Response "Bad Request"

I'm sending the request below to:

I have the subscription key and bearer token in the header. I got this work in our staging environment using a fake credit card, but now I'm trying real data.

When I submit it comes back with “Bad Request” which isn't very detailed or helpful.

Does anyone see anything wrong with my submission? I changed some of the personal and CC data for public consumption.

{
"amount":500,
"billing_contact":{
"address":"123 My Address",
"city":"ANN ARBOR",
"country":"USA",
"first_name":"Kevin",
"last_name":"Konkle",
"post_code":"48108",
"state":"MI"
},
"credit_card":{
"exp_month":2,
"exp_year":2025,
"name":"Kevin Konkle",
"number":"4147XXXXXXXXXXXX"
},
"csc":"123",
"email":"kkonkle@wilson-bennett.com",
"payment_configuration_id":"280b752b-a301-4f87-911f-c58b20e5f77c",
"phone":"7341112222"
}

Comments

  • @WBT Tech
    Did you every get this working. I would be happy to share the structure of what we were posting but it stopped working about 4 days ago and so far we cannot figure out why. We get a message about a gateway decline due to lack of authentication

  • @Dean Mercer
    I did get it to work, but our client runs into requests regularly being denied. They may have 20 successful charges one night, but also 10 that failures.

    The most recent failure was last night, (one of 4 is below).

    The JSON looks correct to me, but it just comes back with “Bad Request”.

    {
    "amount":10000,
    "billing_contact":{
    "address":"1720 Road ",
    "city":"Cityville",
    "country":"USA",
    "first_name":"Alexandra",
    "last_name":"Tai",
    "post_code":"XXXXX",
    "state":"TX"
    },
    "credit_card":{
    "exp_month":XX,
    "exp_year":20XX,
    "name":"Alexandra (Alex) Tai",
    "number":"4400XXXXXXXXXX46"
    },
    "csc":"123",
    "email":"redacted@crimson.ua.edu",
    "payment_configuration_id":"280b752b-de01-4f47-901f-b58b80d5f79d",
    "phone":"678XXXXX93"
    }

    The remote server returned an error: (400) Bad Request.

  • Does anyone else have any ideas/experience with this error? I've identified several items that could cause it; expired card, comma in the amount, missing email address.

    I still have several submissions that come back with “Bad Request” even though all of the data in the request looks valid. Any other items I should look for in the request body that could cause it to fail?

Categories