Skip to main content

Steam wallet topup service

Below is information on how to top up a Steam wallet, i.e. add funds to a Steam account.

To learn in which countries the service is available, please contact your manager.

How to top up a wallet

Precondition

When sending a request to top up a wallet, specify an amount in RUB, after which an equivalent amount in USD will be added to the wallet.

To understand the exchange rate, regularly (for example, once an hour) send a (GET/exchange_rate) request.

This request returns an exchange rate of RUB to USD (the exchange rate is updated once an hour).

The exchange rate may vary at the moment of the actual transaction, so the USD amount added to the account might be more or less than the preestimated value.
For Russian Steam accounts this amount will be automatically converted to RUB by the exchange rate of the Steam platform.

Request example
curl -X GET \
https://demo.smart-glocal.com/api/v1/exchange_rate \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
}'
Response example
{
"rate": {
"source_currency": "RUB",
"destination_currency": "USD",
"rate": 0.01,
"active_from": "2024-10-27T02:03:00.000000Z",
"active_to": "2024-10-27T03:03:00.000000Z"
}
}

Step 1. Create a session (POST/session/create)

Request example
curl -X POST \
https://demo.smart-glocal.com/api/v1/session/create \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_method": {
"type": "wallet",
"wallet": {
"type": "steam",
"steam": {
"account": "nickname"
}
}
},
"amount_details": {
"amount": 123000,
"currency": "RUB"
}
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z"
}
}

Step 2. Start the wallet topup transaction (POST/session/start/payout)

Request example
curl -X POST \
https://demo.smart-glocal.com/api/v1/session/start/payout \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"payments": [
{
"id": "po_1313",
"status": "succeeded",
"created_at": "2024-05-27T02:03:00.000000Z",
"payment_method": {
"type": "wallet",
"wallet": {
"type": "steam",
"steam": {
"account": "nickname"
}
}
},
"amount_details": {
"amount": "123000",
"currency": "RUB"
}
}
]
}
}

Step 3. Wait for a webhook with the results (payment_finished)

Webhook example
{
"type": "payment_finished",
"session": {
"id": "ps_3230",
"status": "accepted",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z"
}
}

Refunds

If after a successful transaction the money is not added to the appropriate account, please contact your manager. We will refund the amount to your wallet.

How to use the API

All the data in requests to Smart Glocal and notifications from Smart Glocal is transmitted using the HTTP POST method. Message parameters are packed into a JSON object.

Server address

  • For testing: https://demo.smart-glocal.com
  • For live transactions: https://proxy.smart-glocal.com

Authentication

In the headers of your requests to Smart Glocal, always pass the following data for authentication:

  • your project identifier
  • request signature
NameMandatoryTypeDescription
X-PARTNER-PROJECT+stringProject identifier (from your Smart Glocal manager)
X-PARTNER-SIGN+stringRequest signature
X-PARTNER-SUBMERCHANT-stringPayer's identifier (for legal entities)

Request example with authentication

curl -X POST \
https://demo.smart-glocal.com/api/v1/session/create \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
// request body
}'

Request signature

The signature is needed to verify the authenticity and integrity of requests. Smart Glocal verifies that the requests received are in fact from you (and are complete); you verify Smart Glocal's notifications the same way.

To create and verify a signature, you will need a secret key and a public key. Using your public key Smart Glocal will verify signatures of your incoming payments.

Generating a key pair

You need to generate a pair of keys on your side using the RSA signature algorithm.

Creating request body signature

The signature must be transmitted together with the request to Smart Glocal. You need to sign the request body as a whole in the form in which it is sent to Smart Glocal's server (after serializing the request body into JSON to send it over HTTP).

Use your secret key for signing the request. Create a signature using the SHA-256 algorithm. The resulting signature must then be transmitted in the Base64 format.

Verifying incoming requests from Smart Glocal

All outgoing requests from Smart Glocal are signed using Smart Glocal's own secret key.

