Инструменты страницы
Request for refund in partial amount in monetary funds, shopping cart (refundOrder)
The request used for partial refund is refundOrder
in which the refunded cart items must be passed. On this request, the funds spent on the order will be returned to the payer.
The request will end with an error if the funds have not been debited for this order. Multiple refunds are available, but not exceeding the initial amount debited.
Use the following URL to connect to the Test Service (WSDL):
https://3dsec.sberbank.ru/payment/webservices/merchant-ws?wsdl.
For error-free processing of the request it is sufficient to pass the quantity
and positionId
parameters.
In a refund request, the cart is specified in the refundItems
block.
- In case of a full refund, passing the cart of items data is optional.
- When making a refund for an amount that differs from the amount that has been charged (except for passing the «0» value), the data about the cart of items must be mandatory passed.
- In case of making several refunds for orders with carts, all of those refunds must be performed using the algorithm for making a refund with the cart data passed.
- The refund amount (in money) in the cart must not exceed the confirmed amount of the original order (for
autoRefund
requests, the composite sums of money and points are compared). - Prices of all the items in the cart must be specified in the same currency (if the currency of items is to be specified) and must match the currency of the original order. For Sberbank «Spasibo» the order currency must be Russian rubles (643-RUB).
- Line items missing in the original order are forbidden for passing in the cart. A check is carried out whether given item in the refund cart is present in the original order. The
positionId
,name
, anditemCode
must match. If at least one value does not coincide, it is considered that the line item is missing from the original order. - The value of
quantity
elements in the completion request cart must not exceed the value of the same parameter in the registration order cart. - The
itemAmount
parameter value of theitems
block must not exceed the value of the same parameter in the original order. ForautoRefund
request the system compares the value ofitemAmount
initems
block with the amount of money and points for the same position in the original order. - All cart parameters are checked for compliance with the required format (length).
If at least one of the above conditions is not met, the order refund request is considered to be incorrectly generated and the payment gateway must refund an error.
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
Name | Type | Mandatory | Description | FFD version | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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. |
All versions. |
|||||||||
|
N..12 | Yes |
The refund amount in the order currency. The amount can be equal to or less than the order remaining amount. |
All versions. |
|||||||||
|
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. |
All versions. |
|||||||||
|
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
Enabling the functionality is possible upon agreement with the Bank during the integration period. To pass N parameters, a request must contain N
It is forbidden to pass reserved names in the parameter (if they are passed, the order may be rejected):
|
All versions. |
|||||||||
|
Not applicable | Yes |
Tag for transferring information about returned goods – item number in the request, name, details, unit of measure, quantity, currency, item code, discount, agent's benefit. |
All versions. |
|||||||||
|
Data block for transferring additional parameters of the OFD | Yes |
Some parameters of The transfer of this block is possible only when using the following OFDs:
|
refundItems
refundItems
contains the following elements.
A parameter included in a block and indicated as mandatory is only mandatory within that block. If the section is optional and missing, then the parameters included in it should not be passed.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
Not applicable | No |
An element of the array containing attributes of an item in the cart. The description of the attributes is given below. |
All versions. |
items
A parameter included in a block and indicated as mandatory is only mandatory within that block. If the section is optional and missing, then the parameters included in it should not be passed.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
ANS..12 | Yes |
Unique identifier of a line item within the order cart. The registered cart must contain an item with this positionId value, otherwise the order will fail. |
All versions. |
Name
TypeANS..100 DescriptionRESTName or the description of an item in any format.
Use REST Online LendingFor Online Lending functionality, it's necessary to specify a description of the line item in accordance with the Yandex.Market catalog, subject to the following requirements:
WSName or the description of an item in any format.
Use WS Online LendingFor online crediting functionality it's necessary to specify a description of the good item in accordance with the Yandex.Market. |
ANS..100 | Yes |
Name or the description of an item in any format.
Use |
All versions. |
|
Not applicable | No |
Additional block containing the parameters describing a line item. The description of the attributes is given below. The field size limit is 1024 bytes. |
All versions. |
|
N..18 | Yes |
Element describing the total of items of one |
All versions. |
|
N..12 | Yes |
The sum of the cost of all line items of one When calculating itemAmount = itemPrice*quantity parameter, the result is rounded up to the second digit after the decimal point. For example, if the calculation result is 100.255, then final value will be 100.26. |
All versions. |
|
N3 | No |
Currency code of a line item according to ISO 4217. If the parameter is not specified, it is considered to be equal to the order currency. |
All versions. |
|
ANS..100 | Yes |
Number (identifier) of a line item in the store system. |
All versions. |
|
N..18 | No |
An additional tag with attributes describing the tax. Nested tags are described below. |
All versions. |
|
N..18 | No |
The price of one line item of one
|
All versions. |
|
See description. | No |
Tag that serves to pass a set of attributes of the line item. Attributes must be specified as follows.
<attributes name="attribute_name_1">attribute_value_1</attributes> <attributes name="attribute_name_2">attribute_value_2</attributes> See description below. |
1.05 and later versions. |
itemAttributes
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
N..2 |
Yes |
Payment type. Possible values:
Values are passed in the following priority (indicated in descending order of priority):
For paymentMethod, the default value is 1 (full prepayment before the transfer of the payment item). |
1.05 and later versions. |
|
N..2 |
Yes |
Type of item being paid for. Possible values:
Values are passed in the following priority (indicated in descending order of priority):
The default value for paymentObject is 1 (item). |
1.05 and later versions. |
|
ANS | yes (if markQuantity is passed) |
Trade item code in text representation. Maximum length – 32 bytes. |
1.05 and later versions. |
|
| No |
Fractional quantity of the labeled item. |
1.2 and later versions. |
|
ANS..64 | No |
Value of user details. May be transferred only after approval by Federal Tax Service. |
1.05 and later versions. |
|
N..2 | Mandatory if agent_info object is passed. |
Agent type. The following values are available:
|
1.05 and later versions. |
|
|
No |
|
1.05 and later versions. |
|
|
No |
|
1.05 and later versions. |
|
Array ANS..19 | No |
Phone numbers array of the payments operator in +N format. |
1.05 and later versions. |
|
array ANS..19 | No |
An array of Money Transfer operator phone numbers in +N format. |
1.05 and later versions. |
|
ANS..64 | No |
Money Transfer operator name. |
1.05 and later versions. |
|
ANS..256 | No |
Money Transfer operator address. |
1.05 and later versions. |
|
N10..12 | No |
Money Transfer operator TIN. |
1.05 and later versions. |
|
Array ANS..19 | No |
An array of supplier phone numbers in +N format. |
1.05 and later versions. |
|
ANS..256 | No |
Supplier name. |
1.05 and later versions. |
|
N10..12 | No |
Supplier TIN. |
1.05 and later versions. |
quantity
quantity
contains the following elements.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
ANS..20 | Yes |
The unit of measurement for the quantity of line item instances. |
All versions. |
If the FFD is version 1.2 or later, then the following parameters are passed here:
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
N1 | Yes |
Quantity of line items in given |
1.2 and later versions. |
|
N..3 | Yes |
Unit of measurement for the quantity of the payment subject. In case of FFD version 1.2+, if the 'nomenclature' and 'markQuantity' parameters are passed, the value is always 0. In other cases, it can have some value. |
1.2 and later versions. |
Possible values of measure
Value | Description |
---|---|
0 | Used for payment subjects that can be sold individually or in units (as well as in the event that the payment subject is a product subject to mandatory labeling with an identification tool (which can be known from mark_code being passed)) |
10 | Gram |
11 | Kilogram |
12 | Ton |
20 | Centimeter |
21 | Decimeter |
22 | Meter |
30 | Square centimeter |
31 | Square decimeter |
32 | Square meter |
40 | Milliliter |
41 | Liter |
42 | Cubic meter |
50 | Kilowatt hour |
51 | Gigacalorie |
70 | Day (24h) |
71 | Hour |
72 | Minute |
73 | Second |
80 | Kilobyte |
81 | Megabyte |
82 | Gigabyte |
83 | Terabyte |
255 | Applicable when using other units of measurement |
markQuantity
Parameters of markQuantity tag:
A parameter included in a tag and indicated as mandatory is only mandatory within that tag. If the tag itself is not mandatory and is not passed, its included parameters should not be passed.
Name | Type | Mandatory | Description |
---|---|---|---|
|
N..12 | yes |
The numerator of the fractional part of the payment subject. |
|
N..12 | yes |
The denominator of the fractional part of the payment subject. |
itemDetails
'itemDetails contains the following elements.
A parameter included in a block and indicated as mandatory is only mandatory within that block. If the section is optional and missing, then the parameters included in it should not be passed.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
ANS..255 | Yes |
Parameter describing additional information regarding a line item. The description of the attributes is given below. |
All versions. |
==== itemDetailsParams ==== 'itemDetailsParams contains the following elements.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
Name
TypeAN..255 Type2ANS..255 DescriptionRESTName of the parameter describing the details of a line item WSName of the parameter describing the details of a line item |
AN..255 | Yes |
Name of the parameter describing the details of a line item |
All versions. |
tax
tax
contains the following elements.
A parameter included in a block and indicated as mandatory is only mandatory within that block. If the section is optional and missing, then the parameters included in it should not be passed.
Name | Type | Mandatory | Description | |
---|---|---|---|---|
|
N..2 | No |
VAT rate. The following values are available:
If the cart and fiscalization data are not included in the request, then the default values specified in the personal account are passed to the Fiscal Data Operator (see User Manual for personal account). |
All versions. |
|
N..18 | No |
Amount of the tax calculated by the merchant. The amount is specified in minimum currency units |
All versions. |
additionalOfdParams
additionalOfdParams
contains the following elements.
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
N..2 | Mandatory if agent_info object is passed. |
Agent type. The following values are available:
|
1.05 and later versions. |
|
|
No |
|
1.05 and later versions. |
|
|
No |
|
1.05 and later versions. |
|
Array ANS..19 | No |
Phone numbers array of the payments operator in +N format. |
1.05 and later versions. |
|
ANS..256 | No |
Money Transfer operator address. |
1.05 and later versions. |
|
N10..12 | No |
Money Transfer operator TIN. |
1.05 and later versions. |
|
ANS..64 | No |
Money Transfer operator name. |
1.05 and later versions. |
|
array ANS..19 | No |
An array of Money Transfer operator phone numbers in +N format. |
1.05 and later versions. |
|
Array ANS..19 | No |
An array of supplier phone numbers in +N format. |
1.05 and later versions. |
|
A..256 | No |
Full name of the cashier When requesting a refund, the value of this parameter may differ from that given during the registration of the order. |
1.05 and later versions. |
|
ANS..16 | No |
Additional check details. When requesting a refund, the value of this parameter may differ from that given during the registration of the order. |
1.05 and later versions. |
|
ANS..24 | No |
Name of the additional property of the user. When requesting a refund, the value of this parameter may differ from that given during the registration of the order. |
1.05 and later versions. |
|
ANS..24 | No |
The value of the additional user attribute. When requesting a refund, the value of this parameter may differ from that given during the registration of the order. |
1.05 and later versions. |
|
N..12 | No |
Cashier's INN |
1.2 and later versions. |
|
ANS..256 | No |
Customer address. |
1.2 and later versions. |
|
NS10 | No |
Customer birth date as dd.mm.yyyy |
1.2 and later versions. |
|
N3 | No |
Country numeric code of the county of Customer's citizenship. The country code is specified according to All-Russian World Countries Classifier (OKSM) |
1.2 and later versions. |
|
N2 | No |
Identification document type numeric code (for example, 21 stands for Russian Passport). |
1.2 and later versions. |
|
NS11 | No |
Series and number of the payer's passport: |
1.2 and later versions. |
|
ANS..64 | No |
Customer's email address. Exactly one of the two fields must be passed: |
1.2 and later versions. |
|
NS..19 | No |
Customer's phone number. Must be passed with the country code without spaces and additional characters (except for + character). For example, the number «+371 2 1234567» should be passed as «+37121234567»). Exactly one of the two fields must be passed: |
1.2 and later versions. |
|
N12 | No |
INN of the buyer. |
1.2 and later versions. |
|
ANS..256 | No |
Customer name. |
1.2 and later versions. |
|
|
No |
|
1.2 and later versions. |
|
|
No |
|
1.2 and later versions. |
|
|
No |
|
1.2 and later versions. |
|
|
No |
|
1.2 and later versions. |
|
NS10 | No |
Date of the legislative act of the federal body of executive power that sets forth the requirements for assigning the value of «sectoral attribute». Format: |
1.2 and later versions. |
|
ANS | No |
Identifier of federal body of executive power. Must be one of the values from directory of federal bodies of executive power |
1.2 and later versions. |
|
N..32 | No |
Number of the legislative act of the federal body of executive power that sets forth the requirements for assigning the value of «sectoral attribute». |
1.2 and later versions. |
|
ANS..256 | No |
A set of values defined by the legislative act of the federal body of executive power. |
1.2 and later versions. |
Response parameters
Name | Type | Mandatory | Description | FFD version |
---|---|---|---|---|
|
ANS..3 | No |
Error code. |
All versions. |
|
|
No |
|
All versions. |
Error codes
Value | Description | FFD version |
---|---|---|
0 | {{section>en:integration:api:errors:errors#common.no.error&noheader | |
5 | {{section>en:integration:api:errors:errors#common.access.denied&noheader | |
5 | {{section>en:integration:api:errors:errors#common.change.password&noheader | |
5 | {{section>en:integration:api:errors:errors#paymentOrder.mdOrder.empty&noheader | |
5 | {{section>en:integration:api:errors:errors#refundOrder.amount.invalid&noheader | |
6 | {{section>en:integration:api:errors:errors#common.orderId.unknown&noheader | |
7 | {{section>en:integration:api:errors:errors#refundOrder.state.wrong&noheader | |
7 | {{section>en:integration:api:errors:errors#refundOrder.amount.exceeding&noheader | |
7 | {{section>en:integration:api:errors:errors#common.system.error&noheader |
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="2caa983e-d7bb-7f3d-9338-8e410128092a" refundAmount="23500"> <refundItems> <!-- Zero or more repetitions: --> <items positionId="1"> <name>"SMALL"</name> <quantity measure="0">1</quantity> <itemCode>270_235.00</itemCode> <itemPrice>23500</itemPrice> <tax> <taxType>0</taxType> <taxSum>0</taxSum> </tax> <itemAttributes> <attributes name="nomenclature">010463003407001221CMK45BrhN0WLf</attributes> <attributes name="paymentMethod">1</attributes> <attributes name="paymentObject">30</attributes> <attributes name="agent_info.type">7</attributes> <attributes name="agent_info.paying.operation">testoperation</attributes> <attributes name="agent_info.paying.phones">+79123456789</attributes> <attributes name="agent_info.paymentsOperator.phones">+79123456789</attributes> <attributes name="agent_info.MTOperator.phones">+79123456789</attributes> <attributes name="agent_info.MTOperator.name">MT operator</attributes> <attributes name="agent_info.MTOperator.address">Moscow</attributes> <attributes name="agent_info.MTOperator.inn">8634330204</attributes> <attributes name="supplier_info.phones">+79123456789</attributes> <attributes name="supplier_info.name">Supplier</attributes> <attributes name="supplier_info.inn">287381373424</attributes> <attributes name="excise">10.0</attributes> <attributes name="country_code">810</attributes> <attributes name="declaration_number">12332234533</attributes> <attributes name="userData">user data</attributes> <attributes name="markQuantity.numerator">1</attributes> <attributes name="markQuantity.denominator">2</attributes> <attributes name="sectoralItemProps[0].federalId">001</attributes> <attributes name="sectoralItemProps[0].date">10.10.2021</attributes> <attributes name="sectoralItemProps[0].number">123/4567</attributes> <attributes name="sectoralItemProps[0].value">value1</attributes> <attributes name="sectoralItemProps[1].federalId">003</attributes> <attributes name="sectoralItemProps[1].date">10.10.2021</attributes> <attributes name="sectoralItemProps[1].number">321/4567</attributes> <attributes name="sectoralItemProps[1].value">value2</attributes> </itemAttributes> </items> </refundItems> </order> </mer:refundOrder> </soapenv:Body> </soapenv:Envelope>
Пример ответа
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:refundOrderResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return errorCode="0" errorMessage="Successful"/> </ns1:refundOrderResponse> </soap:Body> </soap:Envelope>