Direct Carrier Billing

Request for payment from a phone account


Example of a payment request


POST {{URL_SYSTEM}}/partner/{{Service_ID}}/pay

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"orderid": "123456789"
"goodphone": "1001"
"ctn": "79012345678"
"smstext": "1001 123456789 300.00"
"dt": "20240701123301"
"control": "36a02d89974fd0efa9d7bc8036d8983c"
"merchant_site": "https://123abc.org"

Note:
The control value is generated using the secret key = Qwerty123
The signature generation string is: 1234567891001790123456781001 123456789 300.0020240701123301Qwerty123


Examples of the System's response

Successful Response

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>98765</id>
    <result>0</result>
</response>

The operation was created in the System

Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>1</result>
    <descr>An operation with this orderid already exists!</descr>
</response> 

The operation already exists in the System



Payment confirmation request


Example of a request to confirm a payment using a one-time code

POST {{URL_SYSTEM}}/partner/{{Service_ID}}/pay_otp

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"id": "98765"
"otp": 123456
"control": "8ef7de429d44664cabeb766401849844"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 98765123456Qwerty123



Examples of system responses


Successful Response

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>98765</id>
    <result>0</result>
</response> 

Payment successfully confirmed


Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>1</result>
    <descr>Operation already processed</descr>
</response>

Operation already has a final status



One-time code resend request


Example of a request to resend a one-time code

POST {{URL_SYSTEM}}/partner/{{Service_ID}}/resend_otp

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"orderid": "123456789"
"control": " 33e5551598c3793b3673248f9c0376fa"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123



Examples of system responses


Successful Response

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>98765</id>
    <result>0</result>
</response>

The code is sent again


Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>1</result>
    <descr>Operation already processed</descr>
</response>

The operation already has a final status; the code cannot be sent


Payment cancellation request


Example of a request to cancel a payment


POST {{URL_SYSTEM}}/partner/{{Service_ID}}/pay_cancel

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"orderid": "123456789"
"control": "33e5551598c3793b3673248f9c0376fa"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123



Examples of system responses

Successful Response

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>98765</id>
    <result>0</result>
</response>

Operation canceled in the system

Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>1</result>
    <descr>Operation already processed</descr>
</response>

Operation already has a final status and cannot be canceled


Payment notification request example


Example of a payment notification

POST {{URL_PARTNER_SYSTEM}}

HEADER
Content-Type: application/x-www-form-urlencoded;charset=UTF-8

PARAMS

"id": "98765"
"phone": "79012345678"
"result": 0
"cmd": "status"
"control": " e1e23640e789ceba6ca930a97272438a"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123


Example of a partner’s response

<response>
    <result>0</result>
    <description>success</description>
</response>


Payment status request


Example of a request to receive current payment status

POST {{URL_SYSTEM}}/partner/{{Service_ID}}/check_pay

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"orderid": "123456789"
"dt": "2024070131502"
"control": "9b0064f0daad778e2f0891116148abb9"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123



Examples of system responses

Successful Responses

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>0</result>
    <error>0</error>
    <descr></descr>
    <sum>300.01</sum>
    <id>98765</id>
</response>

Operation is successful in the system

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>0</result>
    <error>0</error>
    <descr></descr>
    <sum>300.01</sum>
    <id>98765</id>
    <refund_details>
        <refund>
            <result>0</result>
            <sum>300.00</sum>
            <error>4</error>
            <descr></descr>
            <id>123</id>
        </refund>
    </refund_details>
</response>

Operation was successfully returned in the System


Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <result>0</result>
    <error>2</error>
    <descr> There are not enough funds in the balance to make the payment.</descr>
    <sum>4000.00</sum>
    <id>987654</id>
</response>

Payment unsuccessful



Payment registry request


Example of a request for a registry of operations for the specified time period

GET {{URL_SYSTEM}}/reestr/{{csv,json,xml}}

HEADER
Content-Type: application/x-www-form-urlencoded

PARAMS

"service_id": "1001"
"dt_start": "01.07.2024 00:00"
"dt_end": "01.07.2024 23:59"
"hash": "bcf81715f87eeb13c8d880198fd4534c"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123



Examples of system responses


System response example in CSV

id;pid;status;smstext;phone;goodphone;created;changed;amount;partner_notified;partnerName;partnerFee
"98765";"123456789";"PAY_OK";"1001 123456789 300.00";"79012345678";"1001";"2024-07-01 12:33:01";"2024-07-01 12:33:35";"300,00";"true";"TESTPARTNER";"null"
"98766";"1234567890";"PAY_FAIL";"1001 1234567890 30000.00";"79012345678";"1001";"2024-07-01 12:35:12";"2024-07-01 12:35:45";"30000,00";"true";"TESTPARTNER";"null"

System response example in XML

<?xml version="1.0" encoding="UTF-8"?>
<operations>
    <operation>
        <id>98765</id>
        <pid>123456789</pid>
        <status>PAY_OK</status>
        <smstext>1001 123456789 300.00</smstext>
        <phone>79012345678</phone>
        <goodphone>1001</goodphone>
        <created>2024-07-01 12:33:01</created>
        <changed>2024-07-01 12:33:35</changed>
        <amount>300,00</amount>
        <partner_notified>true</partner_notified>
        <partnerName>TESTPARTNER</partnerName>
        <partnerFee></partnerFee>
    </operation>
    <operation>
        <id>98766</id>
        <pid>1234567890</pid>
        <status>PAY_FAIL</status>
        <smstext>1001 1234567890 30000.00</smstext>
        <phone>79012345678</phone>
        <goodphone>1001</goodphone>
        <created>2024-07-01 12:35:12</created>
        <changed>2024-07-01 12:35:45</changed>
        <amount>30000,00</amount>
        <partner_notified>true</partner_notified>
        <partnerName>TESTPARTNER</partnerName>
        <partnerFee></partnerFee>
    </operation>
</operations>

System response example in JSON

[
    {
        "id": "98765",
        "pid": "123456789",
        "status": "PAY_OK",
        "smstext": "1001 123456789 300.00",
        "phone": "79012345678",
        "goodphone": "1001",
        "created": "2024-07-01 12:33:01",
        "changed": "2024-07-01 12:33:35",
        "amount": "300,00",
        "partner_notified": "true",
        "partnerName": "TESTPARTNER",
        "partnerFee": "null"
    },
    {
        "id": "98766",
        "pid": "1234567890",
        "status": "PAY_FAIL",
        "smstext": "1001 1234567890 30000.00",
        "phone": "79012345678",
        "goodphone": "1001",
        "created": "2024-07-01 12:35:12",
        "changed": "2024-07-01 12:35:45",
        "amount": "30000,00",
        "partner_notified": "true",
        "partnerName": "TESTPARTNER",
        "partnerFee": "null"
    }
]


Refund request


Sample request to refund a previously made payment


POST {{URL_SYSTEM}}/partner/{{Service_ID}}/make_refund

HEADER
Content-Type: application/x-www-form-urlencoded

BODY

"orderid": "123456789"
"amount": 300.00
"dt": "2024070133502"
"control": "5cdbda8398b7974c7f458db0cca79bbb"

Note:
Where the control value is generated using secret_key = Qwerty123
Signature generation string: 123456789Qwerty123



Examples of system responses


Successful Response

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>123</id>
    <result>0</result>
    <orderid>123456789</orderid>
</response>

The return was successfully completed


Response with an Error Message

<?xml version='1.0' encoding='UTF-8'?>
<response>
    <id>12345</id>
    <result>1</result>
    <orderid>123456789</orderid>
    <descr>{{some_error_message}}</descr>
</response>

Return failed, unsuccessful