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" and "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 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 trade, 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 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. IPN url for instant notifications should be saved 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.
amount false Amount in USD
order_id true Unique order id for identify payment
steam_trade_token false User's trade token
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

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

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

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

GET Parameters structure

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

Shadowpay CORE API - Buy and Sell P2P system

Get account balance

The above command returns JSON structured like this:

{
    "currency": "USD",
    "balance": "318.92",
    "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

My Inventory

The above command returns JSON structured like this:

{
    "status": "success"
}

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

HTTP Request

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

POST Parameters

Parameter Required Description
token true Authorization token

Get operations history

The above command returns JSON structured like this:

{
    "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

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"
                }
            ]
        },
        "402": {
            "state": "finished",
            "price": "0.20",
            "steam_trade_token": "96rhgftT",
            "steam_trade_offer_state": "3",
            "steam_tradeofferid": "123412341212",
            "steam_to_steamid": "76562222222222222",
            "steam_from_steamid": "76561111111111111",
            "causer": null,
            "time_created": "2019-09-04 23:34:21",
            "custom_id": "402",
            "items": [
                {
                    "state": "finished",
                    "project": "csgo",
                    "steam_market_hash_name": "StatTrak™ Nova | Ranger (Well-Worn)",
                    "steam_asset_id": "16489073918",
                    "price": "0.20"
                }
            ]
        }
    },
    "status": "success"
}

This endpoint retrieves trades by custom_id. Array keys are custom_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 items available to buy by Market Hash Name

HTTP Request

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

URL Parameters

Parameter Required Description
token true Authorization token
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 arrays and by descending sort.

HTTP Request

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

URL 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
from false Timestamp from, nearest to now.
to false Timestamp to, back date
{
  "data": {
    "Five-SeveN | Forest Night (Field-Tested)": [
      {
        "id": "2379429",
        "price": "0.03",
        "time_created": "2019-09-24 01:23:51"
      },
      {
        "id": "2374514",
        "price": "0.03",
        "time_created": "2019-09-23 20:02:04"
      },
      {
        "id": "2372405",
        "price": "0.03",
        "time_created": "2019-09-23 18:09:16"
      }
    ]
  },
  "status": "success"
}

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

URL 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

Sell item

The above command returns JSON structured like this:

{
    "status": "success"
}

This endpoint returns params for trade to sell item (send to counter party)

HTTP Request

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

POST Parameters

Parameter Required Description
token true Authorization token

Remove all from sale

The above command returns JSON structured like this:

{
    "status": "success"
}

This endpoint removes all sell items requests from your account

HTTP Request

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

POST Parameters

Parameter Required Description
token true Authorization token

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