Инструменты страницы



Request for refund in full amount, monetary funds (refundOrder)

The request used for making a refund is refundOrder.

Use the following URL to connect to the Test Service (WSDL):
https://3dsec.sberbank.ru/payment/webservices/merchant-ws?wsdl.

Orders that initiate recurring payments cannot be reversed and refunded, as in these cases there is no real debiting.


Upon this request, the funds for the specified order are to be returned to the payer. The request will end with an error if the funds have not been debited for this order.

To process a refund operation, it is necessary to have the corresponding permissions in the system.

In this document, the following data type conventions are used when describing request and response parameters:

  • A<n> – a sequence of Latin letters of length <n>;
  • A..<n> – a sequence of Latin letters with a length not exceeding <n>;
  • N<n> – a sequence of digits of length <n>;
  • N..<n> – a sequence of digits with a length not exceeding <n>;
  • AN<n> – a sequence of Latin letters and numbers of fixed length <n>;
  • AN.. <n> – a sequence of Latin letters and numbers with a length not exceeding <n>;
  • ANS<n> – a sequence of Latin letters, numbers and characters of fixed length <n>
  • ANS.. <n> – a sequence of Latin letters, numbers and characters with a length not exceeding <n>;
  • UTC – date and time, in this case: the date must be passed without specifying the time zone, Moscow time, for the SOAP protocol, the standard encoding xs: dateTime is used.

Request parameters

The request parameters are given in table below.

Name Type Mandatory Description

orderId

ANS36

Yes

Identifier of the order in the payment system. It is unique within the system. The identifier is missing if the order registration failed due to an error detailed in errorCode.

refundAmount

N..12

Yes

The refund amount in the order currency. The amount can be equal to or less than the order remaining amount.

language

A2

No

Language in the ISO 639-1 encoding. If the language is not specified, the default language defined in the store settings is used.

params

See column with the description.

No

Additional tag with the attributes for passing additional parameters. The fields for additional information and its subsequent storage. These fields can be submitted for processing by the bank for further display in the registers. By default, the order number orderNumber and its description orderDescription are passed to the bank for processing (no more than 99 characters, «%» (percentage), «+» (plus),  «\r» (carriage return) and «\n» (line feed) are prohibited for using).

Enabling the functionality is possible upon agreement with the Bank during the integration period. To pass N parameters, a request must contain N params tags, where the name attribute contains the parameter name and value attribute contains its value:

Name Type Description
Name

name

Type

AN..20

Type2

ANS..255

Type3

A7

Type4

ANS..100

Description
REST

Name of the additional parameter.

REST Online Lending

The attribute name, always takes the value of mdOrder.

WS

Name of the additional parameter.

Spasibo

Name or the description of an item in any format.

Spasibo2

Name of the parameter describing the details of a line item

ANS..255

Name of the additional parameter.

value

AN..1024

The value of the additional parameter is up to 1024 characters.

It is forbidden to pass reserved names in the parameter (if they are passed, the order may be rejected):

  • sbrf_spasibo:amount_bonus
  • sbrf_sbermiles:amount_bonus
  • loyaltyId

Response parameters

The response parameters are given in table below.

Name Type Mandatory Description

errorCode

ANS..3

No

Error code.

errorMessage

AN..512

No

Error description in the language passed in the language parameter in the request.

Error codes

Error code Error text
0

The request has been processed without system errors.

5

Access denied.

5

The user must change the password.

5

[orderId] is empty.

5

Incorrect amount.

6

Wrong order number.

7

Payment must be in the correct state.

7

The refund amount exceeds the debited amount.

7

System error.

Examples

Request example

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://engine.paymentgate.ru/webservices/merchant">
    <soapenv:Header/>
    <soapenv:Body>
       <mer:refundOrder>
          <order language="ru" orderId="4302d369-a5e8-4432-a5e5-42acfab52c86" refundAmount="20000">
             <!-- Zero or more repetitions: -->
             <params name=" " value=" "/>
          </order>
       </mer:refundOrder>
    </soapenv:Body>
 </soapenv:Envelope>

Response example

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <ns1:refundOrderResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant">
          <return errorCode="7" errorMessage="The refund amount exceeds the debiting amount"/>
       </ns1:refundOrderResponse>
    </soap:Body>
 </soap:Envelope>