Skip to main content

Update order properties

Updates an order status. Additionally, with this method, you can change any order property.

info

After updating, Fiat API sends a callback.

HTTP request

patch
/v1/sandbox/order/{id}

Request

Header parameters

Requires authentification.

Query parameters

NameTypeRequiredDescription
idstringtrueTest order ID.

Body parameters

NameTypeRequiredDescription
currencyFromstringfalseTicker of the payin currency in uppercase.
currencyTostringfalseTicker of the payout currency in uppercase.
amountFromstringfalseAmount of currency the user is going to pay.
countrystringfalseCountry ISO 3166-1 code (Alpha-2).
statestringfalseState ISO 3166-2 code. Is required if provided country is US.
ipstringfalseUser's IP address.
walletAddressstringfalseRecipient wallet address.
walletExtraIdstringfalseProperty required for wallet addresses of currencies that use an additional ID for transaction processing (XRP, XLM, EOS, BNB).
refundAddressstringfalseRecipient refund address.
paymentMethodstringfalseThe payment method code. Possible values
userAgentstringfalseUser Agent.
metadataobjectfalseMetadata object, which can contain any parameters you need.
statusstringfalseTest order status. Possible values
amountTostringfalseAmount of currency the user is going to send.
payinAmountstringfalsePayin amount.
payoutAmountstringfalseEstimated payout amount.
payinCurrencystringfalseTicker of the payin currency.
payoutCurrencystringfalseTicker of the payout currency.
Sample cURL
curl --location --request PATCH
'https://fiat-api.changelly.com/v1/sandbox/order/5154302e-3stl-75p4'
--header 'X-Api-Key: {{apiKey}}'
--header 'X-Api-Signature: {{signature}}'
--data-raw '{
"status": "expired",
"currencyFrom": "USD"
}

Response

Response params

NameTypeRequiredDescription
redirectUrlstringtrueURL to the provider's purchase page.
returnSuccessUrlstringfalseReturn URL after a successfully completed transaction.
returnFailedUrlstringfalseReturn URL after a failed transaction.
orderIdstringtrueInternal order ID provided by Fiat API.
externalUserIdstringtrueUser ID provided by you.
externalOrderIdstringtrueOrder ID provided by you.
typestringtrueOrder type.
Enum: buy/sell.
providerCodestringtrueThe On-Ramp or Off-Ramp provider code. Possible values.
currencyFromstringtrueTicker of the payin 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).
statestringfalseState ISO 3166-2 code. Required if the provided country is US.
ipstringtrueUser's IP address.
walletAddressstringtrueRecipient wallet address.
walletExtraIdstringtrueProperty required for wallet addresses of currencies that use an additional ID for transaction processing (XRP, XLM, EOS, BNB).
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.
statusstringtrueTest order status. Possible values
payinAmountstringtruePayin amount.
payoutAmountstringtrueEstimated payout amount.
payinCurrencystringtrueTicker of the payin currency.
payoutCurrencystringtrueTicker of the payout currency.
updatedAtdate-timetrueTime in ISO 8601 format.

Learn more details about the returnSuccessUrl and returnFailedUrl parameters.

Sample response
application/json
{
"redirectUrl": "https://changelly.com/buy",
"returnSuccessUrl": "https://example.com/success",
"returnFailedUrl": "https://example.com/failed",
"orderId": "5154302e-3stl-75p4",
"externalUserId": "122hd",
"externalOrderId": "71ahw34",
"type": "buy",
"providerCode": "moonpay",
"currencyFrom": "USD",
"currencyTo": "ETH",
"amountFrom": "150",
"country": "US",
"state": "CA",
"ip": null,
"walletAddress": "0x8cfbd31371e9bec8c82ae101e25bd9394c03a227",
"walletExtraId": null,
"refundAddress": "0x8cfbd31371e9bec8c82ae101e25bd9394c03a227",
"paymentMethod": "card",
"userAgent": null,
"metadata": null,
"createdAt": "2025-09-18T11:46:45.994Z",
"status": "expired",
"payinAmount": null,
"payoutAmount": null,
"payinCurrency": null,
"payoutCurrency": null,
"updatedAt": "2025-09-18T15:06:07.672Z"
}

Error response

Error response parameters

Check the error response schema.

Possible error types in the errorType:

TypeDescription
validationValidation error. The request does not match the schema.
txTypeThe id parameter contains the ID of a production transaction.
statusThe test transaction already has the set status.

The errorDetails item schema:

NameTypeRequiredDescription
causestringtrueError cause.
valuestringtrueError value.

Error codes

CodeMessage
400BadRequest
401Unauthorized
403Forbidden
410Offer expired
422Unprocessable entity
429TooManyRequests
500InternalServerError
BadRequest for the validation error
BadRequest
{
"errorType": "validation",
"errorMessage": "Validation error",
"errorDetails": [
{
"cause": "providerCode",
"value": "Incorrect provider code"
}
]
}
BadRequest for the txType error
txType
{
"errorType": "BadRequest",
"errorMessage": "Transaction type is not test",
"errorDetails": [
{
"cause": "type",
"value": "production"
}
]
}
BadRequest for the status error
BadRequest
{
"errorType": "txType",
"errorMessage": "Transaction already has that status. ",
"errorDetails": [
{
"cause": "status",
"value": "finished"
}
]
}