API Documentation >> API 2.0 Main >> Stock Management >> Stock

Contents

Stock

Allowed HTTP Methods

Basically the requests returns the complete stock. You can specify parameters for start and maximum results returned. If the response would have more than 1.000 entities a Temporary Redirect is returned. You can specify several filter parameters.

Attention: This request can't be used to increase or decrease the stock's quantity for specified articles!

Attention: You can pass up to 100 articles to be add (POST), changed (PUT), or deleted (DELETE) at the same time. Passing more will result in a 400 Bad Request response.

Resource Information

Parameters

Request Object

<?xml version="1.0" encoding="UTF-8" ?>
<request>
    <article>
        <idProduct />           // Product ID the article is derived from (for POST) OR
        <idArticle />           // Article ID (for PUT and DELETE)
        <count />               // Quantity (for POST), quantity of updated, resp. deleted articles (for PUT and DELETE)
        <idLanguage />          // Language of the article
        <comments />            // User comments
        <price />               // Price the article is offered for
        <condition />           // Condition, if applicable (optional)
        <isFoil />
        <isSigned />
        <isAltered />
        <isPlayset />
        <isFirstEd />
    </article>
</request>

Attention: While the count value for POST requests specify the amount of articles inserted into your stock, they specify the number of updated articles for PUT, resp. the number of deleted articles for DELETE requests. If you want to change the quantity of articles in your stock, please use the Change Stock Article Quantity requests.

It's possible to add, change, or delete more than one article at a time.

Possible idLanguage values:

Possible condition values:

All is... flags are optional. The default value when not passed is false. Possible values are true and false. Values other than false are treated as true. They are applicable for the following currently supported games:

Magic Yu-Gi-Oh! WoW The Spoils
isFoil X X X
isSigned X X X
isAltered X
isPlayset X X X
isFirstEd X

Example Request

1. Retrieves all articles in the authenticated user's stock:

GET https://api.cardmarket.com/ws/v2.0/stock


2. Retrieves articles 101 to 200 in the user's stock:

GET https://api.cardmarket.com/ws/v2.0/stock/101


3. Add an article to the user's stock:

POST https://api.cardmarket.com/ws/v2.0/stock

<?xml version="1.0" encoding="UTF-8" ?>
<request>
    <article>
        <idProduct>100569</idProduct>
        <idLanguage>1</idLanguage>
        <comments>Inserted through the API</comments>
        <count>1</count>
        <price>4</price>
        <condition>EX</condition>
        <isFoil>true</isFoil>
        <isSigned>false</isSigned>
        <isPlayset>false</isPlayset>
    </article>
</request>

4. Change articles in user's stock

PUT https://api.cardmarket.com/ws/v2.0/stock

<?xml version="1.0" encoding="UTF-8" ?>
<request>
    <article>
        <idArticle>14449120</idArticle>
        <idLanguage>1</idLanguage>
        <comments>Edited through the API</comments>
        <count>4</count>
        <price>4</price>
        <condition>EX</condition>
        <isFoil>true</isFoil>
        <isSigned>false</isSigned>
        <isPlayset>false</isPlayset>
    </article>
    <article>
        <idArticle>42914990</idArticle>
        <idLanguage>1</idLanguage>
        <comments>Edited through the API</comments>
        <count>3</count>
        <price>4</price>
        <condition>EX</condition>
        <isFoil>true</isFoil>
        <isSigned>false</isSigned>
        <isPlayset>false</isPlayset>
    </article>
</request>

5. Delete articles from user's stock

DELETE https://api.cardmarket.com/ws/v2.0/stock

<?xml version="1.0" encoding="UTF-8" ?>
<request>
    <article>
        <idArticle>144491157</idArticle>
        <count>1</count>
    </article>
    <article>
        <idArticle>144491160</idArticle>
        <count>1</count>
    </article>
</request>