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



Request for an available loyalty program and the possible number of bonus points to be debited

The getPossibleLoyalty request returns the name of the loyalty program the bonus points of which can be used to pay for the order, as well as the maximum and minimum number of such points.

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

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.

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.

bindingId

AN..255

required if pan is not passed

Identifier of the binding created earlier.

pan

N12…19

required if not passed bindingId

Payment card number.

Response parameters:

Name Type Mandatory Description

errorCode

ANS..3

Yes

Error code.

errorMessage

AN..512

No

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

minAmount

N..20

No

The minimum amount of bonus points that can be used along with payment for an order.

maxAmount

N..20

No

The maximum amount of bonus points that can be used along with payment for an order. Within one payment, the user cannot spend more points than specified in this parameter.

serviceName

AN..512

No

Bonus program code within the system.

Error codes (errorCode field):

Value Description
0 The request has been processed without system errors.
5 Access denied.
6 Order not found.
7 System error.

Request example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loy="http://engine.paymentgate.ru/webservices/sbrf/loyalty">
   <soapenv:Header/>
   <soapenv:Body>
      <loy1:getAvailableLoyalty xmlns:loy1="http://engine.paymentgate.ru/webservices/merchant/loyalty">
         <arg0>
            <bindingId> </bindingId>
            <language> </language>
            <orderId>3c52bbe4-777f-49b0-afb8-bb2b6a971f74</orderId>
            <pan>4276010013866254</pan>
         </arg0>
      </loy1:getAvailableLoyalty>
   </soapenv:Body>
</soapenv:Envelope>

Response example:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns1:getAvailableLoyaltyResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant/loyalty">
         <return errorCode="0">
            <loyaltyOperations>
               <maxAmount>6000</maxAmount>
               <minAmount>0</minAmount>
               <serviceName>sbrf_spasibo</serviceName>
            </loyaltyOperations>
         </return>
      </ns1:getAvailableLoyaltyResponse>
   </soap:Body>
</soap:Envelope>