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
externalOrderIdstringtrueOrder ID provided by you.
externalUserIdstringtrueUser ID provided by you.
providerCodestringtrueThe Off-Ramp provider code. Possible values.
currencyFromstringtrueTicker of the pay-in currency in uppercase.
currencyTostringtrueTicker of the payout currency in uppercase.
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.
ipstringfalseUser's IP address.
refundAddressstringtrueRecipient refund address
paymentMethodstringfalseThe payment method code. Possible values.
userAgentstringfalseUser Agent.
metadataobjectfalseMetadata object, which can contain any parameters you need.
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
redirectUrlstringtrueURL to the provider's selling page.
orderIdstringtrueInternal order ID provided by Fiat API.
externalUserIdstringtrueUser ID provided by you.
externalOrderIdstringtrueOrder ID provided by you.
providerCodestringtrueThe Off-Ramp provider code. Possible values.
currencyFromstringtrueTicker of the pay-in currency in uppercase.
currencyTostringtrueTicker of the payout currency in uppercase.
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.
ipstringtrueUser's IP address.
refundAddressstringtrueRecipient refund address.
paymentMethodstringtrueThe payment method code. Possible values
userAgentstringtrueUser Agent.
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.
createdAtdate-timetrueTime in ISO 8601 format.
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
validationValidation error.
timeoutRequest to the provider was not completed in the allotted time.
unavailableRequest failed at the provider's end.
limitsSpecified pay-in amount is less than the minimum or more than the maximum value for the fiat currency.
countrySpecified country is not supported by the provider.
stateOffer requested for the United States, but the state parameter is not provided.
currencySpecified currency pair is not supported by the provider.
paymentMethodSpecified payment method is not supported by the provider.
invalidOfferOff-Ramp provider returned an invalid offer.

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
400BadRequest
401Unauthorized
429TooManyRequests
500InternalServerError
BadRequest
{
"errorType": "limits",
"errorMessage": "Limits error",
"errorDetails": [
{
"cause": "min",
"value": "20"
}
]
}