NAV Navbar
javascript

Introduction

Welcome to the Shadowpay API! You can use our API to access Shadowpay API endpoints, which can get information about items, send trades, buy and sell items!

If you have any questions or suggestions feel free to contact us: [email protected]

Authentication

Make sure to replace sometesttoken with your API token.

Shadowpay uses API keys to allow access to the API. You can get new API key at our website page.

Token expects to be included in all API requests to the server in a POST parameter, that looks like the following:

token: sometesttoken

If you use Pay by Steam Skin - use SECRET_HASH and PUBLIC_HASH (see information below)

Response Structure

You should check status of response before operating response data.

Shadowpay uses array to return data of any type of request.

Every success API call returns {"status":"success"} inside of first response array.

If request failed, response will contain {"status":"error", "error_message":"some_error"} with error text.

Games Naming

Shadowpay uses project params or array key in response to determine game name.

We use "project" => "csgo" field to clarify item's game.

Name Description
csgo Counter-Strike: Global Offensive
dota2 Dota 2
games SteamCommunity Items

Pay by Steam Skins

Shadowpay offers functionality to refill balance on your website using Steam Skins.

Main flow is:

  1. User click link (button) "Pay By Steam Skin";
  2. Website generates request to Shadowpay and return payment link;
  3. Website redirects user to shadowpay payment link;
  4. User install extension or application for automatic, fast, secure trading;
  5. User put decided skins on sale and wait for buyers. Extension or application sends items to buyer, user confirms trade. Every successful sold skins your website will receive IPN with amount of money for each item, that user has sold, and you should add this amount to user's account on Shadowpay merchant account will receive money, for each item that user sold. Merchant can withdraw it.

To start:

  1. You should generate Public hash and Secret hash in merchant panel.
  2. Set IPN url for instant notifications in merchant panel.

Create payment link

The above command returns JSON structured like this:

{
    "token":"a1d579731b5fd7b7cb8f64c641f73111",
    "url":"https:\/\/shadowpay.com\/en\/pay?token=a1d579731b5fd7b7cb8f64c641f73111",
    "status":"success"
}
$params['signature'] = hash('sha256', $params['order_id'] . $params['amount'] . $params['currency'] . SECRET_HASH)

When user clicks button - server should generate this request, and receive payment link.

User should be redirected to this payment link.

HTTP Request

POST https://shadowpay.com/en/pay/PUBLIC_HASH

POST Parameters

Parameter Required Description
account true Users account "id" in your database. Can be steamid. Use INT(unsigned) values only.
order_id true Unique order id for identify payment
security_steam_id true User's steamid
currency true 'USD' - right now only USD amount will be returned for each payment
signature true Generated Signature
steam_trade_token false User's trade token
amount false Amount in USD

Receive notifications

The callback is performed at the URL you specify with the parameters listed below.

https://example.com/result?
   amount=6.66
   &token=6764d01a08bdfc50
   &account=demo
   &order_id=12345
   &currency=USD
   &trade_id=786f1d3cccb2828c
   &create_date=2017-06-08+21%3A48%3A02
   &status=complete
   &transaction_id=45f7fa62-622f-48bc-b606-dccd2c662bad
   &ip=0.0.0.0
   &hash=8e27a52faba8b7253e94b1c2b0898ff11713c8dd80d60a112922bf66336fd331

Each user's skin sell you will receive notification via IPN link.

For validation of IPN data - use this code.

$string = $_REQUEST['order_id'] . $_REQUEST['amount'] . $_REQUEST['currency'] . $_REQUEST['trade_id'] . SECRET_HASH;
$hash = hash('sha256', $string);

if ($hash !== $_REQUEST['hash']){
    die('wrong params');
}

GET Parameters structure

Parameter Description
type Payment type, in this case it will be constantly "payment"
amount Amount in USD
token Payment token that was returned on "Create payment link" method
account Users account "id" in your database. Can be steamid. Use INT(unsigned) values only.
order_id Unique order id for identify payment
trade_id Unique id for the trade of one of the items sold in the payment
transaction_id Unique id of payment
currency "USD" - right now only USD amount will be returned for each payment
status Payment status, constantly "complete"
hash Generated Signature
create_date Date of payment

Сomposite key transaction_id+trade_id is unique key to identify the transaction

To finish the ipn transaction you need to send a proper response.

String "ok" for successfully processed transaction. String "error" in case of errors.

The partner system should return the result of the previous request without replenishing / crediting anything, upon receipt of a repeated request.

