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



Request for payment refund (refund)

The request used for making a refund is refund.do.

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. The system permits returning funds more than once, but for a total amount not exceeding the initial debit amount.

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

userName

AN..30

Yes

Login of the service account of the merchant.

password

AN..30

Yes

Merchant's service account password.

amount

N..12

No

Partial reversal amount. Parameter required for partial reversal.

orderId

ANS36

Yes

Identifier of the order in the payment system. It is unique within the system. Missing if order registration failed due to an error detailed in ErrorCode.

jsonParams

String

No

Additional parameters of the request. Format: {«Name1»: «Value1», «Name2»: «Value2»}.

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

If amount=0 is specified in the request, the refund is made for the entire amount of the order.

Response parameters

The response parameters are given in table below.

Name Type Mandatory Description

errorCode

ANS..3

No

Error code. Can be missing if the result has not caused an error.

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.

5 Incorrect value of a request parameter
5 Incorrect format of refundItems parameter
5 [refundItems.item.quantity] exceeds the permissible value
5 [refundItems.item.itemAmount] exceeded
5 Unsuccessful
6

Wrong order number.

7

Payment must be in the correct state.

7

The refund amount exceeds the debited amount.

7

System error.

7 The expected order amount does not match the current amount
7 Incorrect amount
7 Transaction is being processed now. Please try again later
7 System error
7 The chargeback flag is set for this payment
7 To carry out a refund for an unspecified item, [positionId] must be present in the order cart
7 To carry out a refund of a specific amount, [positionId] must not be present in the order cart
7 Regular refunds and refunds for unspecified item cannot be carried out after a refund of a specific amount.
7 Refunds of a specific amount and for an unspecified item cannot be carried out for orders paid for with loyalty points.
7 Regular refund declined. There has been a refund for an unspecified item carried out for one or more cart items.
7 The positionId parameter is required in refunds of a specific amount and for an unspecified item
7 Regular refunds and refunds for an unspecified item are not available after a refund for an unspecified item. You are trying to carry out a regular refund.
7 Regular refunds and refunds for an unspecified item are not available after a refund for an unspecified item. You are trying to carry out a refund for an unspecified item.
7 Refunds for a specific amount and for an unspecified item are not available for orders without a cart.
7 This type of payment does not support refunds
8 Failed to refund loyalty points
8 [customerDetails] parameter fields are not filled
8 [customerDetails.email] wrong format
8 [customerDetails.phone] wrong format
8 [customerDetails.contact] wrong format
8 [customerDetails.deliveryInfo.deliveryType] wrong format
8 [customerDetails.deliveryInfo.country] required field
8 [customerDetails.deliveryInfo.country] wrong format
8 [customerDetails.deliveryInfo.city] required field
8 [customerDetails.deliveryInfo.city] wrong format
8 [customerDetails.deliveryInfo.postAddress] required field
8 [customerDetails.deliveryInfo.postAddress] wrong format
8 [refundItems] required field
8 [refundItems.item.positionId] required field
8 [refundItems.item] wrong format
8 [refundItems.item.name] required field
8 [refundItems.item.name] wrong format
8 [refundItems.item.itemDetailsParams.name] required field
8 [refundItems.item.itemDetailsParams.name] wrong format
8 [refundItems.item.itemDetailsParams.value] required field
8 [refundItems.item.itemDetailsParams.value] wrong format
8 [refundItems.item.quantity] required field
8 [refundItems.item.quantity] invalid value
8 [refundItems.item.quantity.value] wrong format
8 [refundItems.item.quantity.measure] wrong format
8 [refundItems.item.quantity.value] Fractional part too large
8 [refundItems.item.quantity.value] Too large or too small value
8 [refundItems.item.quantity.value] Too small value to refund
8 [refundItems.item.itemAmount] wrong format
8 [refundItems.item.currency] wrong format
8 [refundItems.item.itemCode] required field
8 [refundItems.item.itemCode] wrong format
8 [loyalties.loyalty.loyaltyProgramName] required field
8 [loyalties.loyalty.loyaltyProgramName] wrong format
8 [loyalties.loyalty.positionId] required field
8 [loyalties.loyalty.positionId] wrong format
8 [loyalties.loyalty.bonusAmountForDebit] wrong format
8 [loyalties.loyalty.bonusAmountForCredit] wrong format
8 [refundItems.totalAmount] the amount of items in the cart does not match the total amount
8 [loyalties.withParams.sum] The amount of bonus points in the cart does not match the total amount of points in the order
8 The amount of bonus points to be debited in the cart exceeds the allowed amount
8 [loyalties.loyalty.positionId] there is no line item with the given positionId
8 [loyalties.loyalty.name] wrong format
8 [loyalties.loyalty.name] there is no loyalty program with that name
8 [refundItems.items] the original order does not contain line items
8 [refundItems.item.quantity.measure] required field
8 [refundItems.items.currency] the currency in the cart does not match the order currency
8 [refundItems.items.currency] wrong format
8 refund amount exceeded
8 [refundItems.items] required field
8 [refundItems.item.positionId] wrong format
8 [items.item.position] the original order does not contain a line item with this number
8 [items.item.name] the original order does not contain a line item with the given name
8 [items.item.code] the original order does not contain a line item with this code
8 [items.item.quantity] the number of copies of the heading does not correspond to that in the original order
8 [items.item.amount] the amount of the refund of the line item has been exceeded
8 [refundAmount] for a full refund, the amount refunded must be the same as in the original order
8 [item.quantity.value] required field
8 [item.itemAmount] required field
8 [item.currency] required field
8 a cart is required for the refund or an incorrect amount for a full refund of the order
8 [refundItems.item.quantity.value] Fractional part too large
8 [refundItems.item.quantity.value] Too large or too small value
8 [refundItems.item.quantity.value] Too small value to refund
8 Statistics violation detected
8 [orderBundle.loyalties.loyalty] payment using loyalty is disabled for this merchant
8 [item.itemCode] duplicated
8 [refundOrder.item.tax.type] incorrect
8 [refundOrder.item.tax.sum] mandatory
8 [refundOrder.item.tax.sum] incorrect
8 Mismatch between [orderBundle.cartItems.item.itemPrice] and [orderBundle.cartItems.item.itemAmount]
8 [wrong.transaction.state] The transaction must be in the Deposited state
8 The cart of this order does not contain [positionId]
8 If the refund amount for a line item is partial, then the quantity value must also be partial.
8 Cart is not expected in the request
8 [orderBundle.cartItems.item.itemPrice] required field
10 Incorrect name of the additional OFD parameter
10 Incorrect value of the additional CRF parameter

Examples

POST request example

amount=500&currency=643&language=ru&orderId=5e97e3fd-1d20-4b4b-a542-f5995f5e8208

Response example

{"errorCode":0}