Reference

CardTrader's Full API is organized around REST.

Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Not a developer? There are other ways to automated your card sales through CardTrader! Contact us at info@cardtrader.com.

To access the Full API, you must request it at info@cardtrader.com

Each API call must be authenticated using the Authorization: Bearer [YOUR_AUTH_TOKEN] header, using the JWT token provided upon request.

curl https://api.cardtrader.com/api/full/v1/... \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/...').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Glossary

In CardTrader we use some terms with a slightly different meaning from the ones you are used to considering.

For clarity, here is a quick glossary with the meaning of the terms we use.

App
Your interface with Full API
Game
A game, like Magic: The Gathering or Force of Will
Category
A category of objects, such as a single MTG card or FOW boosters.
Expansion
A specific expansion of a game, such as Unglued or Core Set 2020.
Blueprint
A type of object that you can put on sale, for example a 'Liliana of the Veil' from the 'Innistrad' expansion, specifying some variable characteristics.
Product
A specific item you have for sale. Each product has a price and quantity.
Order
A purchase order that a user made to you, buying items from you that you had for sale.

App Info

GET /info

At this endpoint you can get information about your App.

Your App is the interface through which you will use the Full API.

If the request is properly authenticated, you will get the App object as a response.

Otherwise, you will receive a 401 unauthorized error.

You can use this endpoint to easily check that your authentication is correct.
curl https://api.cardtrader.com/api/full/v1/info \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/info').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The App object

id
integer
A unique identifier for each App

name
string
The name of your App
last_request_at
datetime
The timestamp of the last request. It will always be Time.current
shared_secret
hex
Do not share this information with third parties. You will use it to verify that the notification that CardTrader sends you, for example following an order, are authentic and coming from our servers
{
  "id": 3,
  "name": "Test Carlo",
  "last_request_at": "2019-11-19T11:11:16.000Z",
  "shared_secret": "5acf055640aa1712f90960c8a0b697bb"
}

Games

GET /games

The list of games.

If the request is properly authenticated, you will receive an array of Game objects.

curl https://api.cardtrader.com/api/full/v1/games \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/games').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Game object

id
integer
A unique identifier for each Game
name
string
The name used to identify the Game
display_name
string
The humanised name related to the Game
{
  "id": 1,
  "name": "Magic",
  "display_name": "Magic: the Gathering"
}

Categories

GET /categories

The list of available categories.

A Category represents types of objects with substantially uniform characteristics. For example, ‘single cards’, ‘boosters’, ‘dice’, ‘strategic guides’. There are approximately thirty categories and allow users to easily find the type of object they are looking for.

If the request is properly authenticated, you will receive an array with all the Categories.

Accepted parameters:

game_id
integer
Opzionale Filter results by game_id
curl https://api.cardtrader.com/api/full/v1/categories \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/categories').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Category object

id
integer
A unique identifier for each Category
name
string
The humanized name related to the Category
game_id
integer
The ID of the Game to which this Category belongs
properties
[Property]
An array of Property objects
{
  "id": 1,
  "name": "Magic Single Card",
  "game_id": 1,
  "properties": [
    {
      "name": "condition",
      "type": "string",
      "possible_values": [
        "Mint",
        "Near Mint",
        "Slightly Played",
        "Moderately Played",
        "Played",
        "Heavily Played",
        "Poor"
      ]
    }+ Property
  ]
}

Expansions

GET /expansions

The list of expansions.

If the request is properly authenticated, you will receive an array with all the Expansions.

curl https://api.cardtrader.com/api/full/v1/expansions \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/expansions').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Expansion object

id
integer
A unique identifier for each Expansion.
game_id
integer
The ID of the Game to which this Expansion belongs.
code
string
The code (generally made of 3 or 4 letters) that identifies the expansion.
name
string
The humanized name related to the Expansion, in English
{
  "id": 361,
  "game_id": 1,
  "code": "ugl",
  "name": "Unglued"
}

Blueprints

GET /blueprints/export
(optional) PARAMS category_id
or (optional) PARAMS name
or (optional) PARAMS category_id + PARAMS expansion_id

The list of items that can be sold and purchased.

A Blueprint represents an object model that you can buy or sell. For example, there are three Blueprints for the ‘Magic The Gathering’ card ‘Black Lotus’: one for the Limited Edition Alpha expansion, one for Beta, and one for the Unlimited Edition. The Black Lotus has been reprinted 3 times and each reprint corresponds to a Blueprint. Selling a Black Lotus from the Alpha edition is not the same as selling a Black Lotus from the Beta edition, hence the existence of several Blueprints.

If the request is properly authenticated and the category_id parameter is present and correct you will receive an array with all the Category Blueprints.

