2019-03-22 17:33:19

CHECK action

Payment pre-check 

Before the pay request (PAY action) it necessary to verify:

  • the applied service is available
  • there are enough funds to make a payment;
  • recipient exists in payment provider’s system.

So the action is sent as a pre-check payment request; the result of this action is an invoice id for the pay action.

Please note: Even if the CHECK action was successful (the response with all parameters was received), it doesn't mean that the PAY action will also be successful.

The CHECK action is only used to get the parameters required for the PAY action. Moreover, if the CHECK request is not followed by PAY reasonably soon, the system treats the invoice as obsolete and assigns to it the status 993 - INVOICE_LIFETIME_EXPIRED.

Request Parameters

Apart from basic parameters, request for payment pre-check requires the following tags in “params” node:






Transaction ID in the project’s system

NB: Transaction ID must be unique, otherwise request will result in error 25 - DUPLICATE_TXN

string (255)




 Payment provider ID in the GSG system

integer / string



Recipient ID in the payment provider’s system (for example, card number)

Several paysystems require some additional parameters of the CHECK action request. The parameters and specifications are listed in the params node of response to the commissions_action request.

integer / string




Payment amount

If the payment amount is not specified:

  • the response will contain conversion rates from the request currency to the Payment Service Provider currency;
  • in this action, it should be indicated in the PAY action request. 

If the payment amount is specified, the response will contain information about conversion.

integer / double (4)




Payment currency ID

If the payment currency is not specified in this action request, the System uses main account currency as payment currency.

Attention! Payment currency cannot be changed.
If check_action and pay_action send different currencies, then error 21 - BAD_CURRENCY will be returned.

string / integer
ISO 4217 number-3



Response Parameters

The GSG System response in XML format apart from the basic parameters contains the following nodes:





Invoice ID
It has to be specified in pay action request or pay_status action request


income currency="ХХХ"

Payment amount and currency

(amount) integer;

(currency) integer / string
ISO 4217 number-3

amount currency="ХХХ"

Payment amount in main account’s currency

outcome currency="ХХХ"

Payment amount in payment provider’s currency

rate income="ХХХ" outcome="ХХХ" total="ХХХ"

Conversion rates:

  • income — from payment request currency into main account’s currency;
  • outcome — from main account’s currency into payment provider’s currency;
  • total — from payment request currency into payment provider’s currency

decimal (11.4)  

delimiter — dot

Example request (XML)

<?xml version="1.0" encoding="UTF-8"?>

Example request (JSON)

  "request": {
    "action": "check",
    "project": "1234",
    "timestamp": "1360928308",
    "params": {
      "txn_id": "511e1e34d785b",
      "paysystem": "654321",
      "account": "",
      "amount": "12.34"
    "sign": "deb5627204b9e604d4582e80424f8ee6"

Example response (success) (XML)

<?xml version="1.0" encoding="UTF-8"?>
	<income currency="643">12.34</income>
	<amount currency="643">12.34</amount>
	<outcome currency="643">12.34</outcome>
	<rate income="1" outcome="1" total="1"></rate>

Example response (success) (JSON)

  "response":[ {

Example response (fail) (XML)

<?xml version="1.0" encoding="UTF-8"?>

Example response (fail) (JSON)

  "response": {
    "status": "19",
    "reference": "198",
    "timestamp": "1358259068"