Ria jain
asked on
Ebay Post-Order API Not Working
I want to "IssueCaseRefund" using ebay post-order API
i have used these Api Url for "IssueCaseRefund" details using post method
API Url is: POST https://api.ebay.com/post-order/v2/casemanagement/{caseId}/issue_refund
i have also ebay auth token as Authorization in header.
When it run into postman by using above details then Api throws "Page not responding"
I also developed Api call in C#
My code details
i have used these Api Url for "IssueCaseRefund" details using post method
API Url is: POST https://api.ebay.com/post-order/v2/casemanagement/{caseId}/issue_refund
i have also ebay auth token as Authorization in header.
When it run into postman by using above details then Api throws "Page not responding"
I also developed Api call in C#
My code details
/ Set issue to return url string returnUrl = "https://api.ebay.com/post-order/v2/casemanagement/" + CaseId + "/issue_refund"; HttpWebRequest returnRequest = (HttpWebRequest)WebRequest.Create(returnUrl); returnRequest.Method = "POST"; // Set EbayToken returnRequest.Headers.Add("authorization", eBayToken); //returnRequest.Headers.Add("authorization", eBayToken); using (HttpWebResponse returnResponse = (HttpWebResponse)returnRequest.GetResponse()) { using (Stream returnStream = returnResponse.GetResponseStream()) { using (StreamReader returnReader = new StreamReader(returnStream)) { // Get Api Response string returnResponseText = returnReader.ReadToEnd(); } } } Please guide me how to "IssueCaseRefund" using ebay post order Api
ASKER
I am trying the same way you suggested in code.Getting "Page Not Responding" issue . I have taken TLS code lines from your code and same response.
string returnUrl = "https://api.ebay.com/post-order/v2/casemanagement/" + CaseId + "/issue_refund";
HttpWebRequest returnRequest = (HttpWebRequest)WebRequest.Create(returnUrl);
returnRequest.Method = "POST";
// Set EbayToken
returnRequest.Headers.Add("authorization", "Bearer " + eBayToken);
//EDITED THIS PART from your code
//--------------------------------------------------------------
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
//--------------------------------------------------------------
using (HttpWebResponse returnResponse = (HttpWebResponse)returnRequest.GetResponse())
{
using (Stream returnStream = returnResponse.GetResponseStream())
{
using (StreamReader returnReader = new StreamReader(returnStream))
{
// Get Api Response
string returnResponseText = returnReader.ReadToEnd();
// Deserialize api response
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
refundResult obj = jsonSerializer.Deserialize<refundResult>(returnResponseText);
}
}
}
Capture.JPG
Can you verify the CaseId is correct?
Also I would add these headers:
Also I would add these headers:
returnRequest.Accept = "application/json";
returnRequest.ContentType = "application/json";
ASKER
Yes case ids are live from production account. With almost all types of status i can have to test.
I am getting response for only case ids having escalation or closed after escalations, using ebay post -order/casemanagement api
we tested with or without these headers you suggested.
I am getting response for only case ids having escalation or closed after escalations, using ebay post -order/casemanagement api
we tested with or without these headers you suggested.
That's a function of ebay then - which would make sense given you're trying to issue a refund.
So please confirm you're using a valid case ID. Beyond that a page not responding can also be an issue with the server side of things.
Someone else also reported this in their forums:
https://www.experts-exchange.com/questions/29089488/Ebay-Post-Order-API-Not-Working.html?anchor=a42501900¬ificationFollowed=205255086&anchorAnswerId=42501900#a42501900
Can you try the /v1/ api?
So please confirm you're using a valid case ID. Beyond that a page not responding can also be an issue with the server side of things.
Someone else also reported this in their forums:
https://www.experts-exchange.com/questions/29089488/Ebay-Post-Order-API-Not-Working.html?anchor=a42501900¬ificationFollowed=205255086&anchorAnswerId=42501900#a42501900
Can you try the /v1/ api?
ASKER
I have not tried v1 api for refund. I will give it a try and keep you posted.
I can confirm that ebay caseid are proper.Using that we can check case escalation information and status using same post-order api, But can't refund.
I can confirm that ebay caseid are proper.Using that we can check case escalation information and status using same post-order api, But can't refund.
ASKER
HI,
Try to code using v1 api and it seems getting response. Getting fail response from ebay api against closed escalated case.
Don't have open escalation so waiting for that to test refund.
Still wondering why not v2 APi working.
Try to code using v1 api and it seems getting response. Getting fail response from ebay api against closed escalated case.
Don't have open escalation so waiting for that to test refund.
Still wondering why not v2 APi working.
I would follow up with ebay but that would definitely indicate that it's a server side issue. There could be a bug they're not aware of or it isn't fully published yet?
ASKER
here is the update with ebay v1.
Ebay API v1 seems resp[onding but still no success with refund.
Ebay v1 code and Response :
When i have execute this code Api throw response "User is not eligible to execute this option based on current case status."
Ebay API v1 seems resp[onding but still no success with refund.
Ebay v1 code and Response :
// Set issue to return url
string endpointURL = "https://svcs.ebay.com/services/resolution/v1/ResolutionCaseManagementService";
// Set API endpoint URL for request
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(endpointURL);
// Set API service name for request
request.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "ResolutionCaseManagementService");
// Set API method for request
request.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "issueFullRefund");
// Set API ebay authorize token for request
request.Headers.Add("X-EBAY-SOA-SECURITY-TOKEN", eBayToken);
request.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-US");
request.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0");
request.Method = "POST";
using (StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
// Request for full refund
string requestFilterString = "<?xml version=\"1.0\" encoding=\"utf - 8\"?>";
requestFilterString += "<issueFullRefundRequest xmlns=\"http://www.ebay.com/marketplace/resolution/v1/services\">";
requestFilterString += "<caseId>";
requestFilterString += "<id>"+ CaseDetails.CaseId + "</id>";
requestFilterString += "<type>" + CaseDetails.CaseType + "</type>";
requestFilterString += "</caseId>";
requestFilterString += "<comments>Return from SA</comments>";
requestFilterString += "</issueFullRefundRequest>";
streamWriter.Write(requestFilterString);
streamWriter.Flush();
}
//returnRequest.Headers.Add("authorization", eBayToken);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
using (HttpWebResponse returnResponse = (HttpWebResponse)request.GetResponse())
{
using (Stream returnStream = returnResponse.GetResponseStream())
{
using (StreamReader returnReader = new StreamReader(returnStream))
{
// Get Api Response
string returnResponseText = returnReader.ReadToEnd();
}
When i have execute this code Api throw response "User is not eligible to execute this option based on current case status."
<?xml version='1.0' encoding='UTF-8'?>
<issueFullRefundResponse xmlns="http://www.ebay.com/marketplace/resolution/v1/services">
<ack>Failure</ack>
<errorMessage>
<error>
<errorId>1505</errorId>
<domain>Marketplace</domain>
<severity>Error</severity>
<category>Application</category>
<message>User is not eligible to execute this option based on current case status.</message>
<subdomain>Resolution</subdomain>
</error>
</errorMessage>
<version>1.3.0</version>
<timestamp>2018-03-19T07:28:58.021Z</timestamp>
</issueFullRefundResponse>
That would seem to indicate that it is working correctly. Not sure when you can issue a refund, more digging would be needed but it would seem to be a workflow issue at that point and not an API issue per se.
ASKER
I get your point. Nothing mention in ebay docs about when refund can be issue .
If we see the flow inside ebay system. You can refund against the escalated case.So based on that we assumed that refund can be issued against escalated cases using API.
If we see the flow inside ebay system. You can refund against the escalated case.So based on that we assumed that refund can be issued against escalated cases using API.
Just found this in the documentation https://developer.ebay.com/devzone/post-order/concepts/usageguide.html:
It may be time to contact eBay directly via their support channels: https://developer.ebay.com/signin?return_to=%2Fmy%2Fsupport%2Ftickets
API RestrictionsNot sure what site your transactions are working on but can you confirm?
The Post-Order API is initially only available for transactions occurring on the US, UK, Germany, Australia, and Canada (English and French version) sites
It may be time to contact eBay directly via their support channels: https://developer.ebay.com/signin?return_to=%2Fmy%2Fsupport%2Ftickets
ASKER
I am working on Normal ebay US account so its available for that account.
Let me try to contact with ebay paid support that seems only solution to me as last resort.
Let me try to contact with ebay paid support that seems only solution to me as last resort.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Also note this is using https://www.newtonsoft.com/json
Open in new window