I am using the following xml for eBay CompleteSale API call:
<?xml version="1.0" encoding="utf-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$auth_token</eBayAuthToken>
</RequesterCredentials>
<ItemID>$itemId</ItemID>
<TransactionID>$transId</TransactionID>
<FeedbackInfo>
<CommentText> string </CommentText>
<CommentType>Positive</CommentType>
<TargetUser></TargetUser>
</FeedbackInfo>
<Shipped>1</Shipped>
<Paid>1</Paid>
<ListingType>Half</ListingType>
<Shipment>
<ShipmentTrackingDetails>
<ShipmentTrackingNumber>$trackingNo</ShipmentTrackingNumber>
<ShippingCarrierUsed>$carrier</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShippedTime>$shippingDate</ShippedTime>
</Shipment>
<ErrorLanguage> string </ErrorLanguage>
<MessageID> string </MessageID>
<Version>889</Version>
<ErrorHandling>BestEffort</ErrorHandling>
<WarningLevel>Low</WarningLevel>
</CompleteSaleRequest>
When I run the script, the tracking number gets updated in the eBay correctly, but the response XML gives error:
<?xml version="1.0" encoding="UTF-8"?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2014-10-13T14:39:52.430Z</Timestamp>
<Ack>Failure</Ack>
<CorrelationID> string </CorrelationID>
<Errors>
<ShortMessage>Invalid shipment tracking number or carrier</ShortMessage>
<LongMessage>You have entered an incorrect shipment tracking number/carrier.</LongMessage>
<ErrorCode>2191111</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Tracking numbers invalid</ShortMessage>
<LongMessage>The following Tracking Numbers are invalid : TRACKING_NUMBER_VALUE.</LongMessage>
<ErrorCode>21916897</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorParameters ParamID="0">
<Value>TRACKING_NUMBER_VALUE</Value>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Internal error to the application.</ShortMessage>
<LongMessage>Internal error to the application.</LongMessage>
<ErrorCode>10007</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>An error occurred.</ShortMessage>
<LongMessage>An error number "{0}" occurred while processing your request.</LongMessage>
<ErrorCode>36</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>893</Version>
<Build>E893_CORE_APIXO_17070435_R1</Build>
</CompleteSaleResponse>
Why I am not getting the success in response?
The tracking Number is like: 1Z7X887R0368851221 and carrier is 'UPS'
Please help.
Thanks
Per eBay's own dev site:
Error 10007 ("Internal error to the application") indicates an error on the eBay server side, not an error in your application.
So you'd probably need to contact eBay about the specific issue, but my assumption is that while eBay will accept in any information into the Carrier and Tracking number fields, the format of the tracking number field must match some other critieria set by the carrier for inserting into another API upstream.
Have you tested the tracking number in UPS's own tracking mechanism? It returns a valid package tracking response?
Also, per the eBay dev site, if you are using UPS Mail Innovations rather than UPS, the carrier name to specifiy is UPS-MI.
Related
I want to add products using AddItem API call in eBay with UPC code. I have searched about it, but did not get any specific answer. I want to ask what will be the UPC code for item that will be added in to the eBay list.
Please help me.
Thanks & Regards
This is an old question, and surely you have moved on. But surprisingly no other related examples here on stackoverflow or at developer.ebay.com were to be found when I ran into a similar need with the eBay API AddFixedPriceItem (almost exactly identical to AddItem but aimed at non-auction listings). Here is the XML request structure that worked for me in POSTing to this API for UPC or ISBN coded products illustrated using the Verify version of the API:
<?xml version="1.0" encoding="utf-8"?>
<VerifyAddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>YOUR TOKEN STRING HERE</eBayAuthToken>
</RequesterCredentials>
<Item>
<AutoPay>false</AutoPay>
<Country>US</Country>
<Currency>USD</Currency>
<ListingType>FixedPriceItem</ListingType>
<ListingDuration>Days_30</ListingDuration>
<PaymentMethods>PayPal</PaymentMethods>
<PaymentMethods>VisaMC</PaymentMethods>
<PayPalEmailAddress>SELLER PAYPAL EMAIL ADDR HERE</PayPalEmailAddress>
<ProductListingDetails>
<UPC>BARCODE HERE</UPC>
<EAN>Does not apply</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
<UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
</ProductListingDetails>
<ShippingDetails>
<ShippingServiceOptions>
<ShippingService>USPSFirstClass</ShippingService>
<ShippingServiceCost currencyID="USD">3.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>1.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSPriority</ShippingService>
<ShippingServiceCost currencyID="USD">5.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>2.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>2</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingType>Flat</ShippingType>
</ShippingDetails>
<ShipToLocations>US</ShipToLocations>
<Quantity>1</Quantity>
<Site>US</Site>
<StartPrice currencyID="USD">1.99</StartPrice>
<Title>YOUR GREAT ITEM TITLE</Title>
<Location>CITY,STATE HERE</Location>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
</PictureDetails>
<DispatchTimeMax>3</DispatchTimeMax>
<ReturnPolicy>
<RefundOption>MoneyBack</RefundOption>
<Refund>Money Back</Refund>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ReturnsWithin>30 Days</ReturnsWithin>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<ReturnsAccepted>Returns Accepted</ReturnsAccepted>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<ShippingCostPaidBy>Buyer</ShippingCostPaidBy>
</ReturnPolicy>
<ConditionID>EBAY CONDITION CODE</ConditionID>
<ConditionDisplayName>EBAY CONDITION DISPLAY TEXT</ConditionDisplayName>
</Item>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>Low</WarningLevel>
</VerifyAddFixedPriceItemRequest>
This is the VerifyAddFixedPriceItem call, which again is very very similar to the VerifyAddItem API. You can use the Verify version of either to check out that the request will be OK once debugged (just don't trust the fees either of them report even in production). The AddFixedPriceItem API adds the item to eBay using the UPC code only, via the eBay product catalog content. You can replace <UPC> and </UPC> with <ISBN> and </ISBN> for books as well. You could use this as an XML template for the VerifyAddItem and AddItem APIs as well.
Text in CAPS needs to be customized, the shipping prices are just random for illustration. I ran this using eBay Trading API version 1001 (as of this posting date you can ignore the warnings about no seller profile being in place). Also you can find the eBay condition codes and name text here: eBay Condition ID Values and Names
Hope this helps you or someone else that comes along with a similar need.
Anyone out there with experience with the Ebay API? I'm essentially trying to list all items for one shop on their website, so it's not going to be a public service usage. The GetSellerList method seems to be the way to go, but the documentation on the Ebay Website itself is very scant and not really well done at all.
http://developer.ebay.com/DevZone/XML/docs/reference/ebay/GetSellerList.html
I'm in the process of trying out the code samples and the problem I'm hitting now is whether or not I need a UserToken or not. #PITA
Thanks,
Here is about the minimum request I used that worked for me:
<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>--Enter your AuthToken here--</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<StartTimeFrom>2013-06-01T21:59:59.005Z</StartTimeFrom>
<StartTimeTo>2013-09-26T21:59:59.005Z</StartTimeTo>
<EndTimeFrom>2013-09-26</EndTimeFrom>
<EndTimeTo>2013-11-26</EndTimeTo>
<GranularityLevel>Coarse</GranularityLevel>
<UserID>--Enter your seller's name here--</UserID>
<Pagination>
<EntriesPerPage>200</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
<OutputSelector>ItemArray.Item.ItemID</OutputSelector>
<OutputSelector>ItemArray.Item.Quantity</OutputSelector>
<OutputSelector>ItemArray.Item.Title</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>
I also had to add these headers to the request:
X-EBAY-API-APP-NAME -- Add yours here --
X-EBAY-API-CALL-NAME GetSellerList
X-EBAY-API-REQUEST-ENCODING XML
X-EBAY-API-SITEID 0
X-EBAY-API-DEV-NAME -- Add yours here --
X-EBAY-API-CERT-NAME -- Add yours here --
X-EBAY-API-COMPATIBILITY-LEVEL 825
I'm not sure which of the "-- Add yours here --" entries are public and which are private, so I'll aire on the side of caution and I'll let you get them for yourself.. :-)
With no eBayAuthToken entered, you get the following error:
<Errors>
<ShortMessage>Auth token is invalid.</ShortMessage>
<LongMessage>Validation of the authentication token in API request failed.</LongMessage>
<ErrorCode>931</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
I hope this helps.
<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$authToken</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<StartTimeFrom>2015-01-01T00:00:00.005Z</StartTimeFrom>
<StartTimeTo>2015-03-31T23:59:59.005Z</StartTimeTo>
<EndTimeFrom>2015-03-31T23:59:59.005Z</EndTimeFrom>
<EndTimeTo>2015-05-31T23:59:59.005Z</EndTimeTo>
<GranularityLevel>Coarse</GranularityLevel>
<UserID>----testuser----</UserID>
<Pagination>
<EntriesPerPage>200</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
<OutputSelector>ItemArray.Item.ItemID</OutputSelector>
<OutputSelector>ItemArray.Item.Quantity</OutputSelector>
<OutputSelector>ItemArray.Item.Title</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>
Header Request Values
$headers = array(
'X-EBAY-API-SITEID:'.SITEID,
'X-EBAY-API-CALL-NAME:GetSellerList',
'X-EBAY-API-REQUEST-ENCODING:'.RESPONSE_ENCODING,
'X-EBAY-API-COMPATIBILITY-LEVEL:' . API_COMPATIBILITY_LEVEL,
'X-EBAY-API-DEV-NAME:' . API_DEV_NAME,
'X-EBAY-API-APP-NAME:' . API_APP_NAME,
'X-EBAY-API-CERT-NAME:' . API_CERT_NAME,
'Content-Type: text/xml;charset=utf-8'
);
I'm working with ebay Trading API for listing the product but after I'm stucking in it where i need to set value for a option in Return policy Type API, I need to set ShippingCostPaidByOption with value either Paid by buyer or Paid by Seller?
Similarly I need to set RefundOption value either Money or Money or item replace.
To get the applicable RefundOption and ShippingCostPaidByOption values, call GeteBayDetails with DetailName set to ReturnPolicyDetails, and then look for the ReturnPolicyDetails.Refund.RefundOption and ReturnPolicyDetails.ShippingCostPaidBy.ShippingCostPaidByOption fields in the response. The value of the fields can be used in your AddItem request.
The following example can be used as a request to GeteBayDetails using the eBay API explorer.
<?xml version="1.0" encoding="utf-8"?>
<GeteBayDetailsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[ADD YOU OWN AUTH TOKEN</eBayAuthToken>
</RequesterCredentials>
<DetailName>ReturnPolicyDetails</DetailName>
</GeteBayDetailsRequest>
A typical response will look like the following.
<?xml version="1.0" encoding="UTF-8"?>
<GeteBayDetailsResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<ReturnPolicyDetails>
<Refund>
<RefundOption>MoneyBackOrExchange</RefundOption>
<Description>Money back or exchange (buyer's choice)</Description>
</Refund>
</ReturnPolicyDetails>
<ShippingCostPaidBy>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<Description>Buyer</Description>
</ShippingCostPaidBy>
</ReturnPolicyDetails>
</GeteBayDetailsResponse>
I am trying to test my ability to import TimeActivity records and even when using the sample Create Request XML for TimeActivity I get an error:
Apache Tomcat/7.0.23 - Error report HTTP Status 400 - type Status reportmessage description The request sent by the client was syntactically incorrect ().Apache Tomcat/7.0.23
below is my sample xml create request (pulled from https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/timeactivity)
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2">
<TxnDate>2011-08-03-07:00</TxnDate>
<NameOf>Vendor</NameOf>
<Vendor>
<VendorIdidDomain="QBO">3793</VendorId>
</Vendor>
<CustomerId>3794</CustomerId>
<ItemId>3</ItemId>
<ClassId>1</ClassId>
<StartTime>2011-08-30T11:45:00-07:00</StartTime>
<EndTime>2011-08-30T13:15:00-07:00</EndTime>
<Taxable>true</Taxable>
<HourlyRate>10.5</HourlyRate>
<BillableStatus>Billable</BillableStatus>
<Hours>10</Hours>
<Minutes>5</Minutes>
<Description>This is a Description</Description>
</TimeActivity>
What am I doing wrong here?
Sharing a sample TimeActivity create request. Please check other reference attributes like Vendor, Class etc. It should work.
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns='http://www.intuit.com/sb/cdm/v2'>
<TxnDate>2012-08-30-07:00</TxnDate>
<NameOf>Employee</NameOf>
<Employee>
<EmployeeId>11</EmployeeId>
</Employee>
<CustomerId>2</CustomerId>
<JobId>4</JobId>
<BillableStatus>Billable</BillableStatus>
<HourlyRate>50.0</HourlyRate>
<StartTime>2012-08-30T11:45:00-07:00</StartTime>
<EndTime>2012-08-30T13:15:00-07:00</EndTime>
<Description/>
</TimeActivity>
There should be couple of small changes in the sample request ( We will update the doc )
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2">
<NameOf>Vendor</NameOf>
<Vendor>
<VendorId idDomain="QBO">5</VendorId>
</Vendor>
<CustomerId>2</CustomerId>
<ItemId>3</ItemId>
<Taxable>true</Taxable>
<HourlyRate>10.5</HourlyRate>
<BillableStatus>Billable</BillableStatus>
<Hours>10</Hours>
<Minutes>5</Minutes>
<Description>This is a Description</Description>
</TimeActivity>
First replace all the reference values with the same of your test data.
For ex - VendorId, Class, Item and Customer
There are two bugs in the sample request.
1. There should be a space between 'VendorId' and 'idDomain' ( Ref -5th line of the req )
2. According to the doc, " Either method of indicating duration can be entered, but not both. Hours/Minutes OR StartTime/EndTime is required."
So plz remove any one of these. ( I've removed StartTime/EndTime )
Otherwise you'll get the error which you have mentioned above.
That is - Response code 400, Error msg - TIME_ACTIVITY_MULTIPLE_DURATION_TYPES_PRESENT
Please let us know if the above changes work for you.
I tried the same XML in Api Explorer. It worked fine for me. PFB snapshot. Please check if you are facing any encoding issue.
Please let me know if it works for you.
I have placed test orders in the sandbox eBay account.
I am not able to get the orders listing from the GetOrders API call.
It retruns the success message but no orders are fetched.
Below are the API call details :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns="urn:ebay:apis:eBLBaseComponents" ><soap:Header><RequesterCredentials><eBayAuthToken>...</eBayAuthToken><Credentials><AppId>Clarion89-2b36-4da6-b073-00dafbcff12</AppId><DevId>f79169c1-f95b-4d23-9fe2-547504ffb827</DevId><AuthCert>...</AuthCert></Credentials></RequesterCredentials></soap:Header><soap:Body><GetOrdersRequest><DetailLevel>ReturnAll</DetailLevel><Version>527</Version><CreateTimeFrom>2012-04-02T09:52:27.000Z</CreateTimeFrom><CreateTimeTo>2012-05-03T09:52:27.000Z</CreateTimeTo><OrderRole>Seller</OrderRole><OrderStatus>Active</OrderStatus><ListingType>FixedPriceItem</ListingType></GetOrdersRequest></soap:Body></soap:Envelope>
Response returned as below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<GetOrdersResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2012-05-03T09:54:03.650Z</Timestamp>
<Ack>Success</Ack>
<Version>771</Version>
<Build>E771_CORE_BUNDLED_14795207_R1</Build>
<PaginationResult>
<TotalNumberOfPages>0</TotalNumberOfPages>
<TotalNumberOfEntries>0</TotalNumberOfEntries>
</PaginationResult>
<HasMoreOrders>false</HasMoreOrders>
<OrderArray/>
<OrdersPerPage>100</OrdersPerPage>
<PageNumber>1</PageNumber>
<ReturnedOrderCountActual>0</ReturnedOrderCountActual>
</GetOrdersResponse>
</soapenv:Body>
</soapenv:Envelope>
Please tell me why i am not getting order details
first of all i would use an higher version (i'm actually using 771 as compatibility level)
I used to have a similar problem at the very benning when i started coded for api, then i switched CreatedTime filter to NumberOfDays wich are the days to look back from today.
What language are you using to make the call?
Check your request parameters against your orders that are stored on ebay. It may happen that there are no orders matching the parameters you are entering in your call. Try entering the most basic request parameters like
<?xml version="1.0" encoding="utf-8"?>
<GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[your authentication token]</eBayAuthToken>
</RequesterCredentials>
<CreateTimeFrom>2012-05-10T00:00:00.000Z</CreateTimeFrom>
<CreateTimeTo>2012-05-15T00:00:00.000Z</CreateTimeTo>
</GetOrdersRequest>
You can enter the dates as per your requirement but make sure you use the date format accepted by ebay.