Error 515 - Invalid Quantity
Find the answer to your question
Advanced Search
Products
Question
Why am I getting the following error when I try to list an item using AddItem? <Errors> <ShortMessage>Invalid quantity.</ShortMessage> <LongMessage>The quantity you submitted is invalid. One possible cause can be bad format.</LongMessage> <ErrorCode>515</ErrorCode> <SeverityCode>Error</SeverityCode> <ErrorClassification>RequestError</ErrorClassification> </Errors>
Answer
Summary
If you do not set the ListingType correctly, you are likely to get this error. When you try to list a multi-quantity auction item, you need to set the ListingType to Dutch. For single Quantity, it needs to be Chinese. If you do not specify the ListingType for auction items, it will automatically set it appropriately, depending on the quantity. Detailed Description
Here is a sample AddItem request that will return error 515, because the ListingType is set to Chinese and the Quantity is more than 1:
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>501</Version>
<Item>
<Country>US</Country>
<Currency>USD</Currency>
<Description>description.</Description>
<ListingType>Chinese</ListingType>
<ListingDuration>Days_5</ListingDuration>
<Location>San Jose, CA</Location>
<PaymentMethods>PaymentSeeDescription</PaymentMethods>
<PrimaryCategory>
<CategoryID>1463</CategoryID>
</PrimaryCategory>
<Quantity>5</Quantity>
<StartPrice>1.0</StartPrice>
<Title>title</Title>
</Item>
<RequesterCredentials>
<eBayAuthToken>*****</eBayAuthToken>
</RequesterCredentials>
</AddItemRequest>
To correct the error, you need to set the ListingType to Dutch.
Version Info
The code example above was based on the versions specified below:
| API Schema Version | 495 |
- Documentation: Listing Type