Warning! The response could contains many Blueprints and could be very large (30-50MB). This may cause problems for clients like Postman. We suggest, during the test phase, to specify both category_id and expansion_id.

Accepted parameters:

category_id
integer
Opzionale is a positive integer. Must match the ID field of a Category. If it is not specified or the value is invalid, the endpoint will respond with a 404 Not Found error.
name
string
Opzionale filter blueprints where name is exaclty the given value.
expansion_id
integer
Opzionale is a positive integer. Must match the ID field of a Expansion. If it is not specified or the value is invalid, the endpoint will respond with a 404 Not Found error.
curl https://api.cardtrader.com/api/full/v1/blueprints \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d category_id=2 \
  -G
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/blueprints').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Blueprint object

id
integer
A unique identifier for each Blueprint
name
string
The name relative to the Blueprint
display_name
string
The humanized name related to the Blueprint
game_id
integer
The ID of the Game to which this Blueprint belongs
category_id
integer
The ID of the Category to which this Blueprint belongs
expansion_id
integer
The ID of the Expansion to which this Blueprint belongs
fixed_properties
oggetto
An object with fixed Property for this Blueprint. The key is a name of a Property, the value is always one of the possible_values of the Property. The fixed_properties cannot be changed, they only allow you to identify the Blueprints faster
editable_properties
array
An array of variable properties for this Blueprint. When you sell a Product, you will need to specify them by choosing from the allowable values
scryfall_id
string
If present, the ID used by SCRYFALL to identy this Blueprint
{
  "id": 1,
  "name": "Rampaging Brontodon",
  "display_name": "Rampaging Brontodon",
  "game_id": 1,
  "category_id": 1,
  "expansion_id": 13,
  "fixed_properties": {
    "mtg_language": "en",
    "mtg_foil": true
  },
  "editable_properties": [
    {
      "name": "condition",
      "type": "string",
      "possible_values": [
        "Mint",
        "Near Mint",
        "Slightly Played",
        "Moderately Played",
        "Played",
        "Heavily Played",
        "Poor"
      ]
    }+ Property
  ],
  "scryfall_id": "4232ef32-de63-49b1-8fbb-d080231c4bbd"
}

Properties

A property is an object that indicated a possible characteristic of objects in the same Category, or of the same Blueprint.

The Property object

All the objects of the Category, Blueprint, and Product have comparable properties. For example, with regard to dice, each die will have a certain number of faces and a certain color. If they are playing cards, each card will have a language, a condition, and so on.

The Property object specifies a property of a particular Category or a specific Blueprint and the possible values that the Property can take.

name
string
The name used to identify the Property
type
'string' | 'boolean'
The type of the Property
possible_values
array
The array of values that are allowed for this Property
{
  "name": "condition",
  "type": "string",
  "possible_values": [
    "Mint",
    "Near Mint",
    "Slightly Played",
    "Moderately Played",
    "Played",
    "Heavily Played",
    "Poor"
  ]
}
{
  "name": "mtg_foil",
  "type": "boolean",
  "possible_values": [
    true,
    false
  ]
}

Products

GET /products
PARAMS page=1, limit=50
PARAMS blueprint_id, game_id, category_id
PARAMS blueprint_id[], game_id[], category_id[]

The list of products you currently have for sale.

A Product represents a specific item you have for sale, tied to a certain Blueprint. For example, you could have a Black Lotus Limited Edition Alpha expansion for sale for €35,000.

If the request is properly authenticated, you will receive an array with your Products, paged by the page and limit parameters, and possibly filtered by blueprint_id, game_id, and / or category_id.

page is a positive integer. Start from 1. If it is not specified or its value is not valid, by default it is 1.

limit is an integer between 1-100. If it is not specified or its value is invalid, by default it is 50.

blueprint_id, game_id, and category_id also accept multiple values! For example, the call to the endpoint /products?blueprint_id[]=13,14 will return all the Blueprint related Products with ids equal to 13 or 14.
curl https://api.cardtrader.com/api/full/v1/products \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d page=1 \
  -d limit=50 \
  -d blueprint_id[]=13,14 \
  -G
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Product object

id
integer
A unique identifier for each Product
name
string
The name related to the Product
display_name
string
The humanized name related to the Product
price
object
The price of the product, indicated in cents and currency
quantity
integer
The quantity of the Product on sale
description
string
A description set by the seller and publicly visible
graded
string
If present, the indication on the grading
tags
array
Tags, visible only to the seller
game_id
integer
The id of the Game to which this Product belongs
category_id
integer
The id of the Category to which this Product belongs
expansion_id
integer
If present, the ID of the Expansion to which this Product belongs
blueprint_id
integer
The id of the Blueprint to which this Product belongs
properties
oggetto
An object with the Property of this Product. The key is the name of a Property, the value is always one of the possible values of the Property
{
  "id": 3030931,
  "name": "Goblin Goliath",
  "display_name": "Goblin Goliath",
  "price": {
    "cents": 150,
    "currency": "EUR"
  },
  "quantity": 4,
  "bundle": false,
  "description": null,
  "graded": null,
  "tags": [
    "my tag"
  ],
  "game_id": 1,
  "category_id": 1,
  "expansion_id": 1,
  "blueprint_id": 13,
  "properties": {
    "condition": "Slightly Played",
    "mtg_language": "en",
    "mtg_foil": false,
    "signed": false,
    "altered": false
  }
}

