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

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 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/inventory

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

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