address
The model allows merchant to create cryptocurrency addresses and receive their parameters, used to send and receive payments.
Using the address model's methods the merchant can:
- Create the cryptocurrency address - method address.create
- Receive the details of merchant's cryptoaddress - method address.get
- Receive the merchant's cryptoaddresses list - method address.list
- Receive the list of available payways - method address.payways
- Set or modify callback_URL of previously created cryptoaddresses - method address.edit_cb_url
endpoint
Queries for the model's methods are sent to an endpoint https://api.any.money/.
address.create
The method creates the cryptocurrency address (crypto wallet) and returns the representation of its parameters.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| in_curr | yes | "BTC" | the currency of created cryptoaddress |
| payway | yes | "btc" | payway name for the created cryptoaddress. * In order for the method to work correctly, it is necessary to pass in the request a combination of the payway and the currency according to the description |
| callback_url | no | "https://any_money.redirect.com" | URL for sending notifications of payment receipt to the address. Notification format |
| comment | no | "Comment" | cryptoaddress comment, less than 50 characters |
| out_curr | no | "UAH" | out currency for created cryptoaddress (for cryptoaddress with auto convertation) |
| override_address | no | false | address override flag. true - even if payer + payway + in_curr + out_curr match, a new address will be created, false - if there is a match for payer + payway + in_curr + out_curr an existing address will be returned. By default false |
| payer | no* | "[email protected]" | payer identifier. If a combination of payer + payway + in_curr + out_curr finds an existing address, it will be returned, otherwise a new address will be created |
*payway required parameter if the payer is passed *payer required parameter if the override_address is passed
Valid combinations payway and in_curr
| Cryptocurrency | Request parameter payway | Request parameter in_curr |
|---|---|---|
| Bitcoin | btc | BTC |
| Ether | eth | ETH |
| Litecoin | ltc | LTC |
| USDT(ERC-20 token on the Ethereum network) | erc20 | USDT |
| USDT(TRC-20 token on the TRON network) | trc20 | USDT |
| TRX | tron | TRX |
Caution!
For typed merchants transmitted payway must match the merchant's type and out_curr must not be transferred since the currency conversion operation is not available for such merchant type
Caution!
The process of a crypto address creation may take some time, therefore after a successful request, you must call the address.get method until the crypto address is received in the response (the value of the name parameter).
Method response data
Created cryptoaddress parameters
Exceptions
- EParamCurrencyInvalid
-
- in_curr currency not present in a system
- in_curr=out_curr
- EParamFieldInvalid
- invalid callback_url transmitted
- EParamInvalid
-
- transmitted payway does not match the merchant's type
- max comment length is exceeded
- payway must be passed along with payer
- payer must be passed along with override_address
- EParamPaywayInvalid
-
- transmitted payway is not cryptopayway
- in_curr does not match with transmitted payway
- EStateCurrencyInactive
- in_curr and/or out_curr currencies are deactivated by administrator
- EStateCurrencyUnavail
- in_curr and/or out_curr are unavailable
- EStateExchangeUnavail
- convertation from in_curr to out_curr is blocked for the typed merchant
address.get
It is a method for finding and obtaining the information about cryptoaddress that are linked to the merchant. Method returns params representation for the founded cryptoaddress.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| id | yes* | "844422933266350" | cryptoaddress ID |
| name | yes* | "3E8sEHMof39RgSHqSZswintqaXi3fSKYJN" | cryptoaddress string |
*make sure to transmit only one argument for address.get. (id or name)
Method response data
cryptoaddress parameters
Exceptions
- EParamInvalid
- none of the name or id arguments was transmitted, the invalid value of the id or name argument was transmitted, the name or id were transmitted simultaneously
- EParamNotFound
- address with transmitted arguments is not found
- EParamType
- wrong data type for id argument
address.list
Method for displaying a list of cryptoaddresses that are linked to the merchant. Parameters are represented for each of them. Search filters are combined by logical AND.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| begin | no | "123456789" | the filter by the beginning of the responses range (timestamp). If rotate = true - by date and time of the last address using (timestamp) If rotate = false - by the time of its creation. default = "0" |
| count | no | "136" | the size of the method responses sample (the value cannot exceed "200"). default = "20" |
| end | no | "234567890" | the filter by the end of the responses sample range (timestamp). If rotate = true - by date and time of the last use of the address (timestamp) If rotate = false - by the time of its creation. default = "now" |
| first | no | "17" | the object number in the received sample of results, from which the addresses list and the scoring of count argument starts |
| in_curr | no | "BTC" | the method response filter by cryptocurrency |
| is_autoconvert | no | false | the address filter by auto convertation (true - only addresses with auto convertation will get into the selection, false - only without auto-convertation) |
| name | no | "dsf34s5t" | the filter by the cryptoaddress name, including the partial matching |
| ord_by | no | "ctime" | the filter by timestamps (“ctime” - creation time, “last_used” - last used time) |
| ord_dir | no | false | the sort direction by timestamps |
| out_curr | no | "USD" | the filter by out currency for auto convertation cryptoaddresses |
| payer | no | "[email protected]" | the filter by payer |
| rotate | no | false | the cryptoaddresses filter by the autorotation ( true - only addresses with autorotation "on", false - only with "off" autorotation). default=false |
Feature of the begin, end argument's pair processing
For the begin argument a system will always assign the smaller value from the transmitted pair, and for the end it will always assign the largest. Regardless of the names they were transferred with
Caution!
For typed merchants in_curr must be equal to out_curr or both arguments are not transmitted, otherwise, an exception will be raised
Method response data
- count
- current response sample size
- data
- data representations array of cryptoaddresses
- first
- first address number in the method response sample. It is begins the count argument counting
- page
- current response page
- page_total
- response pages total
- total
- total addresses found matching query filters
Exceptions
- EParamCurrencyInvalid
- currency not present in a system
- EParamInvalid
-
- wrong values for first, count, begin, end, ord_by arguments were transmitted
- auto convertation denied for the typed merchant
- EParamType
- wrong data type transmitted for any of first, count, begin, end, is_autoconvert, rotate arguments
- EStateExchangeUnavail
- convertation from in_curr to out_curr is blocked for the typed merchant
address.payways
The method returns the names of all cryptopayways where the merchant can create the address. If in_curr is transmitted, the response will include only payways names that work with given currency.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| in_curr | no | "BTC" | credit currency name |
Method response data
The list of available cryptopayways for the merchant
Exceptions
- EParamNotFound
- cryptopayway is not found
- EParamPaywayInvalid
- cryptopayway name is unacceptable
- EParamCurrencyInvalid
- cryptocurrency name is unacceptable
- EStateCurrencyUnavail
- could not find a cryptocurrency with the transmitted name in_curr, or the currency is not a crypto
address.edit_cb_url
Method for setting or changing the callback_URL of previously created cryptoaddresses.
Input method arguments
| Param | Required | Example | Description |
|---|---|---|---|
| callback_url | no | "https://any_money.redirect.com" | original cryptoaddress callback_url |
| in_curr | no | "BTC" | cryptoaddress credit currency name |
| new_callback_url | no | "https://any_money.redirnew.com" | new cryptoaddress callback_url. If not transmitted - callback_url will be cleared in corresponding addresses |
| payway | no | "btc" | cryptoaddress payway |
Method response data
- updated
- number of updated crypto addresses
Exceptions
- EParamCurrencyInvalid
- currency not present in a system
- EParamInvalid
- invalid values for any of the callback_url or new_callback_url were transmitted
- EParamNotFound
- no one crypto addresses found to update
- EParamPaywayInvalid
- transmitted wrong payway name