Download Product CSV

GET /products/download
PARAMS game_id, category_id

The list of products of a certain Game and of a certain Category currently on sale, in CSV format.

Unlike most of the Full API, which respond in JSON (Content-Type: application/json; charset - utf-8), the call to /products /download responds by sending a CSV file (Content-Type: text/csv; charset = utf-8; header = present and Content-Disposition: attachment; filename = products_1574352050.csv).

game_id and category_id are positive integers. They must be present. They work as a filter: only the Game Products and the specified Category will be shown. If they are not present or the values are invalid, Full API responds with a 422 Unprocessable Entity error.


Single Product Operations

Requests to sell, modify, or remove a Product from the sale at a time.

Individual Product operations are not recommended in favor of Bulk operations. If you have to create or modify or remove one or two products they can be easy, but if you have to operate even on just a handful of Products it is better to group calls to Full API with Bulk operations.

For each of these three operations a specific endpoint is provided, to pass the Product to be sold, or to be modified, or to be removed from the sale.

These operations are instantaneous. If the request is successful, the Product created, modified or removed can be read directly in the response.

Create

POST /products

The endpoint to call to sell a Product.

The request must contain the Product that you want to put on sale.

You can specify the following attributes:

[blueprint identifier key]
integer
Obbligatorio The Blueprint identifier. One of blueprint_id, scryfall_id, mkm_id, tcg_player_id
price
float
Obbligatorio The price of the product, indicated in your current currency
quantity
integer
Obbligatorio The quantity to be put up for sale
description
string
Opzionale A description set by the seller and publicly visible
properties
oggetto
Opzionale An object with the Property of this Product. The key is a name of a Property, the value is always one of the possible_values ​​of the Property object

The [blueprint identifier key] field is mandatory and must be specified using one of these keys: blueprint_id, scryfall_id, mkm_id, tcg_player_id.

If it is missing, Full API responds with a 422 Unprocessable Entity validation error. If it does not match any Blueprint, Full API responds with a 404 Not Found error.

price is mandatory. It's a number with a comma. The currency used is your current currency.

quantity is mandatory. It is a positive integer.

description is an optional string, publicly visible.

properties is an optional object. Contains the desired Property for the Product. The possible properties are those indicated by the editable_properties object of the corresponding Blueprint. The key must be the name of the Property, the value must be one of the possible s_values. If not specified, the Property assumes the default value, for example the Condition will always be 'Near Mint'.

curl -X POST https://api.cardtrader.com/api/full/v1/products \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d '{
  "blueprint_id": 13,
  "price": 2.5,
  "quantity": 4,
  "properties": {
    "condition": "Played"
  }
}'
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Update

PUT /products/:id

The endpoint to call to change a Product currently for sale.

The request must contain the Product on sale that you want to modify.

The request is in PUT because it is independent, i.e it can be repeated without risk.

You can modify a Product by specifying the following attributes.

price
float
Opzionale The price of the product, indicated in your current currency
quantity
integer
Opzionale The quantity to have for sale
description
string
Opzionale A description set by the seller and publicly visible
properties
oggetto
Opzionale An object with the Property of this Product. The key is a name of a Property, the value is always one of the possible_values ​​of the Property object

price is mandatory. It's a number with a comma. The currency used is your current currency.

quantity is mandatory. It is a positive integer.

The quantity field has two different behaviors when used for CREATE or UPDATE. In the case of CREATE, if a Product already exists in the same way, the two quantities will be added together. In the case of UPDATE, the previous quantity is overwritten by the new quantity indicated.

description is an optional string, publicly visible.

properties is an optional object. Contains the desired Property for the Product. The possible properties are those indicated by the editable_properties object of the corresponding Blueprint. The key must be the name of the Property, the value must be one of the possible s_values. If not specified, the Property assumes the default value, for example the Condition will always be 'Near Mint'.

Although not specified, the current value of the Product will be kept, for example if you do not specify the price it will remain unchanged.

curl -X PUT https://api.cardtrader.com/api/full/v1/products/3936985 \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d '{
  "quantity": 4,
  "properties": {
    "condition": "Near Mint"
  }
}'
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products/3936985').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Destroy

