Skip to main content

Create order

Create a crypto sell order and get a redirect URL to the selling page.

HTTP request

post
/v1/sell/orders

Request

Header parameters

Requires authentification.

Body parameters

NameTypeRequiredDescription
amountFromnumbertrueAmount of currency the user is going to pay.
countrystringtrueCountry ISO 3166-1 code (Alpha-2).
statestringfalseState ISO 3166-2 code. Is required if provided country is US.
currencyFromstringtrueTicker of the payin currency in uppercase.
currencyTostringtrueTicker of the payout currency in uppercase.
externalOrderIdstringtrueOrder ID provided by you.
externalUserIdstringtrueUser ID provided by you.
providerCodestringtrueThe Off-Ramp provider code. Possible values.
ipstringfalseUser's IP address.
metadataobjectfalseMetadata object, which can contain any parameters you need.
paymentMethodstringfalseThe payment method code. Possible values.
refundAddressstringfalseRecipient refund address.
userAgentstringfalseUser Agent.
Sample payload
application/json
{
"externalOrderId": "test_user",
"externalUserId": "test_order",
"providerCode": "moonpay",
"currencyFrom": "BTC",
"currencyTo": "EUR",
"amountFrom": 0.1,
"country": "NL"
}
Sample cURL
curl --location --request POST
'https://fiat-api.changelly.com/v1/sell/orders'
--header 'X-Api-Key: {{apiKey}}'
--header 'X-Api-Signature: {{signature}}'
--data-raw '{
"externalOrderId": "test_user",
"externalUserId": "test_order",
"providerCode": "moonpay",
"currencyFrom": "BTC",
"currencyTo": "EUR",
"amountFrom": 0.1,
"country": "NL"
}'

Response

info

If any of the optional parameters are not provided in the request, they will be returned with the null value in the response.

Response params

NameTypeRequiredDescription
amountFromstringtrueAmount of currency the user is going to pay.
countrystringtrueCountry ISO 3166-1 code (Alpha-2).
statestringtrueState ISO 3166-2 code. Is required if provided country is US.
createdAtdate-timetrueTime in ISO 8601 format.
currencyFromstringtrueTicker of the payin currency in uppercase.
currencyTostringtrueTicker of the payout currency in uppercase.
externalUserIdstringtrueUser ID provided by you.
ipstringtrueUser's IP address.
metadataobjecttrueMetadata object, which can contain any parameters you need:
  • If you don't provide the metadata object in the request, null will be returned in metadata in response.
  • If you specify an empty object in the request, an empty object will be returned in the response.
orderIdstringtrueInternal order ID provided by Fiat API.
externalOrderIdstringtrueOrder ID provided by you.
paymentMethodstringtrueThe payment method code. Possible values
providerCodestringtrueThe Off-Ramp provider code. Possible values.
redirectUrlstringtrueURL to the provider's selling page.
refundAddressstringtrueRecipient refund address.
userAgentstringtrueUser Agent.
Sample response
application/json
{
"redirectUrl": "https://sell.moonpay.com/changelly?...",
"orderId": "47430d7d-79f0-4f6d-a738-9d6250f25c9b",
"externalUserId": "test_user",
"externalOrderId": "test_order",
"providerCode": "moonpay",
"currencyFrom": "BTC",
"currencyTo": "EUR",
"amountFrom": "0.1",
"country": "NL",
"state": "None",
"ip": "None",
"refundAddress": "...",
"paymentMethod": "sepa_bank_transfer",
"userAgent": "None",
"metadata": "None",
"createdAt": "2025-10-06T11:48:25.557Z"
}

Error response

Error response parameters

Check the error response schema.

Possible error types in the errorType item:

TypeDescription
currencySpecified currency pair is not supported by the provider.
invalidOfferOff-Ramp provider returned an invalid offer.
limitsSpecified payin amount is less than the minimum or more than the maximum value for the fiat currency.
paymentMethodSpecified payment method is not supported by the provider.
stateOffer requested for the United States, but the state parameter is not provided.
timeoutRequest to the provider was not completed in the allotted time.
unavailableRequest failed at the provider's end.
unsupportedCountrySpecified country is not supported by the provider.
validationValidation error.

The errorDetails item schema:

NameTypeRequiredDescription
causestringtrueError cause. For example, it can equal min or max for the limits error type.
valuestringtrueError value. For example, it can equal the min or max supported value for the limits error type.

Error codes

CodeMessage
400Bad request
401Unauthorized
404Not found
429Too many requests
500Internal server error
Bad Request
{
"errorType": "limits",
"errorMessage": "Too low in amount",
"errorDetails": [
{
"cause": "reason",
"value": "min"
},
{
"cause": "min",
"value": "20"
}
]
}