In case if your server don't answer "ok", shadowpay will generate repeat requests with such timing: +1 min +4 min +12 min +40 min +2 hour +7 hour +24 hour

Shadowpay CORE API - Buy and Sell P2P system

Get account balance

The above command returns JSON structured like this:

{
    "currency": "USD",
    "balance": "100",
    "deposit_balance": "200",
    "status": "success"
}

This endpoint returns account balance in USD.

HTTP Request

POST https://shadowpay.com/api/v1/get_balance

POST Parameters

Parameter Required Description
token true Authorization token

Buy item

The above command returns JSON structured like this:

{
  "id": "336",
  "trade_data": {
    "id": "336",
    "state": "active",
    "price": "0.25",
    "steam_trade_token": "9Kukc22f",
    "steam_trade_offer_state": null,
    "steam_tradeofferid": null,
    "steam_to_steamid": "76561111111111111",
    "causer": null,
    "time_created": "2019-08-28 20:03:22",
    "custom_id": null,
    "items": [
      {
        "state": "pending",
        "project": "csgo",
        "steam_market_hash_name": "Glock-18 | Candy Apple (Minimal Wear)",
        "steam_asset_id": "15901375629",
        "price": "0.25"
      }
    ]
  },
  "success": true,
  "status": "success"
}

This endpoint retrieves items available to buy by Market Hash Name.

HTTP Request

POST https://shadowpay.com/api/v1/buy_item

POST Parameters

Parameter Required Description
token true Authorization token
id true id in system of item that you want to buy
price false Under development.
custom_id false Id to find trade later. You can find and track your trade later by this is.
steamid true Steam ID64 of account to delivery trade
trade_token true Steam trade token to delivery trade

Errors

Error Code Meaning
buy_items_disabled Purchasing items is unavailable now, please try again later
wrong_params Check your params or not found any suitable data
no_item Item is not available already
buyer_has_buy_items_ban Buyer passed in your request has buy item ban on shadowpay due to inactivity or scam actions. In this case response will consist ban_until and ban_reason params.
need_sum You don't have enough money
internal_error Something goes wrong
no_item_in_inventory No item in seller inventory
trade_yourself You can't trade with yourself
seller_offline_error Seller Error. Seller is offline at this moment
need_apikey Invalid API Key of seller
invalid_trade_seller_link Invalid trade link of seller
invalid_tradelink Invalid trade link
empty_user_data We can't identify your user
custom_id_exist This custom_id exist
error_steam_or_bot Potential problems with Steam or the bot, try again later

Get operations by custom id

The above command returns JSON structured like this:

{
    "data": {
        "400": {
            "state": "finished",
            "price": "0.20",
            "steam_trade_token": "96rhgftT",
            "steam_trade_offer_state": "3",
            "steam_tradeofferid": "12341234",
            "steam_to_steamid": "76562222222222222",
            "steam_from_steamid": "76561111111111111",
            "causer": null,
            "time_created": "2019-09-04 23:27:09",
            "custom_id": "400",
            "items": [
                {
                    "state": "finished",
                    "project": "csgo",
                    "steam_market_hash_name": "Tec-9 | Isaac (Well-Worn)",
                    "steam_asset_id": "16560280126",
                    "price": "0.20"
                }
            ]
        }
    },
    "status": "success"
}

This endpoint retrieves trades by custom_id, you can track state of buy transactions.

custom_id could be set as array of keys or single id.

Available States:

active — Trade created and waiting for action.

cancelled — Trade not accepted or not sent, and went to state cancelled.

finished — Trade done successfully.

HTTP Request

POST https://shadowpay.com/api/v1/list_buy_info_by_custom_id

POST Parameters

Parameter Required Description
token true Authorization token
custom_id true Comma separated custom ids

Search for items on sale

The above command returns JSON structured like this:

{
    "data": [
        {
            "id": "289543",
            "steam_market_hash_name": "Glock-18 | Bunsen Burner (Field-Tested)",
            "price": "0.13"
        }
    ],
    "status": "success"
}

This endpoint retrieves all items available for purchase by the given market hash name

HTTP Request

POST https://shadowpay.com/api/v1/search_item

POST Parameters

Parameter Required Description
token true Authorization token
project false (csgo/dota2) Default: csgo
steam_market_hash_name true Steam Market Hash Name string

Search items on sale by item name

The above command returns JSON structured like this:

{
    "data": {
        "Glock-18 | Bunsen Burner (Field-Tested)": [
            {
                "id": "289543",
                "price": "0.13"
            }
        ]
    },
    "status": "success"
}

This endpoint retrieves items available to buy.

