Migration from Exchange API v1
First, you must generate private and public keys and switch the API authentication schema.
Migrating from v1 to v2 also involves updating your endpoint URLs to call the new v2 versions and modifying your applications to account for breaking changes introduced in v2.
Update the endpoint URL to https://api.changelly.com/v2. Next, update your application to account for several breaking changes made in v2. Review the following sections to see how the API methods have changed.
note
The following sections cover not only the breaking changes that must be taken into account but also the new features that have been added. For detailed information about new features and parameters introduced in API v2, refer to the API reference.
getExchangeAmount
- The
amount
parameter has been renamed toamountFrom
. - The
result
value now must be calculated as the difference betweenamountTo
andnetworkFee
. - Limits (
max
,maxFrom
,maxTo
,min
,minFrom
,minTo
) have been added to the response. Note: Limits can be retrieved only if theamountFrom
value is within the limits.
createTransaction
- The
amount
parameter has been renamed toamountFrom
. - The
amountExpectedTo
value must now be calculated as the difference betweenamountExpectedTo
andnetworkFee
. - 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 (asexchangeFee
).amountTo
– always 0 since there can be no actual payout for a new transaction.
- The following parameters have been added to the response:
type
refundAddress
refundExtraId
getTransactions
- The
status
parameter has been added to the request as an additional filter. - The
dateFrom
parameter in the request has been replaced bysince
.
createFixTransaction
- The
amount
parameter has been renamed toamountFrom
. - The
amountExpectedTo
value must now be calculated as the difference betweenamountExpectedTo
andnetworkFee
. - 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 (asexchangeFee
).amountTo
– always 0 since there can be no actual payout for a new transaction.
- The following parameters have been added to the response:
type
refundAddress
refundExtraId
Methods deprecated in v2
- getPairsParams and getMinAmount have been deprecated. To get the limits, you need to use getFixRateForAmount/getExchangeAmount, but the transaction amount must be within limits. A full-fledged replacement of these methods is also coming soon.
- getFixRate has been deprecated. To get the fixed rate, you need to use getFixRateForAmount, but the transaction amount must be within limits.