Get offers
List of purchase offers from On-Ramp providers.
HTTP request
get
/v1/offers
Request
Header parameters
Requires authentification.
Query parameters
Name | Type | Required | Description |
---|---|---|---|
providerCode | string | false | The On-Ramp provider code. Possible values. |
externalUserID | string | false | User ID provided by you. |
currencyFrom | string | true | Ticker of the pay-in currency in uppercase. |
currencyTo | string | true | Ticker of the payout currency in uppercase. |
amountFrom | string | true | Amount of currency the user is going to pay. |
country | string | true | Country ISO 3166-1 code (Alpha-2). |
state | string | false | State ISO 3166-2 code. Is required if provided country is US . |
ip | string | false | User's IP address. |
Sample cURL
curl --location --request GET
'https://fiat-api.changelly.com/v1/offers?externalUserId=122hd¤cyFrom=EUR¤cyTo=ETH&amountFrom=150&country=FR'
--header 'X-Api-Key: {{apiKey}}'
--header 'X-Api-Signature: {{signature}}'
Response
Response params
Name | Type | Description |
---|---|---|
offers | array of objects | Array of offers. |
offers
item schema
Name | Type | Required | Description |
---|---|---|---|
providerCode | string | true | The On-Ramp provider code. Possible values. |
offerId | string | true | Offer ID provided by Fiat API. |
rate | string | true | The best rate of purchase among all payment methods. The rate includes all the fees. |
invertedRate | string | true | Inverted rate of purchase. |
fee | string | true | The lowest value of the total fee of purchase among all payment methods. |
amountFrom | string | true | Amount of currency the user is going to pay. |
amountExpectedTo | string | true | The largest amount of funds among all payment methods that the user is expected to get after the purchase. |
paymentMethodOffer | array of objects | true | Purchase details for each available payment type. |
paymentMethodOffer
item schema
Name | Type | Required | Description |
---|---|---|---|
offerId | string | true | Offer ID provided by Fiat API. |
amountExpectedTo | string | true | The amount of funds that the user is expected to get after the purchase. |
method | string | true | The payment method code. Possible values. |
methodName | string | true | The payment method name. Possible values. |
rate | string | true | Current rate of purchase, which includes all the fees. |
invertedRate | string | true | Inverted rate of purchase. |
fee | string | true | Total fee of purchase. |
Sample response
application/json
[
{
"providerCode": "moonpay",
"offerId": "e38e0d37-8a70-4d20-b4e0-14aca4a3de4b",
"rate": "0.00000753333333333333",
"invertedRate": "132743.36283185846581564727",
"fee": "5.32",
"amountFrom": "150",
"amountExpectedTo": "0.00113",
"paymentMethodOffer": [
{
"offerId": "e38e0d37-8a70-4d20-b4e0-14aca4a3de4b",
"amountExpectedTo": "0.00113",
"method": "revolut",
"methodName": "Revolut",
"rate": "0.00000753333333333333",
"invertedRate": "132743.36283185846581564727",
"fee": "5.32"
},
{
"offerId": "fa4a96a8-b95a-4880-8a49-b5faa053792c",
"amountExpectedTo": "0.00105",
"method": "card",
"methodName": "Visa / Mastercard",
"rate": "0.000007",
"invertedRate": "142857.14285714285714285714",
"fee": "9.09"
}
]
},
{
"providerCode": "banxa",
"offerId": "5cf80399-c5a8-4154-88de-218c8b3437da",
"rate": "0.0000075532",
"invertedRate": "132394.21702060054016840544",
"fee": "3.15",
"amountFrom": "150",
"amountExpectedTo": "0.00113298",
"paymentMethodOffer": [
{
"offerId": "5cf80399-c5a8-4154-88de-218c8b3437da",
"amountExpectedTo": "0.00113298",
"method": "apple_pay",
"methodName": "Apple Pay",
"rate": "0.0000075532",
"invertedRate": "132394.21702060054016840544",
"fee": "3.15"
}
]
}
]
Error response
Error response parameters
Check the error response schema.
Possible error types in the errorType
item:
Type | Description |
---|---|
validation | Validation error. |
timeout | Request to the provider was not completed in the allotted time. |
unavailable | Request failed at the provider's end. |
limits | Specified pay-in amount is less than the minimum or more than the maximum value for the fiat currency. |
country | Specified country is not supported by the provider. |
state | Offer requested for the United States, but the state parameter is not provided. |
currency | Specified currency pair is not supported by the provider. |
paymentMethod | Specified payment method is not supported by the provider. |
invalidOffer | On-Ramp provider returned an invalid offer. |
The errorDetails
item schema:
Name | Type | Required | Description |
---|---|---|---|
cause | string | true | Error cause. For example, it can equal min or max for the limits error type. |
value | string | true | Error value. For example, it can equal the min or max supported value for the limits error type. |
Error codes
Code | Message |
---|---|
400 | BadRequest |
401 | Unauthorized |
429 | TooManyRequests |
500 | InternalServerError |
- 400
- 401
- 429
- 500
BadRequest
{
"errorType": "validation",
"errorMessage": "Validation error",
"errorDetails": [
{
"cause": "providerCode",
"value": "Incorrect provider code"
}
]
}
Unauthorized
{
"errorType": "unauthorized",
"errorMessage": "Unauthorized",
"errorDetails": null
}
TooManyRequests
{
"errorType": "tooManyRequests",
"errorMessage": "Too many requests",
"errorDetails": null
}
InternalServerError
{
"errorType": "internalServerError",
"errorMessage": "Internal Server Error",
"errorDetails": null
}