If you want to find specific items - add as POST Param steam_market_hash_name[increment] as many as you wish.

Response array will be grouped by Market Hash Name and by descending sort.

HTTP Request

POST https://shadowpay.com/api/v1/search_items_by_list_names

POST Parameters

Parameter Required Description
token true Authorization token
steam_market_hash_name[1] false Steam Market Hash Name string
steam_market_hash_name[2] false One more Steam Market Hash Name string
project false (csgo/dota2) Default: csgo
from false Timestamp from, nearest to now.
to false Timestamp to, back date

Search similar items

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "7408371",
      "steam_market_hash_name": "Rezan The Ready | Sabre",
      "price": "1.66",
      "steam_asset_id": "18213300218",
      "time_created": "2020-04-10 18:26:16"
    },
    {
      "id": "7408370",
      "steam_market_hash_name": "PP-Bizon | Facility Sketch (Factory New)",
      "price": "0.07",
      "steam_asset_id": "17223303564",
      "time_created": "2020-04-10 18:26:12"
    },
    {
      "id": "7408283",
      "steam_market_hash_name": "Desert Eagle | Light Rail (Field-Tested)",
      "price": "1.29",
      "steam_asset_id": "17751160765",
      "time_created": "2020-04-10 18:24:18"
    },
  ],
  "status": "success"
}

This endpoint retrieves items by price range

Ordered by time created DESC

HTTP Request

POST https://shadowpay.com/api/v1/search_similar_items

POST Parameters

Parameter Required Description
token true Authorization token
price_from false Price from
price_to false Price to
project false (csgo/dota2) Default: csgo
limit false Default: 500.If not set will return all items on sale

My User Inventory

The above command returns JSON structured like this:

{
    "status": "success",
    "total": "2",
    "inv": [
      {
          "price": 0.56,
          "lowest_price": 0.56,
          "max_price": 16.8,
          "fee": 5,
          "steam_market_hash_name": "StatTrak™ MP9 | Deadly Poison (Well-Worn)",
          "assetid": "18720843311",
          "project": "csgo",
          "steam_itemtype": "SMG",
          "rarity": "Mil-Spec",
          "exterior": "Well-Worn",
          "is_stattrak": true,
          "tradable": true,
          "link": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198866551033A18720843311D17007496558533575350",
          "skip_reason": false
      },
      {
          "price": 0.52,
          "lowest_price": 0.52,
          "max_price": 15.6,
          "fee": 5,
          "steam_market_hash_name": "Galil AR | Rocket Pop (Field-Tested)",
          "assetid": "15913132055",
          "project": "csgo",
          "steam_itemtype": "Rifle",
          "rarity": "Mil-Spec",
          "exterior": "Field-Tested",
          "is_stattrak": false,
          "tradable": true,
          "link": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198866551033A15913132055D16907757831590787875",
          "skip_reason": false
      }
    ]
}

This endpoint returns inventory, only those items that you have not put up for sale

HTTP Request

POST https://shadowpay.com/api/v1/inventory

POST Parameters

Parameter Required Description
token true Authorization token
steamid true your sub seller steamid
game true csgo or dota2

Get operations history

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "1494",
      "state": "finished",
      "price": "0.45",
      "steam_trade_token": "NOuSHAho",
      "steam_trade_offer_state": "3",
      "steam_tradeofferid": "3966326233",
      "steam_to_steamid": "76561198008304019",
      "causer": null,
      "time_created": "2020-03-27 16:33:58",
      "custom_id": "marketplace_73_1585326835",
      "items": [
          {
              "state": "finished",
              "project": "csgo",
              "steam_market_hash_name": "Negev | Loudmouth (Field-Tested)",
              "steam_asset_id": "15778802746",
              "price": "0.45"
          }
      ]
    },
    {
      "id": "1487",
      "state": "cancelled",
      "price": "19.48",
      "steam_trade_token": "NOuSHAho",
      "steam_trade_offer_state": "6",
      "steam_tradeofferid": "3962034843",
      "steam_to_steamid": "76561198008304019",
      "causer": "seller",
      "time_created": "2020-03-24 16:05:33",
      "custom_id": "marketplace_73_1585065930",
      "items": [
          {
              "state": "cancelled",
              "project": "csgo",
              "steam_market_hash_name": "Negev | Loudmouth (Field-Tested)",
              "steam_asset_id": "15778802531",
              "price": "19.48"
          }
      ]
    }
  ],
  "status": "success"
}

This endpoint returns operation history.

HTTP Request

