Skip to content

Market!

Market

Authentication

INFO

For authentication, you need provide apikey of your project in headers example:

js
axios.get(
    'https://api.sih.market/api/v1/project',
    {
        headers: {
            apikey: YOUR_API_KEY
        }
    }
)

Project

Get Project Information

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/project

INFO

Default Response 200:

json
{
    "success": true,
    "project": {
        "id": 1,
        "name": "test project",
        "balance": 100.51,
        "webhook": "https://test.sih.app/callback"
    }
}

INFO

Default Response 400:

json
{
    "success": false,
    "error": "string"
}

Set Webhook

INFO

Webhook url. If url not provided, webhook will be removed *Authentication Required

http
GET https://api.sih.market/api/v1/set-webhook

INFO

query params:

http
url - https://test.sih.app/callback

INFO

Default Response 200:

json
{
  "success": true
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Item

Get items list

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/get-items

INFO

query params:

http
minified - true/false
extended - true/false
appId - 730 / 440 / 252490

INFO

Default Response 200:

json
{
  "success": true,
  "items": {
    "Sealed Graffiti | Tombstone (Monarch Blue)": {
      "price": 1.011,
      "count": 10,
      "phase": "Phase 1",
      "market": "Test Market",
      "sell": 1.01,
      "steam": 1.01,
      "image": "-9a81dlW...",
      "color": "ffffff"
    },
    "Souvenir UMP-45 | Scorched (Field-Tested)": {
      "price": 1.01,
      "count": 10,
      "phase": "Phase 1",
      "market": "Test Market",
      "sell": 1.01,
      "steam": 1.01,
      "image": "-9a81dlW...",
      "color": "ffffff"
    },
    "StatTrak™ FAMAS | Macabre (Factory New)": {
      "price": 1.01,
      "count": 10,
      "phase": "Phase 1",
      "market": "Test Market",
      "sell": 1.01,
      "steam": 1.01,
      "image": "-9a81dlW...",
      "color": "ffffff"
    }
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Get min item price

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/get-min-item

INFO

query params:

http
item - M4A4 | Asiimov (Well-Worn)
minified - true/false
appId - 730 / 440 / 252490

INFO

Default Response 200:

json
{
  "success": true,
  "items": {
    "M4A4 | Asiimov (Well-Worn)": {
      "price": 93.14,
      "count": 1
    }
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Purchases

Create order

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/create-order

INFO

description:

text
the "test" parameter in body is used to simulate a purchase
funds will not be debited from your balance

INFO

body:

json
{
  "steamId": "76561198000000000",
  "token": "SSH18JS",
  "amount": 1.01,
  "item": "AK-47 | Case Hardened (Field-Tested)",
  "customId": "123",
  "test": false,
  "appId": 730
}

INFO

Default Response 200:

json
{
  "success": true,
  "id": 1,
  "balance": 1.01
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "invalid tradelink | private inventory | steam guard is not enabled | steam trade ban | steam guard is in hold | unknown error"
}

INFO

Default Response 409:

json
{
  "success": false,
  "error": "custom id already exists",
  "order": {
    "id": 1,
    "customId": "customId",
    "steamId": "76561198000000000",
    "item": "AK-47 | Case Hardened (Field-Tested)",
    "amount": 1,
    "status": "created | processing | sent | finished | failed | penalized",
    "error": "string",
    "sender": {
      "offerId": 1,
      "timeout": 1566796475,
      "nickname": "name",
      "avatar": "https://avatars.akamai.steamstatic.com/975652750497a790ab91b828c1749943b6f6fc8e_medium.jpg"
    },
    "created": 1610000000,
    "updated": 1610000000
  }
}

Get Order Information

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/get-order

INFO

query params:

http
id - 1
customId - "123"

INFO

Default Response 200:

json
{
  "success": true,
  "order": {
    "id": 1,
    "customId": "customId",
    "steamId": "76561198000000000",
    "item": "AK-47 | Case Hardened (Field-Tested)",
    "amount": 1,
    "expectedAmount": 0.99,
    "status": "created | processing | sent | finished | failed | penalized",
    "error": "string",
    "sender": {
      "offerId": 1,
      "timeout": 1566796475,
      "nickname": "name",
      "avatar": "https://avatars.akamai.steamstatic.com/975652750497a790ab91b828c1749943b6f6fc8e_medium.jpg"
    },
    "created": 1610000000,
    "updated": 1610000000
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Get Orders History

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/get-order-history

INFO

query params:

http
limit - 100
offset - 0

INFO

Default Response 200:

json
{
  "success": true,
  "orders": [
    {
      "id": 1,
      "customId": "customId",
      "steamId": "76561198000000000",
      "item": "AK-47 | Case Hardened (Field-Tested)",
      "amount": 1,
      "expectedAmount": 0.99,
      "status": "created | processing | sent | finished | failed | penalized",
      "error": "string",
      "sender": {
        "offerId": 1,
        "timeout": 1566796475,
        "nickname": "name",
        "avatar": "https://avatars.akamai.steamstatic.com/975652750497a790ab91b828c1749943b6f6fc8e_medium.jpg"
      },
      "created": 1610000000,
      "updated": 1610000000
    }
  ],
  "pagination": {
    "limit": 100,
    "offset": 0,
    "count": 1000
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Get Orders information

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/get-orders

INFO

body:

json
{
  "ids": [
    0
  ],
  "customIds": [
    "string"
  ]
}

INFO

Default Response 200:

json
{
  "success": true,
  "orders": [
    {
      "id": 1,
      "customId": "customId",
      "steamId": "76561198000000000",
      "item": "AK-47 | Case Hardened (Field-Tested)",
      "amount": 1,
      "expectedAmount": 0.99,
      "status": "created | processing | sent | finished | failed | penalized",
      "error": "string",
      "sender": {
        "offerId": 1,
        "timeout": 1566796475,
        "nickname": "name",
        "avatar": "https://avatars.akamai.steamstatic.com/975652750497a790ab91b828c1749943b6f6fc8e_medium.jpg"
      },
      "created": 1610000000,
      "updated": 1610000000
    }
  ]
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Statuses

INFO

List:

ValueDescription
createdpurchase created and awaits item search
processingitem was found, waiting for seller to send trade offer
sentitem was sent by seller
finishedbuyer has accepted this offer
failedpurchase failed, check error message in order's details
penalizedpurchase failed with penalty, check error message in order's details

INFO

Note:

textmate
system can change order's status from sent to processing, there is feature allowing to buy an item again if trade wasnt successful because of sender's fail

Wallet

Get history

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/wallet/history

INFO

search params:
walletTypeId=1
typeIds=1,3,4
limit=100
offset=0

INFO

Wallet type ids:

ValueDescription
1Main default wallet
2Deposit wallet

INFO

Transaction Type Ids:

ValueDescription
1purchase
2purchase refund
3transfer between sih.app balance
4deposit item
5purchase finished refund, fair price system
6manual refund

INFO

Default Response 200:

json
{
  "success": true,
  "data": [
    {
      "id": "527ee278-49e3-4138-b941-f32cc141f03a",
      "amount": -0.1,
      "typeId": 1,
      "data": {
        "orderId": 1
      },
      "created": 1721210563387
    }
  ],
  "pagination": {
    "limit": 100,
    "offset": 0,
    "count": 100
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "unknown error"
}

Deposit

Description

In our system there are 2 variations to integrate your service p2p and polling Below you can see how they work:

P2P Integration

If you choose P2P, all transactions will go through our p2p system, to sell items, the seller must have the SIH extension installed and have permission for your project to trade.

Deposit!

Polling Integration

When polling is selected, the item shipping status is taken from your system. To connect you need to implement 2 REST API methods to buy an item and check the status. Deposit! We accept the following statuses from your system:

ValueDescription
createdpurchase created and awaits item search
sentitem was sent by seller
finishedbuyer has accepted this offer
failedpurchase failed, check error message in order's details

We accept the following reasons and errors from your system:

ValueDescription
canceled by buyertrade offer was rejected by the buyer
canceled by sellertrade offer was rejected by the seller
send timeouttime to send a trade offer has expired
bad priceminimum price is higher
invalid tradelinkinvalid recipient trade link

Example of a simple rest api seller:

INFO

INFO

js
const express = require('express')
const bodyParser = require('body-parser')
const crypto = require('node:crypto')

const app = express()

app.use(bodyParser.json())

function createSignature(data, apiKey) {
  return crypto
    .createHmac('sha1', apiKey)
    .update(JSON.stringify(data))
    .digest('hex')
}

const depositApiKey = 'YOUR_DEPOSIT_API_KEY'

app.post('/purchase', function (req, res) {
  const { signature } = req.headers

  // query security check
  if (signature !== createSignature(req.body, depositApiKey)) {
    return res.send({
      success: false,
      error: 'invalid signature'
    })
  }

  // your processing

  // for example, if price invalid:
  res.send({
    success: false,
    error: 'bad price'
  })
})


app.get('/status', function (req, res) {
  const { customId } = req.query
  const { signature } = req.headers

  // cquery security check
  if (signature !== createSignature({ customId }, depositApiKey)) {
    return res.send({
      success: false,
      error: 'invalid signature'
    })
  }


  // your processing


  // for example, if purchase not found:

  return res.send({
    success: false,
    error: 'not found'
  })
})

app.listen(3000)

INFO

Add user

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/project/user

INFO

INFO

body:

json
{
  "steamId": "76561198000000000",
  "tradeToken": "SSH18JS"
}

INFO

Default Response 200:

json
{
  "success": true,
  "data": {
    "steamId": "string",
    "canTrade": {
      "success": "boolean",
      "error": "string"
    },
    "canP2P": {
      "success": "boolean",
      "error": "string"
    }
  }
}

INFO

Default Response 400:

json
{
  "success": true,
  "data": {
    "steamId": "string",
    "canTrade": {
      "success": "boolean",
      "error": "string"
    },
    "canP2P": {
      "success": "boolean",
      "error": "string"
    }
  }
}

Get user info

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/project/user/${steamId}

INFO

Default Response 200:

json
{
  "success": true,
  "data": {
    "steamId": "string",
    "canTrade": {
      "success": "boolean",
      "error": "string"
    },
    "canP2P": {
      "success": "boolean",
      "error": "string"
    }
  }
}

Get users list

INFO

*Authentication Required

http
GET https://api.sih.market/api/v1/project/users

INFO

Default Response 200:

json
{
  "success": true,
  "data": [{
    "steamId": "string",
    "canTrade": {
      "success": "boolean",
      "error": "string"
    },
    "canP2P": {
      "success": "boolean",
      "error": "string"
    }
  }]
}

Set User Online

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/project/user/${steamId}/online/${online}

INFO

Default Response 200:

json
{
  "success": true,
  "data": {
    "online": "boolean"
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Set Users Online

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/project/users/online/${online}

INFO

INFO

body:

json
{
  "steamIds": [
    "76561198000000000",
    "76561198000000001"
  ]
}

INFO

Default Response 200:

json
{
  "success": true,
  "data": {
    "online": true
  }
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}

Deposit user items

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/project/deposit

INFO

INFO

body:

items['id'] - asset id of user item items['price'] - price for user item

json
{
  "steamId": "string",
  "appId": 0,
  "items": [
    {
      "id": "123", 
      "price": 0,
      "customId": "string",
      "amount": 1
    }
  ]
}

INFO

Default Response 200:

json
{
  "success": true,
  "errors": [
    "string"
  ],
  "data": [
    {
      "id": "string",
      "item": "string",
      "price": 0,
      "assetid": "string",
      "amount": 1,
      "float": 0,
      "phase": "string",
      "stickers": [
        "string"
      ]
    }
  ]
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string",
  "data": {
    "steamId": "string",
    "canTrade": {
      "success": true,
      "error": "string"
    },
    "canP2P": {
      "success": true,
      "error": "string"
    }
  }
}

Delete deposit user items

INFO

*Authentication Required

http
POST https://api.sih.market/api/v1/project/delete-deposit

INFO

INFO

body:

json
{
  "ids": [
    "string"
  ],
  "customIds": [
    "string"
  ]
}

INFO

Default Response 200:

json
{
  "success": true,
  "data": [
    "string"
  ]
}

INFO

Default Response 400:

json
{
  "success": false,
  "error": "string"
}