transfer
Using the transfer model's methods the merchant can:
- Create money transfer orders using the method transfer.create;
- Preliminary calculate the transfer parameters - method transfer.calc;
- Get information about the selected transfer - method transfer.get
- Cancel a transfer order - method transfer.cancel
endpoint
Queries for the model's methods are sent to endpoint https://api.any.money/.
transfer.create
The method for creating a transfer order between the merchant's balances. If the credit currency is not transmitted, the in_curr value is taken equal to query out_curr.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| amount | yes | "435345,34" | transfer amount in the debit currency |
| externalid | yes | "123" | unique ID specified by the merchant |
| out_curr | yes | "USD" | debit currency name |
| tgt | yes | "1056" | addressee of the funds transfer (merchant's lid that transfer is addressed to) |
| callback_url | no | "https://any_money.callback.com" | URL-address for automatically message sending about changes of the order status. Messages format |
| in_curr | no | "UAH" | credit currency name |
Caution!
For typed merchants, the transmitted recipient type tgt have to match the type of merchant-payer, and in_curr
must be equal to out_curr or absent. Otherwise, the relevant exceptions will be returned
Caution!
Immediately after the query is received, an order is created and its processing is started. After the method is executed the money will be debited from the balance
Method response data
transfer transaction type order parameters representation
Exceptions
- EParamAmountFormatInvalid
- amount argument wrong format
- EParamAmountTooBig
- amount exceeds the transfer transaction maximum amount
- EParamAmountTooSmall
- amount is less than the transfer transaction minimum amount
- EParamCurrencyInvalid
- out_curr parameter is not transmitted, or nonexistent currency is transmitted
- EParamFieldInvalid
- invalid callback_url argument transmitted
- EParamInvalid
-
- invalid argument transmitted
- tgt does not match merchant type
- EParamMerchantInvalid
- merchant (transfer recipient) is inactive
- EParamOffLimits
- argument value exceeds the limits
- EParamType
- tgt argument wrong type
- EParamUnique
- an order with transmitted externalid already exists
- EStateCurrencyInactive
- inactive credit/debit currency transmitted
- EStateExchangeUnavail
-
- exchange direction is not available
- in_curr does not match the out_curr for typed merchant
- EStateInsufficientFunds
- user does not have enough funds in the credit currency to make a transfer or to convert to the debit currency ordered amount
- EStateOutPayUnavailable
- payments and transfers are blocked throughout a system or for the actual merchant
transfer.calc
Method for calculating the parameters of a transfer order with a known amount.
If the credit currency is not transmitted, the in_curr value is taken equal to query out_curr.
The method calculates and returns a representation of the transfer transaction parameters.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| amount | yes | "1000" | transfer amount |
| out_curr | yes | "USD" | debit currency |
| in_curr | no | "USD" | credit currency |
| tgt | no | "6489" | recipient of the fund transfer (lid of the merchant to whom the transfer is addressed). If the argument is passed, the calculation will be made with the parameters (individual fee) of the recipient |
Caution!
For typed merchants, the transmitted recipient type tgt have to match the type of merchant-payer, and in_curr
must be equal to out_curr or absent. Otherwise the propper exceptions will be returned
Method response data
- account_amount
- amount withdrawn from the payer balance (in_amount+in_fee_amount)
- in_amount
- order credit amount
- in_fee_amount
- order fee amount in the credit currency
- orig_amount
- original amount (ordered while order creating)
- out_amount
- order debit amount
- out_fee_amount
- order fee amount in the debit currency
Exceptions
- EParamAmountFormatInvalid
- amount argument wrong format
- EParamAmountTooBig
- amount exceeds the transfer transaction maximum amount
- EParamAmountTooSmall
- amount is less than the transfer transaction minimum amount
- EParamCurrencyInvalid
- out_curr parameter is not transmitted, or nonexistent currency is transmitted
- EParamInvalid
-
- invalid argument transmitted
- tgtdoes not match merchant type
- EStateCurrencyInactive
- inactive credit/debit currency transmitted
- EStateExchangeUnavail
-
- exchange direction is not available
- in_curr does not match the out_curr for typed merchant
- EStateInsufficientFunds
- user does not have enough funds in the credit currency to make a transfer or to convert to the debit currency ordered amount
transfer.get
The method for search and display the of transferring funds between merchants' balances orders (transfer type orders) by its identifier.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| externalid | yes | "123" | unique ID specified by the merchant |
Method response data
transfer type transaction order parameters representation
Exceptions
- EParamInvalid
- wrong externalid argument value is transmitted
- EParamNotFound
- order with transmitted externalid not found
transfer.cancel
Method for canceling a transfer order by identifier (externalid). Returns a representation of a canceled order.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| externalid | yes | "221" | unique order's ID specified by the merchant |
Method response data
data representation of the canceled transfer order
Exceptions
- EParamInvalid
- externalid argument value is not transmitted or wrong
- EParamNotFound
- no order was found with the corresponding externalid
- EParamType
- wrong externalid format
- EStateForbidden
- an order is finalized and cannot be canceled