DELETE /products/:id

The endpoint to call to remove a Product currently for sale.

The request does not require any body.

curl -X DELETE https://api.cardtrader.com/api/full/v1/products/3936985 \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products/3936985').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Bulk Product Operations

The operations in Bulk are the best way to operate on the Products (put them on sale, modify them or remove them from the sale).

For each of these three operations a specific endpoint is provided, to which to pass an array of Products to be sold, or to be modified, or to be removed from the sale.

Product operations are asynchronous: the endpoint response is instantaneous, and returns an object that has only one key, job, whose value is a string, a uuid. To check the outcome of the operation, you need to check the status of the job at the endpoint /jobs.

Create

POST /products/bulk_create

The endpoint to call to sell products.

The request must contain, to the products key, the Product array that you want to put on sale.

Not all attributes of the Product object are necessary or editable. To create a Product you need the ones below.

blueprint_id
integer
Obbligatorio The id of the Blueprint to put on sale
price
float
Obbligatorio The price of the product, indicated in your current currency
quantity
integer
Obbligatorio The quantity to be put up for sale
description
string
Opzionale A description set by the seller and publicly visible
properties
oggetto
Opzionale An object with the Property of this Product. The key is a name of a Property, the value is always one of the possible_values ​​of the Property object

The Products are offered for sale asynchronously: the endpoint response is instantaneous, and returns an object that has only one key, job, whose value is a string, a uuid. To check the outcome of the operation, you need to check the status of the job at the endpoint /jobs.

curl -X POST https://api.cardtrader.com/api/full/v1/products/bulk_create \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d '{
  "products": [
    {
      "blueprint_id": 13,
      "price": 3.5,
      "quantity": 4
    },
    {
      "blueprint_id": 13,
      "price": 2.5,
      "quantity": 4,
      "properties": {
        "condition": "Played"
      }
    }
  ]
}'
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products/bulk_create').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Update

POST /products/bulk_update

The endpoint to call to change products currently on sale.

The request must contain, to the products key, the array of Product on sale that you want to modify.

You can modify a Product by specifying the following attributes.

id
integer
Obbligatorio The id of the Product to be modified
price
float
Opzionale The price of the product, indicated in your current currency
quantity
integer
Opzionale The quantity to be put up for sale
description
string
Opzionale A description set by the seller and publicly visible
properties
oggetto
Opzionale An object with the Property of this Product. The key is a name of a Property, the value is always one of the possible_values ​​of the Property object

Although not specified, the current value will be kept, for example if you do not specify the price of a Product it will remain unchanged.

Products for sale are modified asynchronously: the endpoint response is instantaneous, and returns an object that has only one key, job, whose value is a string, a uuid. To check the outcome of the operation, you need to check the status of the job at the endpoint /jobs.

curl -X POST https://api.cardtrader.com/api/full/v1/products/bulk_update \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d '{
  "products": [
    {
      "id": 3936985,
      "quantity": 4,
      "properties": {
        "condition": "Near Mint"
      }
    },
    {
      "id": 3936986,
      "quantity": 4,
      "price": 2.5,
      "properties": {
        "foil": false
      }
    }
  ]
}'
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products/bulk_update').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Destroy

POST /products/bulk_destroy

The endpoint to call to remove products currently for sale.

The request must contain, at the products key, the Product array that you want to remove from the sale.

The only necessary and sufficient attribute is the id.

id
integer
Obbligatorio The id of the product to be removed

Products are removed from the sale asynchronously: the endpoint response is instantaneous, and returns an object that has only one key, job, whose value is a string, a uuid. To check the outcome of the operation, you need to check the status of the job at the endpoint /jobs.

curl -X POST https://api.cardtrader.com/api/full/v1/products/bulk_destroy \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d '{
  "products": [
    {
      "id": 3936985
    },
    {
      "id": 3936986
    }
  ]
}'
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/products/bulk_destroy').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Jobs

The response to an action to create, modify or remove a Product is the Job's uuid who is responsible for that action.

{
  "job": "ff0dbab1-b1cd-4d56-bfca-888389ef4c80"
}

Job Status

GET /jobs/:uuid

The endpoint for inspecting the Job.

The state of the Job indicates its progress: if it is pending, it means that it has not yet begun. If it is running, the Job is currently in progress. If it is unprocessable it means that there has been an error. If it is completed, the Job is completed and the results shown are final.

The Job's stats indicate the number of Products processed correctly (ok), processed but with caveats (warnings) or not processed due to errors (error).

In the event of warnings or errors, the warnings and errors keys provide specific details about the individual inputs that caused them.

