The REST API for Cardmarket can be accessed via the following URL:
https://www.mkmapi.eu/ws/:user/:apikey
You need to provide two URI parameters for authorization:
:user
- your Cardmarket username:apikey
- the assigned API keyYou need a normal Cardmarket account and find both credentials at you profile page when logged in at Cardmarket.
Cardmarket API is basically parted into five different sections as shown below:
The description of the entities:
==== Games ==== | |
---|---|
Resource | Description |
GET /games | Returns a collection of all games that are supported by Cardmarket. |
==== Metaproducts ==== | |
Resource | Description |
GET /metaproduct/:idMetaproduct | Returns detailed information about a single metaproduct specified by the idMetaproduct parameter.
|
Resource | Description |
GET /metaproduct/:name/:idGame/:idLanguage | Returns detailed information about a single metaproduct specified by its exact name , as well as the game , and language parameters the name is provided in.
|
==== Products ==== | |
Resource | Description |
GET /product/:idProduct | Returns detailed information about a single product specified by the idProduct parameter.
|
Resource | Description |
GET /products/:name/:idGame/:idLanguage/:exact[/:start] | Returns a collection of products theirs name contain a string specified by the name parameter for the game specified by the idGame parameter, and the idLanguage parameter, the name is provided in. Can be limited so that the products' names must exactly match the search string when the exact parameter is set to true . Returns 206 Partial Content, if the resulting collection contains more than 100 products. A starting product can be specified by the optional start parameter.
|
==== Articles ==== | |
Resource | Description |
GET /articles/:idProduct[/:start] | Returns a collection of articles specified by the idProduct parameter. Returns 206 Partial Content, if the resulting collection contains more than 100 articles. A starting article can be specified by the optional start parameter.
|
==== Users ==== | |
Resource | Description |
GET /user/:idUser | Returns detailed information about a single user specified by the idUser parameter.
|
==== Orders ==== | |
Resource | Description |
GET /orders/:actor/:state[:/start] | Returns a collection of orders specified by the actor parameter (buyer or seller) and the state parameter (bought, paid, sent, received, lost, cancelled). Only orders for the authenticated user are returned. Returns 206 Partial Content, if the resulting collection contains more than 100 orders. A starting product can be specified by the optional start parameter.
|
GET /order/:idOrder | Returns detailed information about a single order specified by the idOrder parameter. An order is only returned, when the authenticated user is buyer or seller of that order.
|
PUT /order/:idOrder | Changes the status of a single order specified by the idOrder parameter. Actions that can be taken via the API are:
Returns the new representation of the specified order. The status of the order can only be changed, when the authenticated user is buyer (mark as received, cancel paid order, request cancellation) or seller (mark as sent, cancel unpaid order, request cancellation). The action of accepting a cancellation request can only be performed, when the other actor requested the cancellation before. |
==== Shopping Cart ==== | |
Resource | Description |
GET /shoppingcart | Returns all details about the shopping cart for the authenticated user. |
PUT /shoppingcart | Add or remove an article to resp. from the shopping cart. Add resp. remove is specified by the data. More articles can be added or removed with one request. Returns the current representation of the shopping cart. |
GET /shoppingcart/checkout | Checks out the shopping cart of the authenticated user and creates orders. Returns the created orders. |
DELETE /shoppingcart | Completely empties the shopping cart of the authenticated user. |
==== Stock Management ==== | |
Resource | Description |
GET /stock[/:start] | Returns a collection of articles in the authenticated user's stock that are available on Cardmarket. Returns 206 Partial Content, if the resulting collection contains more than 100 articles. A starting article can be specified by the optional start parameter.
|
GET /stock/article/:idArticle | Returns a a single article specified by its idArticle . Only returns an entity, when the specified article is in user's stock and available.
|
POST /stock | Adds an article to the authenticated user's stock. |
PUT /stock | Changes an article in the authenticated user's stock. |
PUT /stock/article/:idArticle/increase/:amount | Increases the amount of a single article in stock specified by its idArticle by the specified amount .
|
PUT /stock/article/:idArticle/decrease/:amount | Decreases the amount of a single article in stock specified by its idArticle by the specified amount .
|
DELETE /stock | Deletes an article from the authenticated user's stock. |
==== WantsList ==== | |
Resource | Description |
GET /wantslists | Returns a collection of all wants lists of the authenticated user. |
GET /wantslist/:idWantslist | Returns detailed information of a single wants list specified by the idWantslist parameter.
|
POST /wantslist | Creates a new wants list for for the authenticated user. |
PUT /wantslist/:idWantslist | Adds, edits, or removes item(s) to/on/from a wants list specified by its idWantslist parameter.
|
DELETE /wantslist/:idWantslist | Deletes a wants list specified by its idWantslist .
|
Important notes on "206 - Partial Content" responses