Migration from Exchange API v1
Migrating from Exchange API v1 to Exchange API v2 involves following steps:
- Generate private and public keys.
- Upadte the API authentication schema.
- Update the endpoint URL to
https://api.changelly.com/v2. - Update your application to account for several breaking changes made in Exchange API v2. Review the following sections to see how the API methods have changed.
info
The following sections cover not only the breaking changes but also the added new features. For more details about new features and parameters introduced in Exchange API v2, refer to the Exchange API reference.
getExchangeAmount
- The
amountparameter has been renamed toamountFrom. - The
resultvalue now must be calculated as the difference betweenamountToandnetworkFee. - The following parameter has been added to the request:
userMetadata
- The following parameters has been added to the response:
amountTo- Limits parameters (
max,maxFrom,maxTo,min,minFrom,minTo). Note: limits can be retrieved only if theamountFromvalue is within the limits.
createTransaction
- The
amountparameter has been renamed toamountFrom. - The
amountExpectedTovalue must now be calculated as the difference betweenamountExpectedToandnetworkFee. - The following parameters have been added to the request:
fromAddressfromExtraIduserMetadata
- The following parameters have been removed from the response:
apiExtraFee– can be retrieved using the getTransactions method.changellyFee– can be retrieved using the getTransactions method.amountTo– always 0 since there can be no actual payout for a new transaction.
- The following parameters have been added to the response:
typerefundAddressrefundExtraIdnetworkFee
getTransactions
- The
dateFromparameter in the request has been replaced bysince. - The following parameters have been added to the request as additional filters:
statuspayoutAddress
- The following parameter has been added to the response:
payTill
createFixTransaction
- The
amountparameter has been renamed toamountFrom. - The
amountExpectedTovalue must now be calculated as the difference betweenamountExpectedToandnetworkFee. - The following parameters have been adder to the request:
fromAddressfromExtraIduserMetadata
- The following parameters have been removed from the response:
apiExtraFee– can be retrieved using the getTransactions method.changellyFee– can be retrieved using the getTransactions method.amountTo– always 0 since there can be no actual payout for a new transaction.
- The following parameters have been added to the response:
typerefundAddressrefundExtraIdnetworkFee
Methods deprecated in v2
- getPairsParams and getMinAmount. To get the limits, use getFixRateForAmount/getExchangeAmount, but the transaction amount must be within limits. A full-fledged replacement of these methods is also coming soon.
- getFixRate. To get the fixed rate, use getFixRateForAmount, but the transaction amount must be within limits.