curl https://api.cardtrader.com/api/full/v1/jobs/ff0dbab1-b1cd-4d56-bfca-888389ef4c80 \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/jobs/ff0dbab1-b1cd-4d56-bfca-888389ef4c80').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

The Job object

uuid
integer
A unique identifier for each job
state
'pending' | 'running' | 'unprocessable' | 'completed'
Job status
spawned_children
integer
The number of operations to be performed
stats
object
The JobStats object, which specifies how many operations were successful, have warnings, have errors or are still pending
warnings
array
An array of JobWarning objects
errors
array
An array of JobError objects
{
  "uuid": "2538ef8f-cc9b-4035-961c-1cece4afb2a0",
  "state": "completed",
  "spawned_children": 4,
  "stats": {
    "ok": 2,
    "warning": 1,
    "error": 1
  },
  "warnings": [
    {
      "uuid": "cb36883d-9fc4-4318-903a-f23c6464021a",
      "input": {
        "price": 15,
        "quantity": "2",
        "blueprint_id": 13,
        "properties": {
          "mtg_foil": false
        }
      },
      "output": {
        "result": "warning",
        "warnings": {
          "properties": {
            "mtg_foil": [
              "Read only property mtg_foil has been ignored"
            ]
          }
        }
      }
    }+ JobWarning
  ],
  "errors": [
    {
      "uuid": "729d28e7-d6d4-4934-80b0-c99289bef61b",
      "input": {
        "price": 2,
        "quantity": 1
      },
      "output": {
        "errors": {
          "blueprint_id": [
            "Blueprint can't be blank"
          ]
        }
      }
    }+ JobError
  ]
}

JobWarning

A JobWarning indicates a Product that has been processed, but whose initial inputs are not totally compliant with the specifications.

In any case, such as a case of a simple warning, the operation on the Product must not be retried because it has been performed.

uuid
integer
A unique identifier for each JobWarning
input
object
The input that caused this JobWarning
output
object
The output of the JobWarning
result
'warning'
It is specified that this output resulted in a warning
warnings
object
The cause of the warning
{
  "uuid": "cb36883d-9fc4-4318-903a-f23c6464021a",
  "input": {
    "price": 15,
    "quantity": "2",
    "blueprint_id": 13,
    "properties": {
      "mtg_foil": false
    }
  },
  "output": {
    "result": "warning",
    "warnings": {
      "properties": {
        "mtg_foil": [
          "Read only property mtg_foil has been ignored"
        ]
      }
    }
  }
}

JobError

A JobError indicates a Product that has not been processed, because the starting input did not comply with the specifications.

A JobError indicates an error in the use of the Full API by those who made the API call, such as not having specified the blueprint_id.

uuid
integer
A unique identifier for each JobError
input
object
The input that caused this JobError
output
object
The output of the JobError
result
'error'
It is specified that this output resulted in an error
errors
object
The cause of the error
{
  "uuid": "729d28e7-d6d4-4934-80b0-c99289bef61b",
  "input": {
    "price": 2,
    "quantity": 1
  },
  "output": {
    "errors": {
      "blueprint_id": [
        "Blueprint can't be blank"
      ]
    }
  }
}

Orders

GET /orders
(optional) PARAMS page=1, limit=20
(optional) PARAMS from, to
(optional) PARAMS from_id, to_id
(optional) PARAMS sort

The list of orders you received, from date to date and from_id to_id, sorted by sort. An Order is a user purchasing your Products.

page is a positive integer starting from 1. If not specified or invalid, default will be 1.

limit is an integer between 1 and 100. If not specified or invalid, default will be 20.

from is a date in the YYYY-MM-DD format. If not specified or invalid, default will be 1st January 1970.

to is a date in the YYYY-MM-DD format. If not specified or invalid, default will be the current date.

from_id is an integer. If not specified or invalid, default will be 0. Filters the results excluding the Orders with id equal or less than from_id

to_id is an integer. If not specified or invalid, default will be 'infinite'. Filters the results excluding the Orders with id greater than to_id

sort is a string, in the format <id|date>.<asc|desc>. If not specified or invalid, default will be 'date.desc'. You can sort by id or by date, in ascending or descending order.

curl https://api.cardtrader.com/api/full/v1/orders \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]" \
  -d sort=date.desc \
  -d from=2019-01-01 \
  -d to=2019-03-01 \
  -d from_id=35102 \
  -d to_id=37192 \
  -G
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Order object

