question

mitchellc avatar image
0 Likes"
mitchellc asked ·

HTTP status code 400 Bad Request when creating a payment policy

This is my first API call in that has a REST payload (JSON) so I must have something structured incorrectly, but I can't figure it out. The request I'm sending and the response is below. Any ideas? I copied the JSON hash directly from the API explorer. **Request:**
POST https://api.sandbox.ebay.com/sell/account/v1/payment_policy
Authorization: Bearer omitted
Accept: application/json
Content-Type: application/json
{
    "categoryTypes": [{"name": "ALL_EXCLUDING_MOTORS_VEHICLES"}],
    "marketplaceId": "EBAY_US",
    "name": "minimal Payment Policy 2",
    "paymentMethods": [{"paymentMethodType": "PERSONAL_CHECK"}]
}
**Response**
HTTP/1.1 400 Bad Request
Content-Length=240
Cneonction=close
Date=Wed, 05 Apr 2017 22:21:46 GMT
RlogId=t6pitf%60quq%60%28ciudbq%60anng%7Fu2h%3F%3Cwk%7Dukqdespse*246%3E773-15b40359b06-0xf5
Set-Cookie=ebay=%5Esbf%3D%23%5E;Domain=.ebay.com;Path=/
X-EBAY-C-REQUEST-ID=ri=nBBiNhPxbfTF,rci=EUnsX1MWgG%2BsUiof
X-EBAY-C-VERSION=1.1.0
X-EBAY-REQUEST-ID=15b40359aed.a09632d.57988.fffcd130!
X-EBAY-SVC-EP-COOKIELET=321=0001491430906630
X-EBAY-SVC-TRACKING-DATA=nqc=AA**&nqt=AA**&!_epec=7,6,8
Content-Type=application/json
Connection=keep-alive
apirest api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zhuowei.developersupport@ebay.com avatar image
0 Likes"
zhuowei.developersupport@ebay.com answered ·
Hi mitchellc, I am sorry for replying late. Your issue has been reported to the engineering team and will keep you updated. Best Regards,
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mitchellc avatar image
0 Likes"
mitchellc answered ·
It is working now. I think they fixed a bug.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mitchellc avatar image
0 Likes"
mitchellc answered ·
The root of this problem is that the code I was using was not reading the response body when a status code 400 was received, so I was never seeing the JSON hash that contained a descriptive error message. I fixed the code to read the error body so that I could see the error message being returned. I believe there is a bug in the system when creating a payment policy, returning a false duplicate, but I worked around that.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mitchellc avatar image
0 Likes"
mitchellc answered ·
Any update on this issue? My project is at a standstill until this is resolved.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.