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.
Related
I'm trying to add a product to eBay using the API.
Here's a snippet of the code:
<Item>
<Currency>GBP</Currency>
<Country>GB</Country>
<ListingDuration>Days_30</ListingDuration>
<PrimaryCategory>
<CategoryID>31413</CategoryID>
</PrimaryCategory>
<Location>GB</Location>
<StartPrice>42.79</StartPrice>
<Quantity>10</Quantity>
<ProductListingDetails>
<BrandMPN>
<Brand>Nourkrin</Brand>
<MPN>NRK-0033</MPN>
</BrandMPN>
<UPC>5707725100255</UPC>
<EAN>5707725100255</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
</ProductListingDetails>
eBay now requires the Brand, MPN, EAN and UPC however when I add these to my code, I get the error:
<ShortMessage>No product found for ProductListingDetails.<EAN> <5707725100255>. </ShortMessage>
I think this is because eBay is looking up the EAN in it's product database to see if it exits and is a known product.
If I remove the EAN I get the error:
<ShortMessage>No product found for ProductListingDetails.<EAN> <5707725100255>. </ShortMessage>
I guess because it's using the UPC, if I remove EAN and UPC I get the error:
<ShortMessage>No product found for ProductListingDetails.<BrandMPN> <, NRK0033>. </ShortMessage>
and..
<LongMessage>Required field, EAN, is missing. Please add EAN to the listing and retry.</LongMessage>
I've tried changing EAN and UPC to 'Does not apply'
<UPC>Does not apply</UPC>
<EAN>Does not apply</EAN>
but I get the error:
<ShortMessage>No product found for ProductListingDetails.<UPC> <Does not apply>. </ShortMessage>
the AddItem template on the sandbox API looks like this:
<ISBN> string </ISBN>
<UPC> string </UPC>
<EAN> string </EAN>
<BrandMPN><Brand> string </Brand>
<MPN> string </MPN>
</BrandMPN>
https://developer.ebay.com/devzone/xml/docs/Reference/ebay/AddItem.html
I've also tried removing <ListIfNoProduct>true</ListIfNoProduct> but it doesn't seem to make any difference.
I looked at this post too:
eBay SDK AddItem new ProductDetails EAN Requirements CANNOT List Or Revise
How can i get this product to list? What am I doing wrong?
I had a lot of problems with this, but what worked for me is: if you have UPC number then you have to pass "Does not apply" for EAN (but with EAN then pass empty string to UPC).
Do not pass a number to both fields as this always result in error.
So this should do:
<Item>
<Currency>GBP</Currency>
<Country>GB</Country>
<ListingDuration>Days_30</ListingDuration>
<PrimaryCategory>
<CategoryID>31413</CategoryID>
</PrimaryCategory>
<Location>GB</Location>
<StartPrice>42.79</StartPrice>
<Quantity>10</Quantity>
<ProductListingDetails>
<BrandMPN>
<Brand>Nourkrin</Brand>
<MPN>NRK-0033</MPN>
</BrandMPN>
<UPC>Does not apply</UPC>
<EAN>5707725100255</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
...
</ProductListingDetails>
<ItemSpecifics>
//add brand and mpn here as well
</ItemSpecifics>
Also eBay recommends putting Brand and MPN in <ItemSpecifics> tag as well. Sorry I'm working with C# API so I can't give you exact XML representation of it.
Hope this helps.
EDITED:
Checked and 5707725100255 is an EAN number not UPC. Edited my answer.
I am trying to use the eBay API call RelistFixedPriceItem relist an item as fixed price which has been listed as an auction before.
The "interesting part" of my XML request looks like this:
<RelistFixedPriceItemRequest>
<Item>
<ListingType>
FixedPriceItem
</ListingType>
</Item>
</RelistFixedPriceItemRequest>
But still, eBay responds that I can't use the ListingType I used ("FixedPriceItem") but should use "FixedPriceItem" (the same) instead:
<RelistFixedPriceItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2013-06-21T14:14:52.951Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Unsupported ListingType.</ShortMessage>
<LongMessage>Valid Listing type for fixedprice apis are FixedPriceItem and StoresFixedPrice.</LongMessage>
<ErrorCode>21916286</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>827</Version>
<Build>E827_UNI_API5_16161102_R1</Build>
</RelistFixedPriceItemResponse>
Has anyone run into this issue - or found a workaround?
Nothing in their API documentation states that this shouldn't be possible. It certainly is on ebay.com where you can change the listing type when you relist an item.
Well, If you look at their API documentation's Sample XML, you would notice that they do not use
<ListingType>
FixedPriceItem
</ListingType>
That suggests to me that, when you use the RelistFixedPriceItem call you do not have to specify the Listing Type to be FixedPriceItem
I do agree that it is a confusing error.
Is it possible to send the invoiceNumber field in an AIM XML refund request with Authorize.Net? I try some variations on how to do it based on the documentation, and I get errors like:
The element 'transactionRequest' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element
'invoiceNumber' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements
expected: 'authCode, refTransId, splitTenderId, order, lineItems, tax,
duty, shipping, taxExempt, poNumber, customer, billTo, shipTo,
customerIP, cardholderAuthentication, retail, transactionSettings,
userFields' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
The reason I ask is because I'd like to have my refunds tie back to their original transaction for reporting reasons. That way, I can search on an invoice number and find where the purchase record came in, along with each refund record, all of which would share the same invoice number. As is now, the Authorize.Net system shows me no way to match a given customer's original purchase with their refund.
Sorry for responding to an old post, but the above answer is not correct.
To have the invoice number associate with the transaction and appear in your Auth.net transaction logs, include the following bit of XML:
<order><invoiceNumber>123456</invoiceNumber></order>
See the schema https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd within <xs:complexType name="transactionRequestType"> to view the necessary order (because order does matter).
In the above example, it would go here:
<?xml version="1.0"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>yourloginid</name>
<transactionKey>yourtransactionkey</transactionKey>
</merchantAuthentication>
<refId>15444549</refId>
<transactionRequest>
<transactionType>refundTransaction</transactionType>
<amount>5</amount>
<payment>
<creditCard>
<cardNumber>XXXX1111</cardNumber>
<expirationDate>122016</expirationDate>
</creditCard>
</payment>
<authCode>2165668159</authCode>
<order>
<invoiceNumber>123456</invoiceNumber>
</order>
</transactionRequest>
</createTransactionRequest>
The data that I'm getting only contains the SKU numbers. I am trying to figure out how I can link these SKU numbers to the product variants in Shopify without the actual product id number.
Example data:
<Inventory ItemNumber="100B3001-B-01">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-02">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-03">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
<Inventory ItemNumber="100B3001-B-04">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
Here's a delightful, condescending discussion from Shopify employees in 2011 asking why you can't just store the Shopify ID everywhere. The "stock-keeping unit" is a universal systems integration point and, in every system I've seen, each SKU uniquely maps to a product because words have meaning, but apparently not at Shopify.
Three years later, you seem to have two options.
One is to create a Fulfillment Service and provide a URL where Shopify will call you asking for stock levels on a SKU; this is probably the simplest solution, provided you have a Web server sitting somewhere where you can expose such a callback.
The second is to periodically page through all of the Products and store a mapping of the Shopify ID to a SKU somewhere, consulting your map when you need to do an update. Because most of our integrations are cron jobs and I'd like to keep them that way, I periodically ask for the products that have changed since the last run, and then update my mapping.
As David Lazar points out in his comment, the ability to find a product based on its SKU is not currently supported in the Shopify API.
EDIT: This is an unreliable option that I once used as a last resort. I wouldn't recommend using this but I will leave it here in case as someone may find it helpful.
You can use this API endpoint:
/admin/products/search.json?query=sku:abc123
I have only used it in the browser though, and I can't find any documentation for it. And it may stop working at any time.
You can use
*.myshopify.com/search?view=json&q=sku:SKUID
Graph query on Shopify works for me:
I'm doing a research project for the summer and I've got to use get some data from Wikipedia, store it and then do some analysis on it. I'm using the Wikipedia API to gather the data and I've got that down pretty well.
What my questions is in regards to the links-alllinks option in the API doc here
After reading the description, both there and in the API itself (it's down and bit and I can't link directly to the section), I think I understand what it's supposed to return. However when I ran a query it gave me back something I didn't expect.
Here's the query I ran:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=google&rvprop=ids|timestamp|user|comment|content&rvlimit=1&list=alllinks&alunique&allimit=40&format=xml
Which in essence says: Get the last revision of the Google page, include the id, timestamp, user, comment and content of each revision, and return it in XML format.
The allinks (I thought) should give me back a list of wikipedia pages which point to the google page (In this case the first 40 unique ones).
I'm not sure what the policy is on swears, but this is the result I got back exactly:
<?xml version="1.0"?>
<api>
<query><normalized>
<n from="google" to="Google" />
</normalized>
<pages>
<page pageid="1092923" ns="0" title="Google">
<revisions>
<rev revid="366826294" parentid="366673948" user="Citation bot" timestamp="2010-06-08T17:18:31Z" comment="Citations: [161]Tweaked: url. [[User:Mono|Mono]]" xml:space="preserve">
<!-- The page content, I've replaced this cos its not of interest -->
</rev>
</revisions>
</page>
</pages>
<alllinks>
<!-- offensive content removed -->
</alllinks>
</query>
<query-continue>
<revisions rvstartid="366673948" />
<alllinks alfrom="!2009" />
</query-continue>
</api>
The <alllinks> part, its just a load of random gobbledy-gook and offensive comments. No nearly what I thought I'd get. I've done a fair bit of searching but I can't seem to find a direct answer to my question.
What should the list=alllinks option return?
Why am I getting this crap in there?
You don't want a list; a list is something that iterates over all pages. In your case you simply "enumerate all links that point to a given namespace".
You want a property associated with the Google page, so you need prop=links instead of the alllinks crap.
So your query becomes:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions|links&titles=google&rvprop=ids|timestamp|user|comment|content&rvlimit=1&format=xml