Trades

    EndpointDescription
    GET /v1/tradesGets a list of trades
    GET /v1/trades/:trade_idGets a trade
    POST /v1/trades/:trade_idUpdates a trade

    GET /v1/trades

    Gets a list of trades

    Request Parameters

    None

    Example Request

    Header:

    GET /v1/trades
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    Name Type Description
    data array
    data[] object
    data[].id string Trade ID. (identical to :trade_id)
    data[].type string Type of resource. Must be "trades".
    data[].attributes object
    data[].attributes.give object Pokémon to give.
    data[].attributes.give.id string Pokédex ID.
    data[].attributes.give.type string Type of Pokémon resource. Must be "pokemon_names".
    data[].attributes.give.attributes object
    data[].attributes.give.attributes.name string Pokémon name.
    data[].attributes.give.links object
    data[].attributes.give.links.self string Link to Pokémon resource.
    data[].attributes.get object Pokémon to get.
    data[].attributes.get.id string Pokédex ID.
    data[].attributes.get.type string Type of Pokémon resource. Must be "pokemon_names".
    data[].attributes.get.attributes object
    data[].attributes.get.attributes.name string Pokémon name.
    data[].attributes.get.links object
    data[].attributes.get.links.self string Link to Pokémon resource.
    data[].attributes.nickname string Pokémon nickname.
    data[].links object
    data[].links.self string Link to current resource.
    links object
    links.self string Link to list resource.

    Example Response

    Headers:

    HTTP/1.1 200 OK
    Content-Type: application/json
    Server: pkmnapi/0.1.0
    

    Body:

    {
        "data": [
            {
                "id": "0",
                "type": "trades",
                "attributes": {
                    "give": {
                        "id": "33",
                        "type": "pokemon_names",
                        "attributes": {
                            "name": "NIDORINO"
                        },
                        "links": {
                            "self": "https://api.pkmnapi.com/v1/pokemon/names/33"
                        }
                    },
                    "get": {
                        "id": "30",
                        "type": "pokemon_names",
                        "attributes": {
                            "name": "NIDORINA"
                        },
                        "links": {
                            "self": "https://api.pkmnapi.com/v1/pokemon/names/30"
                        }
                    },
                    "nickname": "TERRY"
                },
                "links": {
                    "self": "https://api.pkmnapi.com/v1/trades/0"
                }
            },
            ...
        ],
        "links": {
            "self": "https://api.pkmnapi.com/v1/trades"
        }
    }
    

    GET /v1/trades/:trade_id

    Gets a trade

    Request Parameters

    Location Name Type Required? Description
    url :trade_id string ✔️ Trade ID.

    Example Request

    Header:

    GET /v1/trades/0
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    Name Type Description
    data object
    data.id string Trade ID. (identical to :trade_id)
    data.type string Type of resource. Must be "trades".
    data.attributes object
    data.attributes.give object Pokémon to give.
    data.attributes.give.id string Pokédex ID.
    data.attributes.give.type string Type of Pokémon resource. Must be "pokemon_names".
    data.attributes.give.attributes object
    data.attributes.give.attributes.name string Pokémon name.
    data.attributes.give.links object
    data.attributes.give.links.self string Link to Pokémon resource.
    data.attributes.get object Pokémon to give.
    data.attributes.get.id string Pokédex ID.
    data.attributes.get.type string Type of Pokémon resource. Must be "pokemon_names".
    data.attributes.get.attributes object
    data.attributes.get.attributes.name string Pokémon name.
    data.attributes.get.links object
    data.attributes.get.links.self string Link to Pokémon resource.
    data.attributes.nickname string Pokémon nickname.
    data.links object
    data.links.self string Link to current resource.
    links object
    links.self string Link to current resource.

    Example Response

    Headers:

    HTTP/1.1 200 OK
    Content-Type: application/json
    Server: pkmnapi/0.1.0
    

    Body:

    {
        "data": {
            "id": "0",
            "type": "trades",
            "attributes": {
                "give": {
                    "id": "33",
                    "type": "pokemon_names",
                    "attributes": {
                        "name": "NIDORINO"
                    },
                    "links": {
                        "self": "https://api.pkmnapi.com/v1/pokemon/names/33"
                    }
                },
                "get": {
                    "id": "30",
                    "type": "pokemon_names",
                    "attributes": {
                        "name": "NIDORINA"
                    },
                    "links": {
                        "self": "https://api.pkmnapi.com/v1/pokemon/names/30"
                    }
                },
                "nickname": "TERRY"
            },
            "links": {
                "self": "https://api.pkmnapi.com/v1/trades/0"
            }
        },
        "links": {
            "self": "https://api.pkmnapi.com/v1/trades/0"
        }
    }
    

    POST /v1/trades/:trade_id

    Updates a trade

    Request Parameters

    Location Name Type Required? Description
    url :trade_id string ✔️ Trade ID.
    header X-Patch-Description string Description of change.
    body data object ✔️
    body data.type string ✔️ Type of data. Must be "trades".
    body data.attributes object ✔️
    body data.attributes.give object ✔️ Pokémon to give.
    body data.attributes.give.id string ✔️ Pokédex ID.
    body data.attributes.get object ✔️ Pokémon to get.
    body data.attributes.get.id string ✔️ Pokédex ID.
    body data.attributes.nickname string ✔️ Pokémon nickname.

    Example Request

    Header:

    POST /v1/trades/0
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    Content-Type: application/json
    X-Patch-Description: Update BULBASAUR to LEAFY-BOI
    

    Body:

    {
        "data": {
            "type": "trades",
            "attributes": {
                "give": {
                    "id": "3"
                },
                "get": {
                    "id": "6"
                },
                "nickname": "CHARCHAR"
            }
        }
    }
    

    Response Parameters

    None

    Example Response

    Headers:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    Server: pkmnapi/0.1.0
    

    Body:

    {}