POST https://shadowpay.com/api/v1/operation_history

POST Parameters

Parameter Required Description
token true Authorization token

Sell items

The above command returns JSON structured like this:

{
    "created_bid_ids": [
        "296962",
        "296963"
    ],
    "status": "success"
}

This endpoint returns result of sell items operation(list of created items id). Your user must have enabled extension or application

HTTP Request

POST https://shadowpay.com/api/v1/sell_items

POST Parameters

Parameter Required Description
token true Authorization token
steamid true user steamid
offers[0][id] true item assetid
offers[0][project] true csgo or dota2
offers[0][price] true item price
offers[1][id] true item assetid
offers[1][project] true csgo or dota2
offers[1][price] true item price
offers[100][id] true max items count assetid
offers[100][project] true max items count csgo or dota2
offers[100][price] true max items coun price

Cancel items from sale

The above command returns JSON structured like this:

{
    "cancelled_items": [
        {
            "assetid": "15913132055",
            "project": "csgo",
            "state": "cancelled"
        },
        {
            "assetid": "18720843311",
            "project": "csgo",
            "state": "cancelled"
        }
    ],
    "not_cancelled_items": [],
    "status": "success"
}

This endpoint cancel items by id your sub seller account. Items in deals(with state = pending) will not cancel.

HTTP Request

POST https://shadowpay.com/api/v1/cancel_items

POST Parameters

Parameter Required Description
token true Authorization token
steamid true user steamid
items[0][id] true item id in our system
items[1][id] true item id in our system
items[2][id] true item id in our system
items[100][id] true max items count for cancel

Change item price

The above command returns JSON structured like this:

{
    "id": "296954",
    "new_price": 2,
    "price_rate": 2,
    "status": "success"
}

This endpoint change item price

HTTP Request

POST https://shadowpay.com/api/v1/change_item_price

POST Parameters

Parameter Required Description
token true Authorization token
steamid true user steamid
id true item id in our system
price true new item price
currency true USD/EUR/RUB/PLN

This endpoint return steam prices

Get steam prices

The above command returns JSON structured like this:

{
    "data": [
        {
            "steam_market_hash_name": "★ Bayonet | Marble Fade (Minimal Wear)",
            "price": 479.17
        },
        {
            "steam_market_hash_name": "Souvenir PP-Bizon | Night Ops (Battle-Scarred)",
            "price": 11.57
        }
    ]
}

HTTP Request

GET https://shadowpay.com/api/v1/get_steam_prices

GET Parameters

Parameter Required Description
token true Authorization token
project true csgo/dota2
limit false items limit per request
offset false items list offset

Get item by id

The above command returns JSON structured like this:

{
    "item": {
        "id": "000000",
        "steam_market_hash_name": "StatTrak™ PP-Bizon | High Roller (Battle-Scarred)",
        "price": 11.57,
        "project": "csgo",
        "floatvalue": "0",
        "paintindex": null,
        "paintseed": null,
        "time_created": "2020-01-10 19:07:38"
    },
    "is_seller_online": true,
    "status": "success"
}

HTTP Request

GET https://shadowpay.com/api/v1/get_item_by_id

GET Parameters

Parameter Required Description
token true Authorization token
id true id in Shadowpay system

Get items on sale

The above command returns JSON structured like this:

{
    "data": [
        {
            "id": "297310",
            "steam_market_hash_name": "MP9 | Ruby Poison Dart (Field-Tested)",
            "price": "18.30",
            "project": "csgo",
            "floatvalue": null,
            "paintindex": null,
            "paintseed": null,
            "time_created": "2020-09-10 12:08:16"
        },
        {
            "id": "297311",
            "steam_market_hash_name": "Nova | Ranger (Battle-Scarred)",
            "price": "4.80",
            "project": "csgo",
            "floatvalue": null,
            "paintindex": null,
            "paintseed": null,
            "time_created": "2020-09-10 12:11:02"
        }
    ]
}

HTTP Request

GET https://shadowpay.com/api/v1/get_items_on_sale

GET Parameters

Parameter Required Description
token true Authorization token
project false csgo/dota2 (default = csgo)
limit false items limit per request (default = 15000)
offset false items list offset (default = 0)

Generic Errors

The Shadowpay API uses the following error messages in general:

Error Code Meaning
internal_error Your request is invalid.
wrong_params Check your params or not found any suitable data
wrong_token Your API token is wrong or not set
wrong_method Check your params or not found any suitable api method
disabled Temporary disabled. Try later
no_access You have no access to request this endpoint
validation_error Data validation not passed. Check your params