Wiki

Exchanger Trans Change

This API allow to chang the exchange rate of the new bid.

<?xml version=\"1.0\"?>
<wm.exchanger.request>
    <wmid></wmid>
    <signstr></signstr>
    <operid></operid>
    <curstype></curstype>
    <cursamount></cursamount>
    <capitallerwmid></capitallerwmid>
</wm.exchanger.request>
  • Request parameters:
name purpose comments
wmid Signer's WMID WMID from which a new bid will be placed.
signstr Request signature. 132-digits digital signature (by .kwm keys of the wmid) encoding the value of three tags of the request, pulled together in one line without spaces, "wmid + inpurse + outpurse + inamount + outamount"
operid bid number number of the new bid, placed by a WMID, exchange rate subject to change
cursamount new exchange rate of the operid, both direct or reverse ratio of the amount billed for exchange to the amount to be received as a result of an exchange
curstype exchange type at the cursamount tag, where "0" - direct rate (amount to be exchanged against amount to be received) and "1" - reverse rate (amount to be received against amount placed for exchange)
capitallerwmid optional field if Capitaller’s WMID is being transferred in this field (www.capitaller.ru) the exchange bid on behalf of capitallerwmid may be set under this request. In this case there must be an access for WMID which signs the request which is described at Capitaller’s Impersonalization page.
  • Response format:
<?xml version=\"1.0\"?>
<wm.exchanger.response>
    <retval></retval>
    <retdesc></retdesc>
    <AmountRestIn></AmountRestIn>
    <AmountRestOut></AmountRestOut>
</wm.exchanger.response>
  • Response parameters
Name Purpose Description
retval Execution code "0" means that the request was executed successfully. Check the execution code table for detailed information;
retdesc Execution code description error description in case retval tag is not 0
percentporog posible step optional parameter if retval code 7
capitallerwmid
  • Example
<?xml version=\"1.0\"?>
<wm.exchanger.request>
    <wmid>500000000008</wmid>
    <signstr>7a2987749e5453a5cb66a74a51837f0c7006c35ec7f4699e8a1fa5e26331fbd8d1c8a19ca1dec79d1403d1a8c89957bddf65bcf6409083a82805bd79388dbe9600e4</signstr>
    <operid>27795291</operid>
    <curstype>2</curstype>
    <cursamount>58.0645</cursamount>
    <capitallerwmid>0</capitallerwmid>
</wm.exchanger.request>

<?xml version=\"1.0\"?>
<wm.exchanger.response>
    <retval>0</retval>
    <retdesc></retdesc>
    <AmountRestIn>90</AmountRestIn>
    <AmountRestOut>1,55</AmountRestOut>
</wm.exchanger.response>
  • Execution/Error Codes
Code Description
-10 The client wmid is not specified
-11 Error occurred during the signature verification, tag signstr
-12 Error when specifying the bid number which needs to be changed
-13 Error when specifying a new bid rate. It should contain only digits and a delimiter symbol with no spaces or unnecessary symbols.It must be specified and maximum length is 10 symbols
-14 Signature verification failed.%Str%
-15 Error - Failed loading XML with query parameters
1 The bid that you have chosen to change the rate is not found, it may have already been deleted or fully redeemed
7 You have changed the exchange rate more than 10-15% (in a favorable direction) or more than 5% (in unprofitable), or exchanger rate is wrong, or you should approach to neccesary rate step by step. <percentporog>0,75</percentporog>
8 Exchange rate too low(too high), amount which has to be transferred to the purse, after exchange operation will be 0. You should set better rate
9 Change of bid exchange rate was not made
11 Change of bid exchange rate was not made.Old and new rate value is equal.
19 This bid currently hold for exchange operation, try to make the operation later after 1 minute
23 You change the bid rate too often or too quickly, wait 1 hour if you have changed the bid rate more than 60 times during the current hour, or wait one and a half minutes if you have just changed the rate.
27 You change the bid rate too often or too quickly (WMX, WMH, WML), you should wait 1 hour if you have changed the bid rate just now.
121 Exchange rate can't be less or equal to 0.
122 The type of bid rate that you specify must be selected.