id
integer
A unique identifier for each Order
code
string
A code related to the Order
transaction_code
string
A code related to the Order
seller
User
seller's username (you)
buyer
User
buyer's username
state
'paid' | 'done'
The status of the Order
size
integer
The number of items sold in this Order
credit_added_to_seller_at
datetime
The date this Order was credited to you
sent_at
datetime
The date on which this Order was sent
cancelled_at
datetime
The date on which this Order was canceled
cancel_requester
User
username of the person who requested the cancellation
seller_total
Money
The total for this order, indicated in cents and currency, in your currency
presale_ended_at
datetime
The date on which the presale was finished for the objects of this order
fee_percentage
float
Your commission percentage on this Order
fee_reason
'seller'
The cause of the fee. The value of this field is always 'seller'
seller_fee_amount
Money
Your total commission for this order, indicated in cents and currency, in your currency
seller_subtotal
Money
The subtotal for this order, indicated in cents and currency, in your currency
packing_number
integer
A unique number of orders not yet shipped, to help package them during shipment
order_shipping_address
Address
The address to send the order to
order_billing_address
Address
The billing address
order_shipping_method
ShippingMethod
The shipping method
presale
boolean
Indicates whether the order was a presale or not
order_items
[OrderItem]
An array of items sold in this order
{
  "id": 41,
  "code": "201902071796b5",
  "transaction_code": "20190207013a31d8aa43",
  "seller": {
    "username": "The seller username (you)"
  }+ User,
  "buyer": {
    "username": "The buyer username"
  }+ User,
  "state": "done",
  "size": 1,
  "credit_added_to_seller_at": null,
  "sent_at": "2019-02-19T01:05:07.000Z",
  "cancelled_at": null,
  "cancel_requester": {
    "username": "The seller username (you)"
  }+ User,
  "seller_total": {
    "cents": 248,
    "currency": "USD"
  }+ Money,
  "presale_ended_at": null,
  "fee_percentage": "2.5",
  "fee_reason": "seller",
  "seller_fee_amount": {
    "cents": 12,
    "currency": "USD"
  }+ Money,
  "seller_subtotal": {
    "cents": 228,
    "currency": "USD"
  }+ Money,
  "packing_number": null,
  "order_shipping_address": {
    "id": 82,
    "name": "Buyer Full Name",
    "street": "Jast Roads",
    "zip": "15169",
    "city": "Russellchester",
    "state_or_province": "Alabama",
    "country_code": "AM",
    "vat_number": "BR26.370.353/8354-65",
    "note": null,
    "country": "Armenia"
  }+ Address,
  "order_billing_address": {
    "id": 82,
    "name": "Buyer Full Name",
    "street": "Jast Roads",
    "zip": "15169",
    "city": "Russellchester",
    "state_or_province": "Alabama",
    "country_code": "AM",
    "vat_number": "BR26.370.353/8354-65",
    "note": null,
    "country": "Armenia"
  }+ Address,
  "order_shipping_method": {
    "id": 41,
    "name": "Posta 4",
    "tracked": false,
    "tracking_code": null,
    "max_estimate_shipping_days": 6,
    "seller_price": {
      "cents": 224,
      "currency": "USD"
    }
  }+ ShippingMethod,
  "presale": null,
  "order_items": [
    {
    "product_id": 143861,
    "blueprint_id": 1717,
    "category_id": 1,
    "game_id": 1,
    "name": "Opt",
    "expansion": "Dominaria",
    "properties": {
      "mtg_language": "en",
      "condition": "Near Mint",
      "mtg_foil": false,
      "signed": false,
      "altered": false,
      "mtg_rarity": "common",
      "collector_number": "60",
      "cmc": "1.0",
      "mtg_card_colors": "U"
    },
    "quantity": 1,
    "description": "",
    "seller_price": {
      "cents": 24,
      "currency": "AUD"
    },
    "tags": [],
    "graded": null,
    "scryfall_id": "25f2e4d0-effd-4e83-b7aa-1a0d8f120951"
  }+ OrderItem
  ]
}

Address

Address indicates an address, used by Order to indicate the address to which to send the order, and to indicate the billing address.

id
integer
A unique identifier for each address
name
string
The full name for this address
street
string
The street related to this address
zip
string
The ZIP code of this address
city
string
The city of this address
state_or_province
string
The state/province of this address
country
string
The country where this address is located
country_code
string
The ISO3166 country code
vat_number
string
The tax code
note
string
Any notes left by the addressee
{
  "id": 82,
  "name": "Buyer Full Name",
  "street": "Jast Roads",
  "zip": "15169",
  "city": "Russellchester",
  "state_or_province": "Alabama",
  "country_code": "AM",
  "vat_number": "BR26.370.353/8354-65",
  "note": null,
  "country": "Armenia"
}

ShippingMethod

ShippingMethod indicates the shipping method required for shipping the order.