Using Smart Glocal's public key, you need to verify the signatures of the requests coming from Smart Glocal on your side. The algorithm used is SHA-256. The signature is transmitted in the Base64 format.

Smart Glocal's public keys
Signature generation and validation examples
# Generating a private key
$ openssl genrsa -out private.pem 2048

# Generating a public key based on the private key
$ openssl rsa -in private.pem -pubout > public.pem

# Creating myfile.txt file contents
$ echo test > myfile.txt

# Generating a signature
$ openssl dgst -sha256 -sign private.pem -out sha256.sign myfile.txt

# Signature ready for transfer
$ base64 sha256.sign

# Checking the signature
$ openssl dgst -sha256 -verify public.pem -signature sha256.sign myfile.txt
Verified OK

Sessions and transactions

Session

All transactions are carried out within a session.

A session can have the following statuses:

  • created — the session has been created and is waiting to be started or canceled
  • in_progress — the transaction is in progress
  • accepted — the transaction has been completed successfully
  • cancelled — the transaction has been canceled
  • error — an unexpected error occurred while processing

    Attention! This status is not final. Please contact Smart Glocal's support team and wait for a final transaction status.

Payout statuses

A payout can have the following statuses:

  • in_progress — the payout is being processed
  • pending — awaiting your confirmation (session/confirm) or cancelation (session/cancel)
  • succeeded — the payout has been completed successfully
  • failed — the payout has failed

Methods

GET/exchange_rate

Request parameters

None

Response parameters

NameMandatoryTypeDescription
rate+objectRate details
  source_currency+stringSource currency code
  destination_currency+stringTarget currency code
  rate+stringExchange rate
  active_from+stringStart of the period during which the rate is applicable
  active_to+stringEnd of the period during which the rate is applicable
error-objectError details
  code+stringError code
  description+stringError description

POST/session/create

Request parameters

NameMandatoryTypeDescription
payment_method+objectPayout method details
  type+stringPayout method type. Always: wallet
  wallet+objectWallet details
    type+stringWallet type. Always: steam
    steam+objectSteam account details
      account+stringNickname (up to 20 characters). Make sure the nickname is correct, otherwise, the payout will fail
amount_details+objectAmount details
  amount+stringAmount (min. 500RUB, max. 95000RUB). Specify the amount in minor currency units: 50000 for 500RUB
  currency+stringCurrency

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session+objectSession details
  id+stringSession ID
  status+stringSession status
  created_at+stringCreation date in ISO 8601 format
  updated_at+stringUpdate date in ISO 8601 format
error-objectError details
  code+stringError code
  description+stringError description

POST/session/start/payout

Request parameters

NameMandatoryTypeDescription
session_id+stringSession ID

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session+objectSession details
  id+stringSession ID
  status+stringSession status
  created_at+stringCreation date in ISO 8601 format
  updated_at+stringUpdate date in ISO 8601 format
  payments+objectPayout details
    id+stringSession ID
    status+stringPayout status
    created_at+stringCreation date in ISO 8601 format
    payment_method+objectPayout method details
      type+stringPayout method type. Always: wallet
      wallet+objectWallet details
        type+stringWallet type. Always: steam
        steam+objectSteam account details
          account+stringNickname. Make sure the nickname is correct, otherwise, the payout will fail
    amount_details+objectAmount details
      amount+stringAmount
      currency+stringCurrency
error-objectError details
  code+stringError code
  description+stringError description

Webhooks

payment_finished

Webhook parameters

NameMandatoryTypeDescription
type+stringWebhook type: payment_finished
session+objectSession details
  id+stringSession ID
  status+stringSession status
  created_at+stringCreation date in ISO 8601 format
  updated_at+stringUpdate date in ISO 8601 format

Errors

During payouts you may encounter the following errors:

  • rate_error — Unable to get the exchange rate
  • account_not_found — Unable to top up the specified account
  • Other errors

Sequence diagram

steamDiagram