question

dallasbusinessphone avatar image
0 Likes"
dallasbusinessphone asked

How to check order cancellation status as a seller with eBay post order API call?

Hi, I'm trying to make a HTTP request to check the eligibility of orders. I'm pretty sure the token I used and legacyorderID I used are fine in this process. But I always get a "400 bad request" response after the call. The following is the call process I wrote: string url = " https://api.ebay.com/post-order/v2/cancellation/check_eligibility"; HttpWebRequest cancelOrderRequest = (HttpWebRequest)WebRequest.Create(url); cancelOrderRequest.Headers.Add("Authorization" ,"TOKEN " + UserDataManager.Instance.KeyedToken[this.sellerID].ToString()); cancelOrderRequest.ContentType = "application/json"; cancelOrderRequest.Accept = "application/json"; cancelOrderRequest.Headers.Add("X-EBAY-C-MARKETPLACE-ID", "EBAY_US"); cancelOrderRequest.Headers.Add("legacyOrderId", this.orderLineItemID); cancelOrderRequest.Method = "POST"; HttpWebResponse response = (HttpWebResponse)cancelOrderRequest.GetResponse(); Could some one tell me, whether my settings of call are wrong or the cancel order API does not work now? Thanks for the reply deeply.
post order apinot workingcancellationhttp bad request
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 dallasbusinessphone, As per our log, you were pointing to the following Resource URI ` /post-order/v2/cancellation/check_eligibility%7B%22legacyOrderId%22:%20%223712593xxxxx-9027407xxxxx%22%7D` the "check_eligibility" API call. The correct Resource URI for the POST call should be https://api.ebay.com/post-order/v2/cancellation/check_eligibility for production environment showing below:![alt text][1] Can you give it a try and let me know if that works? Best Regards, [1]: /storage/temp/1186-cancellation-check-eligibility-call.png

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 dallasbusinessphone, 'legacyOrderId' input parameter should be passed into the request body as showing below: POST https://api.ebay.com/post-order/v2/cancellation/check_eligibility { "legacyOrderId":"170006494376-8756205007" } REF: http://developer.ebay.com/Devzone/post-order/post-order_v2_cancellation_check_eligibility__post.html#Samples Best Regards,
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.

voxpro avatar image
0 Likes"
voxpro answered
Thank you so much for your reply. I tried with new url as: string url = " https://api.ebay.com/post-order/v2/cancellation/check_eligibility{"legacyOrderId\""; url += ": \"" + this.orderLineItemID + "\"}"; This time, I received 401 unauthorized request. But I used the same Token for call other API like trading or feedback. Is there another token I should apply or still something wrong in my API call? Thank you so much again and best regards Wei
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.

blocki26 avatar image
0 Likes"
blocki26 answered
This 401 unauthorized issue is a known problem. Some Post-Order API requests have this issue, rendering the Sandbox useless for testing the implementation of that 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.

dallasbusinessphone avatar image
0 Likes"
dallasbusinessphone answered
Thank you for your reply. But I didn't use Sandbox to test my code. I use the real orderLineItemID with corresponding token. So there still something wrong in my code?
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, One of the possible reasons for getting 401 unauthorized was using Sandbox Auth token to make the call against the Production endpoint or vice versa. Best Regards,
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.

blocki26 avatar image
0 Likes"
blocki26 answered
This is not the case. Whenever I make a call against https://api.sandbox.ebay.com/post-order/v2/inquiry/check_eligibility with a known good Sandbox token, I get 401 Unauthorized. A call against https://api.sandbox.ebay.com/post-order/v2/return/ with the same token works just fine.
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.

dallasbusinessphone avatar image
0 Likes"
dallasbusinessphone answered
Thank you for your reply all. I didn't use sandbox token to call production. I used known production token which is good for other APIs like trading API. So I wonder is there specific token for POST-Order-API only or there's still something wrong in my codes. Thank you so much all
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 Folks, I will need your help investigating the issue. Can you please give it another try and share the API requester's Sandbox UserID and the value of the http response header 'RlogId' you got for the same? Please note that our logs will expire within a week. Best Regards,
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.

dallasbusinessphone avatar image
0 Likes"
dallasbusinessphone answered
Hi, Thank you for your reply. I didn't use Sandbox test. I don't have Sandbox UserID. I used production UserID directly. I just tried to call the "check_eligibility" API again, still 401 unauthorized and returned RlogId: t6%60dhdfiuq%60%3F%3Cdka7e37e*fa%3Ea-159adf1c377-0x121 Date: Tue, 17 Jan 2017 19:40:19 GMT My API requester's Production AppID: suntechc-suntech-PRD-1d2ce5828-1ac21bf8 Thank you so much for all your help. Best Regards
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.