id
integer
A unique identifier for each ShippingMethod
name
string
The name of this shipping method
tracked
boolean
Indicates whether this shipping method is tracked or not
tracking_code
string
If it is tracked, the tracking number
max_estimate_shipping_days
string
The maximum estimate of the number of days
seller_price
Money
The shipping cost, indicated in cents and currency, in your
{
  "id": 41,
  "name": "Posta 4",
  "tracked": false,
  "tracking_code": null,
  "max_estimate_shipping_days": 6,
  "seller_price": {
    "cents": 224,
    "currency": "USD"
  }
}

OrderItem

An OrderItem is a specific product in the Order. Share some attributes with the Product object.

product_id
integer
The Product ID this OrderItem belongs to
blueprint_id
integer
The id of the Blueprint to which this OrderItem belongs
category_id
integer
The id of the Category to which this OrderItem belongs
game_id
integer
The id of the Game to which this OrderItem belongs
name
string
The name of this OrderItem, copied from that of the Product
expansion
Money
The name of the expansion to which this OrderItem belongs
properties
oggetto
An object with the properties of this OrderItem. The key is a name of a Property, the value is always one of the possible_values ​​of the Property object
quantity
integer
The quantity sold
description
string
A description set by the seller and publicly visible
seller_price
Money
The price of the product, indicated in cents and currency, in your current currency
tags
array
Tags, visible only to the seller
graded
string
If present, the indication on the grading
scryfall_id
string
If present, the id used by SCRYFALL to identify the Blueprint corresponding to this OrderItem
{
  "product_id": 143861,
  "blueprint_id": 1717,
  "category_id": 1,
  "game_id": 1,
  "name": "Opt",
  "expansion": "Dominaria",
  "properties": {
    "mtg_language": "en",
    "condition": "Near Mint",
    "mtg_foil": false,
    "signed": false,
    "altered": false,
    "mtg_rarity": "common",
    "collector_number": "60",
    "cmc": "1.0",
    "mtg_card_colors": "U"
  },
  "quantity": 1,
  "description": "",
  "seller_price": {
    "cents": 24,
    "currency": "AUD"
  },
  "tags": [

  ],
  "graded": null,
  "scryfall_id": "25f2e4d0-effd-4e83-b7aa-1a0d8f120951"
}

Order Details

GET /orders/:id

The call to retrieve information from a single Order.

The request does not require any body.

Full API responds with the requested Order object.

curl https://api.cardtrader.com/api/full/v1/orders/1234567 \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders/1234567').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Ship Order

PUT /orders/:id/ship

Mark the order as sent if the transition is possible or raises an error otherwise.

The request does not require any body.

Full API responds with the requested Order object.

curl https://api.cardtrader.com/api/full/v1/orders/1234567/ship \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders/1234567/ship').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Request Order Cancellation

PUT /orders/:id/request_for_cancel

Asks for the order cancellation if the current order state permits the transition. error otherwise.

You can specify the following attributes:

cancel_explanation
string
Obbligatorio Reason of the cancellation. Must be at least 50 characters.
relist_if_cancelled
boolean
Sets the relist cancel in case the cancellation is confirmed.

Full API responds with the requested Order object.

curl https://api.cardtrader.com/api/full/v1/orders/1234567/request_for_cancel \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders/1234567/request_for_cancel').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Confirm Order Cancellation

PUT /orders/:id/cancel

Confirm order cancellation if the current order state permits the transition. Raise an error otherwise.

You can specify the following attributes:

relist_if_cancelled
boolean
Sets the relist cancel in case the cancellation is confirmed.

Full API responds with the requested Order object.

curl https://api.cardtrader.com/api/full/v1/orders/1234567/cancel \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders/1234567/cancel').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Set Tracking Code

PUT /orders/:id/tracking_code

Set a tracking code for the order.

You can specify the following attributes:

tracking_code
string
Obbligatorio Order tracking code

Full API responds with an Address object.

curl https://api.cardtrader.com/api/full/v1/orders/1234567/set_tracking_code \
  -H "Authorization: Bearer [YOUR_AUTH_TOKEN]"
require 'open-uri'
  response = open('https://api.cardtrader.com/api/full/v1/orders/1234567/set_tracking_code').read
      

        import stripe
        charge = stripe.Charge.retrieve(
          "ch_1FeIOO2eZvKYlo2CQfB4akka",
          api_key="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        )
        charge.save() # Uses the same API Key.
      

        $ch = \Stripe\Charge::retrieve(
          "ch_1FeIOi2eZvKYlo2CWSZu0pqc",
          ['api_key' => "sk_test_4eC39HqLyjWDarjtT1zdp7dc"],
        );
        $ch->capture(); // Uses the same API Key.
      

        RequestOptions requestOptions = RequestOptions.builder()
          .setApiKey("sk_test_4eC39HqLyjWDarjtT1zdp7dc")
          .build();

        Charge charge = Charge.retrieve(
          "ch_1FeIP12eZvKYlo2CRFjJAUNR",
          requestOptions,
        );

        charge.save(); // Uses the same API Key.
      

        stripe.charges.retrieve("ch_1FeIPJ2eZvKYlo2CZr6qMWOz", {
          api_key: "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        });
      

        sc := &client.API{}
        sc.Init("sk_test_4eC39HqLyjWDarjtT1zdp7dc", nil)
        sc.Charges.Get("ch_1FeIPb2eZvKYlo2CsxmN8W5Y", params)
      

        var options = new RequestOptions
        {
          ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
        };
        var service = new ChargeService();
        Charge charge = service.Get(
          "ch_1FeIPq2eZvKYlo2ClamAJsMQ",
          options
        );
      

Errors

There are some standard error response that you will encounter when implementing CardTrader Full API

Errore 401 Unauthorized

If the authentication is incorrect, for example because the Bearer Token is absent or incorrect, Full API responds with a 401 Unauthorized error.

{
  "error_code": "unauthorized",
  "errors": [

  ],
  "extra": {
    "message": "You are not authorized to access this page"
  },
  "request_id": "a30bd6bd-1acc-4c0b-849e-e0622b9578ef"
}

Errore 404 Not Found

If a resource is not present, Full API responds with a 404 Not Found error.

{
  "error_code": "not_found",
  "errors": [

  ],
  "extra": {
    "message": "Data is not ready for blueprints_cat_200"
  },
  "request_id": "44d54918-9dd4-412f-8a5b-5dde6ea30fc9"
}

Errore 422 Unprocessable Entity

If a mandatory parameter is not present, Full API responds with a 422 Unprocessable Entity error.

{
  "error_code": "missing_parameter",
  "errors": [

  ],
  "extra": {
    "message": "Missing required parameter(s) game_id"
  },
  "request_id": "2835d714-be5d-4fc2-866c-7d49ed68e7ff"
}

Webhooks

If your app is enabled to receive https calls, and you have entered an endpoint, Full API will notify your endpoint whenever a Product or Order is created, modified or deleted.

For example, the endpoint is called:

  • When using a graphic interface, you are putting a new product on sale
  • When you change the quantity of a product for sale from a graphic interface
  • When you change some features of a product for sale from a graphic interface
  • When you remove a product from the graphic interface from a graphic interface
  • When another user orders from you
  • When setting the order from the graphic interface as shipped or changing its status
  • When another user marks your order as received

The endpoint is not called if you, through the Full API, create, modify or delete a Product or Order.
id
integer
A unique UUID for each call to your endpoint
time
integer
Request time as an integer number of seconds since the Epoch
cause
('product' | 'order').('create' | 'update' | 'destroy')
The cause of the endpoint call. It may be the creation, updating or removal of a Product or Order
object_class
'Product' | 'Order
The object that was created, updated or removed, a Product or an Order
object_id
integer
The id of the object
mode
'test' | 'live'
If the webhook is in production (live) or is in a test
data
json
The webhook payload. In the case of create or update, it is the object itself. In the case of destroy, it is empty.
{
  "id": "0490d0ad-9790-429e-ae42-69c4da964e6c",
  "time": 1574775369,
  "cause": "product.update",
  "object_class": "Product",
  "object_id": 3030931,
  "mode": "test",
  "data": {
        "id": 3030931,
        "name": "Goblin Goliath",
        "display_name": "Goblin Goliath",
        "price": {
          "cents": 150,
          "currency": "EUR"
        },
        "quantity": 4,
        "bundle": false,
        "description": null,
        "graded": null,
        "tags": ["my tag"],
        "game_id": 1,
        "category_id": 1,
        "expansion_id": 1,
        "blueprint_id": 13,
        "properties": {
          "condition": "Slightly Played",
          "mtg_language": "en",
          "mtg_foil": false,
          "signed": false,
          "altered": false
        }
      }+ DataPayload
}

DataPayload

When the webhook is of type product.create or product.update, DataPayload is the Product type object that has been created or modified.

When the webhook is of type order.create or order.update, DataPayload is the object of type Order that has been created or modified.

When the webhook is of type product.destroy or order.destroy, DataPayload is empty.

Check the Webhook Signature

It is possible to verify that the received webhook really comes from CardTrader Full API.

Each original request coming from the Full API is signed by a Signature header, which is the base64 representation of the HMAC digest via sha256 of the request body, signed with the app's shared_secret.

key = "YOUR APP SHARED SECRET"
data = request.body
signature = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, data)
if Base64.encode64(signature).strip == header[:Signature]
  # all ok :)
else
  # the request did not come from CardTrader Full API
end

      

Signature is obtained through OpenSSL::HMAC.digest with sha256.

Chat with us